diff options
Diffstat (limited to 'arch/i386/kernel/machine_kexec.c')
-rw-r--r-- | arch/i386/kernel/machine_kexec.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/i386/kernel/machine_kexec.c b/arch/i386/kernel/machine_kexec.c index 6b1ae6ba76f0..66c3dc99a655 100644 --- a/arch/i386/kernel/machine_kexec.c +++ b/arch/i386/kernel/machine_kexec.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/mm.h> | 9 | #include <linux/mm.h> |
10 | #include <linux/kexec.h> | 10 | #include <linux/kexec.h> |
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <linux/init.h> | ||
12 | #include <asm/pgtable.h> | 13 | #include <asm/pgtable.h> |
13 | #include <asm/pgalloc.h> | 14 | #include <asm/pgalloc.h> |
14 | #include <asm/tlbflush.h> | 15 | #include <asm/tlbflush.h> |
@@ -209,3 +210,25 @@ NORET_TYPE void machine_kexec(struct kimage *image) | |||
209 | rnk = (relocate_new_kernel_t) reboot_code_buffer; | 210 | rnk = (relocate_new_kernel_t) reboot_code_buffer; |
210 | (*rnk)(page_list, reboot_code_buffer, image->start, cpu_has_pae); | 211 | (*rnk)(page_list, reboot_code_buffer, image->start, cpu_has_pae); |
211 | } | 212 | } |
213 | |||
214 | /* crashkernel=size@addr specifies the location to reserve for | ||
215 | * a crash kernel. By reserving this memory we guarantee | ||
216 | * that linux never sets it up as a DMA target. | ||
217 | * Useful for holding code to do something appropriate | ||
218 | * after a kernel panic. | ||
219 | */ | ||
220 | static int __init parse_crashkernel(char *arg) | ||
221 | { | ||
222 | unsigned long size, base; | ||
223 | size = memparse(arg, &arg); | ||
224 | if (*arg == '@') { | ||
225 | base = memparse(arg+1, &arg); | ||
226 | /* FIXME: Do I want a sanity check | ||
227 | * to validate the memory range? | ||
228 | */ | ||
229 | crashk_res.start = base; | ||
230 | crashk_res.end = base + size - 1; | ||
231 | } | ||
232 | return 0; | ||
233 | } | ||
234 | early_param("crashkernel", parse_crashkernel); | ||