diff options
-rw-r--r-- | arch/i386/kernel/crash.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/crash.c | 3 | ||||
-rw-r--r-- | include/asm-i386/kexec.h | 5 | ||||
-rw-r--r-- | include/asm-x86_64/kexec.h | 5 | ||||
-rw-r--r-- | kernel/ksysfs.c | 13 |
5 files changed, 23 insertions, 5 deletions
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c index 59b92d217464..3645ad7ac200 100644 --- a/arch/i386/kernel/crash.c +++ b/arch/i386/kernel/crash.c | |||
@@ -26,8 +26,6 @@ | |||
26 | #include <asm/apic.h> | 26 | #include <asm/apic.h> |
27 | #include <mach_ipi.h> | 27 | #include <mach_ipi.h> |
28 | 28 | ||
29 | #define MAX_NOTE_BYTES 1024 | ||
30 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
31 | 29 | ||
32 | note_buf_t crash_notes[NR_CPUS]; | 30 | note_buf_t crash_notes[NR_CPUS]; |
33 | 31 | ||
diff --git a/arch/x86_64/kernel/crash.c b/arch/x86_64/kernel/crash.c index 7caf8a49d0cb..6183bcb85257 100644 --- a/arch/x86_64/kernel/crash.c +++ b/arch/x86_64/kernel/crash.c | |||
@@ -20,9 +20,6 @@ | |||
20 | #include <asm/nmi.h> | 20 | #include <asm/nmi.h> |
21 | #include <asm/hw_irq.h> | 21 | #include <asm/hw_irq.h> |
22 | 22 | ||
23 | #define MAX_NOTE_BYTES 1024 | ||
24 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
25 | |||
26 | note_buf_t crash_notes[NR_CPUS]; | 23 | note_buf_t crash_notes[NR_CPUS]; |
27 | 24 | ||
28 | void machine_crash_shutdown(void) | 25 | void machine_crash_shutdown(void) |
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h index a1599b55d62d..6ed2a03e37b3 100644 --- a/include/asm-i386/kexec.h +++ b/include/asm-i386/kexec.h | |||
@@ -25,4 +25,9 @@ | |||
25 | /* The native architecture */ | 25 | /* The native architecture */ |
26 | #define KEXEC_ARCH KEXEC_ARCH_386 | 26 | #define KEXEC_ARCH KEXEC_ARCH_386 |
27 | 27 | ||
28 | #define MAX_NOTE_BYTES 1024 | ||
29 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
30 | |||
31 | extern note_buf_t crash_notes[]; | ||
32 | |||
28 | #endif /* _I386_KEXEC_H */ | 33 | #endif /* _I386_KEXEC_H */ |
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h index dc33646dc7dd..42d2ff15c592 100644 --- a/include/asm-x86_64/kexec.h +++ b/include/asm-x86_64/kexec.h | |||
@@ -25,4 +25,9 @@ | |||
25 | /* The native architecture */ | 25 | /* The native architecture */ |
26 | #define KEXEC_ARCH KEXEC_ARCH_X86_64 | 26 | #define KEXEC_ARCH KEXEC_ARCH_X86_64 |
27 | 27 | ||
28 | #define MAX_NOTE_BYTES 1024 | ||
29 | typedef u32 note_buf_t[MAX_NOTE_BYTES/4]; | ||
30 | |||
31 | extern note_buf_t crash_notes[]; | ||
32 | |||
28 | #endif /* _X86_64_KEXEC_H */ | 33 | #endif /* _X86_64_KEXEC_H */ |
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 1f064a63f8cf..015fb69ad94d 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -30,6 +30,16 @@ static ssize_t hotplug_seqnum_show(struct subsystem *subsys, char *page) | |||
30 | KERNEL_ATTR_RO(hotplug_seqnum); | 30 | KERNEL_ATTR_RO(hotplug_seqnum); |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #ifdef CONFIG_KEXEC | ||
34 | #include <asm/kexec.h> | ||
35 | |||
36 | static ssize_t crash_notes_show(struct subsystem *subsys, char *page) | ||
37 | { | ||
38 | return sprintf(page, "%p\n", (void *)crash_notes); | ||
39 | } | ||
40 | KERNEL_ATTR_RO(crash_notes); | ||
41 | #endif | ||
42 | |||
33 | decl_subsys(kernel, NULL, NULL); | 43 | decl_subsys(kernel, NULL, NULL); |
34 | EXPORT_SYMBOL_GPL(kernel_subsys); | 44 | EXPORT_SYMBOL_GPL(kernel_subsys); |
35 | 45 | ||
@@ -37,6 +47,9 @@ static struct attribute * kernel_attrs[] = { | |||
37 | #ifdef CONFIG_HOTPLUG | 47 | #ifdef CONFIG_HOTPLUG |
38 | &hotplug_seqnum_attr.attr, | 48 | &hotplug_seqnum_attr.attr, |
39 | #endif | 49 | #endif |
50 | #ifdef CONFIG_KEXEC | ||
51 | &crash_notes_attr.attr, | ||
52 | #endif | ||
40 | NULL | 53 | NULL |
41 | }; | 54 | }; |
42 | 55 | ||