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
This commit is contained in:
Kazutaka YOKOTA 1999-12-10 04:30:58 +00:00
parent 52990a39d0
commit b2f564ea70

View File

@ -44,6 +44,7 @@
#include <sys/conf.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/sysctl.h>
#include <sys/tty.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
@ -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 @@ scgetc(sc_softc_t *sc, u_int flags)
#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;