summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@lsi.nec.co.jp>2002-11-26 05:21:13 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-11-26 05:21:13 -0800
commit45d88866fea51406c06b30eef668e8aa286e90f5 (patch)
tree2a3a1de9751baa45547a9e20681f2657fa5b8c01
parentd4b1dfa6d429eeea60deba73d2510e05b824939c (diff)
[PATCH] Give a compile-time error on the v850 if MAX_ORDER is too large
Give a compile-time error on the v850 if MAX_ORDER is too large
-rw-r--r--arch/v850/kernel/setup.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
index d4445fdc5925..9100ec7f6ed7 100644
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -270,6 +270,16 @@ init_mem_alloc (unsigned long ram_start, unsigned long ram_len)
zones_size[ZONE_DMA]
= ADDR_TO_PAGE (ram_len + (ram_start - PAGE_OFFSET));
+ /* The allocator is very picky about the address of the first
+ allocatable page -- it must be at least as aligned as the
+ maximum allocation -- so try to detect cases where it will get
+ confused and signal them at compile time (this is a common
+ problem when porting to a new platform with ). There is a
+ similar runtime check in free_area_init_core. */
+#if ((PAGE_OFFSET >> PAGE_SHIFT) & ((1UL << (MAX_ORDER - 1)) - 1))
+#error MAX_ORDER is too large for given PAGE_OFFSET (use CONFIG_FORCE_MAX_ZONEORDER to change it)
+#endif
+
free_area_init_node (0, NODE_DATA(0), 0, zones_size,
ADDR_TO_PAGE (PAGE_OFFSET), 0);
mem_map = NODE_DATA(0)->node_mem_map;