X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=kernel%2Fkexec.c;h=bf39d28e4c0e7b44313124d84681f012ca193713;hb=9676489866a75fdd56b0d3e40ec7884298bb1338;hp=2c95848fbce8261463e54833d60d68573e9fb9b8;hpb=d8762748cae4f85b3201c0304969d993b42d5258;p=linux-2.6-omap-h63xx.git diff --git a/kernel/kexec.c b/kernel/kexec.c index 2c95848fbce..bf39d28e4c0 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c @@ -6,6 +6,7 @@ * Version 2. See the file COPYING for more details. */ +#include #include #include #include @@ -26,6 +27,9 @@ #include #include +/* Per cpu memory for storing cpu states in case of system crash. */ +note_buf_t* crash_notes; + /* Location of the reserved area for the crash kernel */ struct resource crashk_res = { .name = "Crash kernel", @@ -1054,9 +1058,24 @@ void crash_kexec(struct pt_regs *regs) if (!locked) { image = xchg(&kexec_crash_image, NULL); if (image) { - machine_crash_shutdown(regs); + struct pt_regs fixed_regs; + crash_setup_regs(&fixed_regs, regs); + machine_crash_shutdown(&fixed_regs); machine_kexec(image); } xchg(&kexec_lock, 0); } } + +static int __init crash_notes_memory_init(void) +{ + /* Allocate memory for saving cpu registers. */ + crash_notes = alloc_percpu(note_buf_t); + if (!crash_notes) { + printk("Kexec: Memory allocation for saving cpu register" + " states failed\n"); + return -ENOMEM; + } + return 0; +} +module_init(crash_notes_memory_init)