aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r--kernel/kexec.c16
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. */
30note_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 */
30struct resource crashk_res = { 33struct 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
1067static 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}
1078module_init(crash_notes_memory_init)