summaryrefslogtreecommitdiff
path: root/drivers/char/sysrq.c
diff options
context:
space:
mode:
authorHariprasad Nellitheertha <hari@in.ibm.com>2005-06-26 01:58:25 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-26 03:24:54 +0400
commit86b1ae38c0a62409dc862a28e3f08920f55f944b (patch)
treede7e2803949d9585d6d5554cbad9063d5d62f2cc /drivers/char/sysrq.c
parent315c215c0a7324894541d43b0e720f20cafca92e (diff)
downloadlinux-86b1ae38c0a62409dc862a28e3f08920f55f944b.tar.xz
[PATCH] kdump: sysrq trigger mechanism for kexec based crashdumps
Add a sysrq-trigger mechanism for kexec based crashdumps. Alt-Sysrq-c triggers a kexec based crashdump. Signed-off-by: Hariprasad Nellitheertha <hari@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/sysrq.c')
-rw-r--r--drivers/char/sysrq.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index f59f7cbd525b..53b2c8fab00e 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/vt_kern.h>
#include <linux/workqueue.h>
+#include <linux/kexec.h>
#include <asm/ptrace.h>
@@ -94,6 +95,21 @@ static struct sysrq_key_op sysrq_unraw_op = {
};
#endif /* CONFIG_VT */
+#ifdef CONFIG_KEXEC
+/* crashdump sysrq handler */
+static void sysrq_handle_crashdump(int key, struct pt_regs *pt_regs,
+ struct tty_struct *tty)
+{
+ crash_kexec();
+}
+static struct sysrq_key_op sysrq_crashdump_op = {
+ .handler = sysrq_handle_crashdump,
+ .help_msg = "Crashdump",
+ .action_msg = "Trigger a crashdump",
+ .enable_mask = SYSRQ_ENABLE_DUMP,
+};
+#endif
+
/* reboot sysrq handler */
static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
@@ -273,8 +289,12 @@ static struct sysrq_key_op *sysrq_key_table[SYSRQ_KEY_TABLE_LENGTH] = {
it is handled specially on the sparc
and will never arrive */
/* b */ &sysrq_reboot_op,
-/* c */ NULL,
-/* d */ NULL,
+#ifdef CONFIG_KEXEC
+/* c */ &sysrq_crashdump_op,
+#else
+/* c */ NULL,
+#endif
+/* d */ NULL,
/* e */ &sysrq_term_op,
/* f */ &sysrq_moom_op,
/* g */ NULL,