diff options
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r-- | arch/i386/kernel/setup.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 6337157f5df3..d88ebdfa6ccd 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -43,7 +43,10 @@ | |||
43 | #include <linux/init.h> | 43 | #include <linux/init.h> |
44 | #include <linux/edd.h> | 44 | #include <linux/edd.h> |
45 | #include <linux/nodemask.h> | 45 | #include <linux/nodemask.h> |
46 | #include <linux/kexec.h> | ||
47 | |||
46 | #include <video/edid.h> | 48 | #include <video/edid.h> |
49 | |||
47 | #include <asm/apic.h> | 50 | #include <asm/apic.h> |
48 | #include <asm/e820.h> | 51 | #include <asm/e820.h> |
49 | #include <asm/mpspec.h> | 52 | #include <asm/mpspec.h> |
@@ -846,6 +849,27 @@ static void __init parse_cmdline_early (char ** cmdline_p) | |||
846 | lapic_disable(); | 849 | lapic_disable(); |
847 | #endif /* CONFIG_X86_LOCAL_APIC */ | 850 | #endif /* CONFIG_X86_LOCAL_APIC */ |
848 | 851 | ||
852 | #ifdef CONFIG_KEXEC | ||
853 | /* crashkernel=size@addr specifies the location to reserve for | ||
854 | * a crash kernel. By reserving this memory we guarantee | ||
855 | * that linux never set's it up as a DMA target. | ||
856 | * Useful for holding code to do something appropriate | ||
857 | * after a kernel panic. | ||
858 | */ | ||
859 | else if (!memcmp(from, "crashkernel=", 12)) { | ||
860 | unsigned long size, base; | ||
861 | size = memparse(from+12, &from); | ||
862 | if (*from == '@') { | ||
863 | base = memparse(from+1, &from); | ||
864 | /* FIXME: Do I want a sanity check | ||
865 | * to validate the memory range? | ||
866 | */ | ||
867 | crashk_res.start = base; | ||
868 | crashk_res.end = base + size - 1; | ||
869 | } | ||
870 | } | ||
871 | #endif | ||
872 | |||
849 | /* | 873 | /* |
850 | * highmem=size forces highmem to be exactly 'size' bytes. | 874 | * highmem=size forces highmem to be exactly 'size' bytes. |
851 | * This works even on boxes that have no highmem otherwise. | 875 | * This works even on boxes that have no highmem otherwise. |
@@ -1181,6 +1205,11 @@ void __init setup_bootmem_allocator(void) | |||
1181 | } | 1205 | } |
1182 | } | 1206 | } |
1183 | #endif | 1207 | #endif |
1208 | #ifdef CONFIG_KEXEC | ||
1209 | if (crashk_res.start != crashk_res.end) | ||
1210 | reserve_bootmem(crashk_res.start, | ||
1211 | crashk_res.end - crashk_res.start + 1); | ||
1212 | #endif | ||
1184 | } | 1213 | } |
1185 | 1214 | ||
1186 | /* | 1215 | /* |
@@ -1234,6 +1263,9 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1234 | */ | 1263 | */ |
1235 | request_resource(res, code_resource); | 1264 | request_resource(res, code_resource); |
1236 | request_resource(res, data_resource); | 1265 | request_resource(res, data_resource); |
1266 | #ifdef CONFIG_KEXEC | ||
1267 | request_resource(res, &crashk_res); | ||
1268 | #endif | ||
1237 | } | 1269 | } |
1238 | } | 1270 | } |
1239 | } | 1271 | } |