crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elf...
[pandora-kernel.git] / arch / x86 / kernel / e820.c
index 5fad626..3e2ef84 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/crash_dump.h>
 #include <linux/bootmem.h>
 #include <linux/pfn.h>
 #include <linux/suspend.h>
@@ -841,15 +842,21 @@ static int __init parse_memopt(char *p)
        if (!p)
                return -EINVAL;
 
-#ifdef CONFIG_X86_32
        if (!strcmp(p, "nopentium")) {
+#ifdef CONFIG_X86_32
                setup_clear_cpu_cap(X86_FEATURE_PSE);
                return 0;
-       }
+#else
+               printk(KERN_WARNING "mem=nopentium ignored! (only supported on x86_32)\n");
+               return -EINVAL;
 #endif
+       }
 
        userdef = 1;
        mem_size = memparse(p, &p);
+       /* don't remove all of memory when handling "mem={invalid}" param */
+       if (mem_size == 0)
+               return -EINVAL;
        e820_remove_range(mem_size, ULLONG_MAX - mem_size, E820_RAM, 1);
 
        return 0;