提交 625f1c82 编写于 作者: V Vivek Goyal 提交者: Linus Torvalds

[PATCH] Kdump: Export crash notes section address through sysfs

o Following patch exports kexec global variable "crash_notes" to user space
  through sysfs as kernel attribute in /sys/kernel.
Signed-off-by: NManeesh Soni <maneesh@in.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 cf13f0ea
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include <asm/apic.h> #include <asm/apic.h>
#include <mach_ipi.h> #include <mach_ipi.h>
#define MAX_NOTE_BYTES 1024
typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
note_buf_t crash_notes[NR_CPUS]; note_buf_t crash_notes[NR_CPUS];
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
#include <asm/nmi.h> #include <asm/nmi.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#define MAX_NOTE_BYTES 1024
typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
note_buf_t crash_notes[NR_CPUS]; note_buf_t crash_notes[NR_CPUS];
void machine_crash_shutdown(void) void machine_crash_shutdown(void)
......
...@@ -25,4 +25,9 @@ ...@@ -25,4 +25,9 @@
/* The native architecture */ /* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_386 #define KEXEC_ARCH KEXEC_ARCH_386
#define MAX_NOTE_BYTES 1024
typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
extern note_buf_t crash_notes[];
#endif /* _I386_KEXEC_H */ #endif /* _I386_KEXEC_H */
...@@ -25,4 +25,9 @@ ...@@ -25,4 +25,9 @@
/* The native architecture */ /* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_X86_64 #define KEXEC_ARCH KEXEC_ARCH_X86_64
#define MAX_NOTE_BYTES 1024
typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
extern note_buf_t crash_notes[];
#endif /* _X86_64_KEXEC_H */ #endif /* _X86_64_KEXEC_H */
...@@ -30,12 +30,25 @@ static ssize_t hotplug_seqnum_show(struct subsystem *subsys, char *page) ...@@ -30,12 +30,25 @@ static ssize_t hotplug_seqnum_show(struct subsystem *subsys, char *page)
KERNEL_ATTR_RO(hotplug_seqnum); KERNEL_ATTR_RO(hotplug_seqnum);
#endif #endif
#ifdef CONFIG_KEXEC
#include <asm/kexec.h>
static ssize_t crash_notes_show(struct subsystem *subsys, char *page)
{
return sprintf(page, "%p\n", (void *)crash_notes);
}
KERNEL_ATTR_RO(crash_notes);
#endif
decl_subsys(kernel, NULL, NULL); decl_subsys(kernel, NULL, NULL);
EXPORT_SYMBOL_GPL(kernel_subsys); EXPORT_SYMBOL_GPL(kernel_subsys);
static struct attribute * kernel_attrs[] = { static struct attribute * kernel_attrs[] = {
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
&hotplug_seqnum_attr.attr, &hotplug_seqnum_attr.attr,
#endif
#ifdef CONFIG_KEXEC
&crash_notes_attr.attr,
#endif #endif
NULL NULL
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册