.action_msg = "Resetting",
};
+/* crash sysrq handler */
+static void sysrq_handle_crash(int key, struct pt_regs *pt_regs,
+ struct tty_struct *tty) {
+ *( (char *) 0) = 0;
+}
+static struct sysrq_key_op sysrq_crash_op = {
+ handler: sysrq_handle_crash,
+ help_msg: "Crash",
+ action_msg: "Crashing the kernel by request",
+};
+
static void sysrq_handle_sync(int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
{
it is handled specially on the sparc
and will never arrive */
/* b */ &sysrq_reboot_op,
-/* c */ NULL,
+/* c */ &sysrq_crash_op,
/* d */ NULL,
/* e */ &sysrq_term_op,
/* f */ NULL,
sysrq_key_table[i] = op_p;
}
-/*
- * This function is called by the keyboard handler when SysRq is pressed
- * and any other keycode arrives.
- */
-
-void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
-{
- if (!sysrq_enabled)
- return;
-
- __sysrq_lock_table();
- __handle_sysrq_nolock(key, pt_regs, tty);
- __sysrq_unlock_table();
-}
-
/*
* This is the non-locking version of handle_sysrq
* It must/can only be called by sysrq key handlers,
* as they are inside of the lock
*/
-void __handle_sysrq_nolock(int key, struct pt_regs *pt_regs,
- struct tty_struct *tty)
+void __handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
{
struct sysrq_key_op *op_p;
int orig_log_level;
int i, j;
-
- if (!sysrq_enabled)
- return;
+ __sysrq_lock_table();
orig_log_level = console_loglevel;
console_loglevel = 7;
printk(KERN_INFO "SysRq : ");
printk ("\n");
console_loglevel = orig_log_level;
}
+ __sysrq_unlock_table();
+}
+
+/*
+ * This function is called by the keyboard handler when SysRq is pressed
+ * and any other keycode arrives.
+ */
+
+void handle_sysrq(int key, struct pt_regs *pt_regs, struct tty_struct *tty)
+{
+ if (!sysrq_enabled)
+ return;
+ __handle_sysrq(key, pt_regs, tty);
}
EXPORT_SYMBOL(handle_sysrq);
-EXPORT_SYMBOL(__handle_sysrq_nolock);
EXPORT_SYMBOL(__sysrq_lock_table);
EXPORT_SYMBOL(__sysrq_unlock_table);
EXPORT_SYMBOL(__sysrq_get_key_op);