[parisc-linux-cvs] linux-2.5 tausq

Matthew Wilcox willy@debian.org
Mon, 22 Jul 2002 12:21:33 +0100


On Mon, Jul 22, 2002 at 12:28:07AM -0700, Randolph Chung wrote:
> +#define flush_cache_range(vma,s,e) do { flush_kernel_dcache_range(s,e); flush_icache_range(s,e); } while (0)
> +
> +#define flush_cache_page(vma,addr) do { flush_kernel_dcache_page(addr); flush_kernel_icache_page(addr); } while (0)

I _really_ doubt these can be right.  we're passed a VMA, so these must
be user addresses.

> +#define virt_addr_valid(kaddr)	pfn_valid(__pa(kaddr) >> PAGE_SHIFT)

looks plausible.

> @@ -328,8 +331,16 @@ extern inline pte_t pte_modify(pte_t pte
>  #endif
>  
>  /* Find an entry in the third-level page table.. */ 
> -#define pte_offset_map(pmd, address) \
> -((pte_t *) pmd_page(*(pmd)) + (((address)>>PAGE_SHIFT) & (PTRS_PER_PTE-1)))
> +#define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
> +#define pte_offset_kernel(pmd, address) \
> +	((pte_t *) pmd_page_kernel(*(pmd)) + __pte_offset(address))
> +#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
> +#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
> +#define pte_unmap(pte) do { } while (0)
> +#define pte_unmap_nested(pte) do { } while (0)
> +
> +#define pte_unmap(pte)			do { } while (0)
> +#define pte_unmap_nested(pte)		do { } while (0)

cool, glad you cleaned that little bit up.

> +#define flush_tlb_kernel_range(start, end) flush_tlb_range(&init_mm, start, end)

no, i don't think this can be right -- init's mm is different from the
kernel's mm.

-- 
Revolutions do not require corporate support.