diff options
author | brooks <brooks@FreeBSD.org> | 2006-01-14 17:57:17 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2006-01-14 17:57:17 +0000 |
commit | 8378b938764f3f81c27a85b51f0fb23712ae4a1a (patch) | |
tree | f0830b6fcfb3101450c2f8f6dc6f4b110f86bd76 /sys | |
parent | cb60aeaf06a83bfe789467a960bfd821f4f0d7da (diff) | |
download | FreeBSD-src-8378b938764f3f81c27a85b51f0fb23712ae4a1a.zip FreeBSD-src-8378b938764f3f81c27a85b51f0fb23712ae4a1a.tar.gz |
When SC_DISABLE_KDBKEY or SC_DISABLE_REBOOT are not defined allow the
same behavior to be controlled by the sysctls, hw.syscons.kbd_kbdkey
and hw.syscons.kbd_reboot respectively.
Apologies to the submitter for taking so long to commit this simple
change.
PR: kern/72728
Submitted by: Luca Morettoni <morettoni at libero dot it>
MFC After: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/syscons/syscons.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index d7a5b14..e1228d4 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -112,6 +112,15 @@ static char sc_malloc = FALSE; static int saver_mode = CONS_NO_SAVER; /* LKM/user saver */ static int run_scrn_saver = FALSE; /* should run the saver? */ static int enable_bell = TRUE; /* enable beeper */ + +#ifndef SC_DISABLE_REBOOT +static int enable_reboot = TRUE; /* enable keyboard reboot */ +#endif + +#ifndef SC_DISABLE_KDBKEY +static int enable_kdbkey = TRUE; /* enable keyboard debug */ +#endif + static long scrn_blank_time = 0; /* screen saver timeout value */ #ifdef DEV_SPLASH static int scrn_blanked; /* # of blanked screen */ @@ -127,6 +136,14 @@ SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, &sc_saver_keyb_only, 0, "screen saver interrupted by input only"); SYSCTL_INT(_hw_syscons, OID_AUTO, bell, CTLFLAG_RW, &enable_bell, 0, "enable bell"); +#ifndef SC_DISABLE_REBOOT +SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_reboot, CTLFLAG_RW|CTLFLAG_SECURE, &enable_reboot, + 0, "enable keyboard reboot"); +#endif +#ifndef SC_DISABLE_KDBKEY +SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_debug, CTLFLAG_RW|CTLFLAG_SECURE, &enable_kdbkey, + 0, "enable keyboard debug"); +#endif #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) #include "font.h" #endif @@ -3274,19 +3291,22 @@ next_code: case RBT: #ifndef SC_DISABLE_REBOOT - shutdown_nice(0); + if (enable_reboot) + shutdown_nice(0); #endif break; case HALT: #ifndef SC_DISABLE_REBOOT - shutdown_nice(RB_HALT); + if (enable_reboot) + shutdown_nice(RB_HALT); #endif break; case PDWN: #ifndef SC_DISABLE_REBOOT - shutdown_nice(RB_HALT|RB_POWEROFF); + if (enable_reboot) + shutdown_nice(RB_HALT|RB_POWEROFF); #endif break; @@ -3299,7 +3319,8 @@ next_code: case DBG: #ifndef SC_DISABLE_KDBKEY - kdb_enter("manual escape to debugger"); + if (enable_kdbkey) + kdb_enter("manual escape to debugger"); #endif break; |