From: Vivek Goyal <vgoyal@in.ibm.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: fastboot <fastboot@lists.osdl.org>,
lkml <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: [RFC][PATCH 3/3] Kdump: Export crash notes section address through sysfs
Date: 24 Feb 2005 21:47:46 +0530 [thread overview]
Message-ID: <1109261865.5148.819.camel@terminator.in.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: kexec-x86-exports-thru-sysfs.patch --]
[-- Type: text/plain, Size: 2434 bytes --]
o Following patch exports kexec global variable "crash_notes" to user space
through sysfs as kernel attribute in /sys/kernel.
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
---
linux-2.6.11-rc4-mm1-maneesh/arch/i386/kernel/crash.c | 2 --
linux-2.6.11-rc4-mm1-maneesh/include/asm-i386/kexec.h | 5 +++++
linux-2.6.11-rc4-mm1-maneesh/kernel/ksysfs.c | 13 +++++++++++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff -puN kernel/ksysfs.c~kexec-exports-thru-sysfs kernel/ksysfs.c
--- linux-2.6.11-rc4-mm1/kernel/ksysfs.c~kexec-exports-thru-sysfs 2005-02-24 13:49:27.953186392 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/kernel/ksysfs.c 2005-02-24 13:49:27.969183960 +0530
@@ -15,6 +15,8 @@
#include <linux/module.h>
#include <linux/init.h>
+#include <asm/kexec.h>
+
#define KERNEL_ATTR_RO(_name) \
static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
@@ -30,6 +32,14 @@ static ssize_t hotplug_seqnum_show(struc
KERNEL_ATTR_RO(hotplug_seqnum);
#endif
+#ifdef CONFIG_KEXEC
+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);
EXPORT_SYMBOL_GPL(kernel_subsys);
@@ -37,6 +47,9 @@ static struct attribute * kernel_attrs[]
#ifdef CONFIG_HOTPLUG
&hotplug_seqnum_attr.attr,
#endif
+#ifdef CONFIG_KEXEC
+ &crash_notes_attr.attr,
+#endif
NULL
};
diff -puN include/asm-i386/kexec.h~kexec-exports-thru-sysfs include/asm-i386/kexec.h
--- linux-2.6.11-rc4-mm1/include/asm-i386/kexec.h~kexec-exports-thru-sysfs 2005-02-24 13:49:27.957185784 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/include/asm-i386/kexec.h 2005-02-24 13:49:27.970183808 +0530
@@ -25,4 +25,9 @@
/* The native architecture */
#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 */
diff -puN arch/i386/kernel/crash.c~kexec-exports-thru-sysfs arch/i386/kernel/crash.c
--- linux-2.6.11-rc4-mm1/arch/i386/kernel/crash.c~kexec-exports-thru-sysfs 2005-02-24 13:49:27.960185328 +0530
+++ linux-2.6.11-rc4-mm1-maneesh/arch/i386/kernel/crash.c 2005-02-24 13:49:27.970183808 +0530
@@ -26,8 +26,6 @@
#include <asm/apic.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];
_
--
next reply other threads:[~2005-02-24 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-24 16:17 Vivek Goyal [this message]
2005-03-01 6:05 ` Andrew Morton
2005-03-01 22:03 ` [Fastboot] " Randy.Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1109261865.5148.819.camel@terminator.in.ibm.com \
--to=vgoyal@in.ibm.com \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®