From ea70ddbc7ebf9ea257c1659822de64baf3e8c753 Mon Sep 17 00:00:00 2001 From: yokota Date: Fri, 10 Dec 1999 04:30:58 +0000 Subject: Add "panic key" function to syscons. When this key is defined in a keymap and pressed, the system panic will be forced. This feature must be specifically enabled by a new sysctl variable: machdep.enable_panic_key. Its default value is 0. The panic key won't do anything unless this variable is set to non-zero. To use the panic key, add a keyword 'panic' to a key in your keymap file. The following example assigns the panic function to SysReq (Alt-PrintScreen) key (keycode 84). 083 del '.' '.' '.' '.' '.' boot boot N 084 panic nop nop nop panic nop nop nop O 085 nop nop nop nop nop nop nop nop O PR: kern/13721 --- sys/dev/syscons/syscons.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/dev/syscons/syscons.c') diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index f3ffa83..7c5958e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,10 @@ static void (*current_saver)(sc_softc_t *, int) = none_saver; static bios_values_t bios_value; +static int enable_panic_key; +SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key, + 0, ""); + #define SC_MOUSE 128 #define SC_CONSOLECTL 255 @@ -3738,6 +3743,11 @@ next_code: #endif /* SC_DISABLE_DDBKEY */ break; + case PNC: + if (enable_panic_key) + panic("Forced by the panic key"); + break; + case NEXT: this_scr = scp->index; for (i = (this_scr - sc->first_vty + 1)%sc->vtys; -- cgit v1.1