From b7cfda9fc3d7aa60cffab5367f2a72a4a70060cd Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 7 Sep 2009 15:06:42 +0100 Subject: ARM: Fix pfn_valid() for sparse memory On OMAP platforms, some people want to declare to segment up the memory between the kernel and a separate application such that there is a hole in the middle of the memory as far as Linux is concerned. However, they want to be able to mmap() the hole. This currently causes problems, because update_mmu_cache() thinks that there are valid struct pages for the "hole". Fix this by making pfn_valid() slightly more expensive, by checking whether the PFN is contained within the meminfo array. Signed-off-by: Russell King Tested-by: Khasim Syed Mohammed --- arch/arm/include/asm/page.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/arm/include/asm/page.h') diff --git a/arch/arm/include/asm/page.h b/arch/arm/include/asm/page.h index 9c746af1bf6..3a32af4cce3 100644 --- a/arch/arm/include/asm/page.h +++ b/arch/arm/include/asm/page.h @@ -194,6 +194,10 @@ typedef unsigned long pgprot_t; typedef struct page *pgtable_t; +#ifndef CONFIG_SPARSEMEM +extern int pfn_valid(unsigned long); +#endif + #include #endif /* !__ASSEMBLY__ */ -- cgit v1.2.3