Fix up pfn_valid definitions of other arches There seems to be a lot of crap here in some arches. We will need to deal later with that. Signed-off-by: Christoph Lameter Index: linux-2.6.18-mm3/include/asm-alpha/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-alpha/page.h 2006-10-04 00:50:06.743982534 -0500 +++ linux-2.6.18-mm3/include/asm-alpha/page.h 2006-10-04 01:24:23.273764409 -0500 @@ -86,7 +86,6 @@ typedef unsigned long pgprot_t; #ifndef CONFIG_DISCONTIGMEM #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #endif /* CONFIG_DISCONTIGMEM */ Index: linux-2.6.18-mm3/include/asm-cris/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-cris/page.h 2006-10-04 00:50:06.755702277 -0500 +++ linux-2.6.18-mm3/include/asm-cris/page.h 2006-10-04 01:24:23.287437445 -0500 @@ -43,7 +43,6 @@ typedef struct { unsigned long pgprot; } /* On CRIS the PFN numbers doesn't start at 0 so we have to compensate */ /* for that before indexing into the page table starting at mem_map */ #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) -#define pfn_valid(pfn) (((pfn) - (PAGE_OFFSET >> PAGE_SHIFT)) < max_mapnr) /* to index into the page map. our pages all start at physical addr PAGE_OFFSET so * we can let the map start there. notice that we subtract PAGE_OFFSET because Index: linux-2.6.18-mm3/include/asm-frv/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-frv/page.h 2006-10-04 00:50:06.764492084 -0500 +++ linux-2.6.18-mm3/include/asm-frv/page.h 2006-10-04 01:24:23.305017062 -0500 @@ -55,12 +55,8 @@ extern unsigned long max_low_pfn; extern unsigned long min_low_pfn; extern unsigned long max_pfn; -#ifdef CONFIG_MMU -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#else +#ifndef CONFIG_MMU #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) >= min_low_pfn && (pfn) < max_low_pfn) - #endif #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) Index: linux-2.6.18-mm3/include/asm-h8300/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-h8300/page.h 2006-10-04 00:50:06.774258536 -0500 +++ linux-2.6.18-mm3/include/asm-h8300/page.h 2006-10-04 01:24:23.318690097 -0500 @@ -66,7 +66,6 @@ extern unsigned long memory_end; #define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) #define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) #define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) -#define pfn_valid(page) (page < max_mapnr) #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) Index: linux-2.6.18-mm3/include/asm-m32r/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-m32r/page.h 2006-10-04 00:50:06.782071698 -0500 +++ linux-2.6.18-mm3/include/asm-m32r/page.h 2006-10-04 01:24:23.333339778 -0500 @@ -76,7 +76,6 @@ typedef struct { unsigned long pgprot; } #ifndef CONFIG_DISCONTIGMEM #define PFN_BASE (CONFIG_MEMORY_START >> PAGE_SHIFT) #define ARCH_PFN_OFFSET PFN_BASE -#define pfn_valid(pfn) (((pfn) - PFN_BASE) < max_mapnr) #endif /* !CONFIG_DISCONTIGMEM */ #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) Index: linux-2.6.18-mm3/include/asm-m68k/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-m68k/page.h 2006-10-04 00:50:06.790861505 -0500 +++ linux-2.6.18-mm3/include/asm-m68k/page.h 2006-10-04 01:24:23.348966105 -0500 @@ -1,4 +1,3 @@ -#ifndef _M68K_PAGE_H #define _M68K_PAGE_H Index: linux-2.6.18-mm3/include/asm-m68knommu/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-m68knommu/page.h 2006-10-04 00:50:06.799651312 -0500 +++ linux-2.6.18-mm3/include/asm-m68knommu/page.h 2006-10-04 01:24:23.364592431 -0500 @@ -68,7 +68,6 @@ extern unsigned long memory_end; #define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) -#define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ ((void *)(kaddr) < (void *)memory_end)) Index: linux-2.6.18-mm3/include/asm-mips/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-mips/page.h 2006-10-04 00:50:06.808441119 -0500 +++ linux-2.6.18-mm3/include/asm-mips/page.h 2006-10-04 01:24:23.389008566 -0500 @@ -140,9 +140,7 @@ typedef struct { unsigned long pgprot; } #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) #ifdef CONFIG_FLATMEM - -#define pfn_valid(pfn) ((pfn) < max_mapnr) - +/* pfn_valid is defined in linux/mmzone.h */ #elif defined(CONFIG_SPARSEMEM) /* pfn_valid is defined in linux/mmzone.h */ Index: linux-2.6.18-mm3/include/asm-parisc/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-parisc/page.h 2006-10-04 00:50:06.819184216 -0500 +++ linux-2.6.18-mm3/include/asm-parisc/page.h 2006-10-04 01:24:23.441747417 -0500 @@ -147,10 +147,6 @@ extern int npmem_ranges; #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) -#ifndef CONFIG_DISCONTIGMEM -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#endif /* CONFIG_DISCONTIGMEM */ - #ifdef CONFIG_HUGETLB_PAGE #define HPAGE_SHIFT 22 /* 4MB (is this fixed?) */ #define HPAGE_SIZE ((1UL) << HPAGE_SHIFT) Index: linux-2.6.18-mm3/include/asm-powerpc/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-powerpc/page.h 2006-10-04 00:50:06.827974023 -0500 +++ linux-2.6.18-mm3/include/asm-powerpc/page.h 2006-10-04 01:24:23.459327034 -0500 @@ -55,10 +55,6 @@ #define PAGE_OFFSET ASM_CONST(CONFIG_KERNEL_START) #define KERNELBASE (PAGE_OFFSET + PHYSICAL_START) -#ifdef CONFIG_FLATMEM -#define pfn_valid(pfn) ((pfn) < max_mapnr) -#endif - #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) Index: linux-2.6.18-mm3/include/asm-ppc/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-ppc/page.h 2006-10-04 00:50:06.836763830 -0500 +++ linux-2.6.18-mm3/include/asm-ppc/page.h 2006-10-04 01:24:23.496439559 -0500 @@ -152,7 +152,6 @@ extern int page_is_ram(unsigned long pfn #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT) -#define pfn_valid(pfn) (((pfn) - PPC_PGSTART) < max_mapnr) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) /* Pure 2^n version of get_order */ Index: linux-2.6.18-mm3/include/asm-s390/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-s390/page.h 2006-10-04 00:50:06.845553638 -0500 +++ linux-2.6.18-mm3/include/asm-s390/page.h 2006-10-04 01:24:23.529645502 -0500 @@ -138,7 +138,6 @@ page_get_storage_key(unsigned long addr) #define __va(x) (void *)(unsigned long)(x) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ Index: linux-2.6.18-mm3/include/asm-sh/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-sh/page.h 2006-10-04 00:50:06.857273380 -0500 +++ linux-2.6.18-mm3/include/asm-sh/page.h 2006-10-04 01:24:23.588244226 -0500 @@ -110,7 +110,6 @@ typedef struct { unsigned long pgprot; } #define PFN_START (__MEMORY_START >> PAGE_SHIFT) #define ARCH_PFN_OFFSET (PFN_START) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ Index: linux-2.6.18-mm3/include/asm-sh64/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-sh64/page.h 2006-10-04 00:50:06.865086542 -0500 +++ linux-2.6.18-mm3/include/asm-sh64/page.h 2006-10-04 01:24:23.671259084 -0500 @@ -106,7 +106,6 @@ typedef struct { unsigned long pgprot; } #define PFN_START (__MEMORY_START >> PAGE_SHIFT) #define ARCH_PFN_OFFSET (PFN_START) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) -#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ Index: linux-2.6.18-mm3/include/asm-sparc/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-sparc/page.h 2006-10-04 00:50:06.873876349 -0500 +++ linux-2.6.18-mm3/include/asm-sparc/page.h 2006-10-04 01:24:23.699581800 -0500 @@ -154,7 +154,6 @@ extern unsigned long pfn_base; #define ARCH_PFN_OFFSET (pfn_base) #define virt_to_page(kaddr) (mem_map + ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT))) -#define pfn_valid(pfn) (((pfn) >= (pfn_base)) && (((pfn)-(pfn_base)) < max_mapnr)) #define virt_addr_valid(kaddr) ((((unsigned long)(kaddr)-PAGE_OFFSET)>>PAGE_SHIFT) < max_mapnr) #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ Index: linux-2.6.18-mm3/include/asm-um/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-um/page.h 2006-10-04 00:50:06.882666156 -0500 +++ linux-2.6.18-mm3/include/asm-um/page.h 2006-10-04 01:24:23.891980943 -0500 @@ -108,7 +108,6 @@ extern unsigned long uml_physmem; #define phys_to_pfn(p) ((p) >> PAGE_SHIFT) #define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) extern struct page *arch_validate(struct page *page, gfp_t mask, int order); Index: linux-2.6.18-mm3/include/asm-v850/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-v850/page.h 2006-10-04 00:50:06.890479318 -0500 +++ linux-2.6.18-mm3/include/asm-v850/page.h 2006-10-04 01:24:23.929093467 -0500 @@ -113,7 +113,6 @@ typedef unsigned long pgprot_t; ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) #define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT) -#define pfn_valid(pfn) ((pfn) < max_mapnr) #define virt_addr_valid(kaddr) \ (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr) Index: linux-2.6.18-mm3/include/asm-xtensa/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-xtensa/page.h 2006-10-04 00:50:06.900245770 -0500 +++ linux-2.6.18-mm3/include/asm-xtensa/page.h 2006-10-04 01:24:23.982808964 -0500 @@ -107,7 +107,6 @@ void copy_user_page(void *to,void* from, #define __pa(x) ((unsigned long) (x) - PAGE_OFFSET) #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET)) -#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr) #ifdef CONFIG_DISCONTIGMEM # error CONFIG_DISCONTIGMEM not supported #endif