]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] mm: move vmalloc= parsing to arch/arm/mm/mmu.c
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 30 Sep 2008 18:31:44 +0000 (19:31 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 30 Sep 2008 20:34:16 +0000 (21:34 +0100)
There's no point scattering this around the tree, the parsing
of the parameter might as well live beside the code which uses
it.  That also means we can make vmalloc_reserve a static
variable.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/memory.h
arch/arm/kernel/setup.c
arch/arm/mm/mmu.c

index 7e8d22fef29c2455a52f7e84e2b96269203092c8..7834adbe1774649c87b4582e4ba30eadeb606857 100644 (file)
 #define arch_adjust_zones(node,size,holes) do { } while (0)
 #endif
 
-/*
- * Amount of memory reserved for the vmalloc() area, and minimum
- * address for vmalloc mappings.
- */
-extern unsigned long vmalloc_reserve;
-
-#define VMALLOC_MIN            (void *)(VMALLOC_END - vmalloc_reserve)
-
 /*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.
index 2f5d3641f2ed304fb0cb74698f78d95b641ec5d3..e4a975fa2d7e2d5819f0eb7ba65813c8c47fec2d 100644 (file)
@@ -84,8 +84,6 @@ EXPORT_SYMBOL(system_serial_high);
 unsigned int elf_hwcap;
 EXPORT_SYMBOL(elf_hwcap);
 
-unsigned long __initdata vmalloc_reserve = 128 << 20;
-
 
 #ifdef MULTI_CPU
 struct processor processor;
@@ -414,17 +412,6 @@ static void __init early_mem(char **p)
 }
 __early_param("mem=", early_mem);
 
-/*
- * vmalloc=size forces the vmalloc area to be exactly 'size'
- * bytes. This can be used to increase (or decrease) the vmalloc
- * area - the default is 128m.
- */
-static void __init early_vmalloc(char **arg)
-{
-       vmalloc_reserve = memparse(*arg, arg);
-}
-__early_param("vmalloc=", early_vmalloc);
-
 /*
  * Initial parsing of the command line.
  */
index f03ad87f6baa5209def9fdc323279758947ca6ac..e7af83e569d7a85c9e3afa30c76a5c7ee2aaa100 100644 (file)
@@ -566,6 +566,28 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
                create_mapping(io_desc + i);
 }
 
+static unsigned long __initdata vmalloc_reserve = SZ_128M;
+
+/*
+ * vmalloc=size forces the vmalloc area to be exactly 'size'
+ * bytes. This can be used to increase (or decrease) the vmalloc
+ * area - the default is 128m.
+ */
+static void __init early_vmalloc(char **arg)
+{
+       vmalloc_reserve = memparse(*arg, arg);
+
+       if (vmalloc_reserve < SZ_16M) {
+               vmalloc_reserve = SZ_16M;
+               printk(KERN_WARNING
+                       "vmalloc area too small, limiting to %luMB\n",
+                       vmalloc_reserve >> 20);
+       }
+}
+__early_param("vmalloc=", early_vmalloc);
+
+#define VMALLOC_MIN    (void *)(VMALLOC_END - vmalloc_reserve)
+
 static int __init check_membank_valid(struct membank *mb)
 {
        /*