summaryrefslogtreecommitdiff
path: root/arch/xtensa/include/asm
diff options
context:
space:
mode:
authorJohannes Weiner <jw@emlix.com>2009-03-04 18:21:30 +0300
committerChris Zankel <chris@zankel.net>2009-04-03 10:41:08 +0400
commitc947a585ab13f310c9223284dfd502790abd05f9 (patch)
tree1295ce0f825139326eb3d894eaddcf8027953e96 /arch/xtensa/include/asm
parent264da9f708b130122d881fa4570d1cd618440a73 (diff)
downloadlinux-c947a585ab13f310c9223284dfd502790abd05f9.tar.xz
xtensa: cope with ram beginning at higher addresses
The current assumption of the memory code is that the first RAM PFN in the system is 0. Adjust the relevant code to play well with setups where memory starts at higher addresses, indicated by PLATFORM_DEFAULT_MEM_START. The new memory model looks like this: +----------+--+----------------------+----------------+ | | | | | | | | RAM | | | | | | | +----------+--+----------------------+----------------+ | | | | | +- PFN 0 | +- min_low_pfn +- max_low_pfn +- max_pfn | +- ARCH_PFN_OFFSET +- PLATFORM_DEFAULT_MEM_START >> PAGE_SIZE The memory map contains pages starting from pfn ARCH_PFN_OFFSET up to max_low_pfn. The only zone used right now will span exactly the same region. Usually, ARCH_PFN_OFFSET and min_low_pfn are the same value. Handle them separately for robustness. Gapping pages will be in the memory map but marked as reserved and won't be touched. Signed-off-by: Johannes Weiner <jw@emlix.com> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'arch/xtensa/include/asm')
-rw-r--r--arch/xtensa/include/asm/page.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
index 11f7dc2dbec7..a5a5d33c15d0 100644
--- a/arch/xtensa/include/asm/page.h
+++ b/arch/xtensa/include/asm/page.h
@@ -14,6 +14,7 @@
#include <asm/processor.h>
#include <asm/types.h>
#include <asm/cache.h>
+#include <platform/hardware.h>
/*
* Fixed TLB translations in the processor.
@@ -150,9 +151,11 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*);
* addresses.
*/
+#define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT)
+
#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)
+#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
#ifdef CONFIG_DISCONTIGMEM
# error CONFIG_DISCONTIGMEM not supported
#endif