diff options
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 2c95848fbce8..1197de8b2a94 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include <asm/system.h> | 26 | #include <asm/system.h> |
27 | #include <asm/semaphore.h> | 27 | #include <asm/semaphore.h> |
28 | 28 | ||
29 | /* Per cpu memory for storing cpu states in case of system crash. */ | ||
30 | note_buf_t* crash_notes; | ||
31 | |||
29 | /* Location of the reserved area for the crash kernel */ | 32 | /* Location of the reserved area for the crash kernel */ |
30 | struct resource crashk_res = { | 33 | struct resource crashk_res = { |
31 | .name = "Crash kernel", | 34 | .name = "Crash kernel", |
@@ -1060,3 +1063,16 @@ void crash_kexec(struct pt_regs *regs) | |||
1060 | xchg(&kexec_lock, 0); | 1063 | xchg(&kexec_lock, 0); |
1061 | } | 1064 | } |
1062 | } | 1065 | } |
1066 | |||
1067 | static int __init crash_notes_memory_init(void) | ||
1068 | { | ||
1069 | /* Allocate memory for saving cpu registers. */ | ||
1070 | crash_notes = alloc_percpu(note_buf_t); | ||
1071 | if (!crash_notes) { | ||
1072 | printk("Kexec: Memory allocation for saving cpu register" | ||
1073 | " states failed\n"); | ||
1074 | return -ENOMEM; | ||
1075 | } | ||
1076 | return 0; | ||
1077 | } | ||
1078 | module_init(crash_notes_memory_init) | ||