diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 11 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_kbd.c | 13 |
3 files changed, 22 insertions, 8 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 7a87575655f..ed920d23fc4 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.108 1999/06/04 16:37:47 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.109 1999/07/06 07:59:54 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -209,6 +209,8 @@ vm_map_t buffer_map; extern vm_offset_t avail_start, avail_end; vm_offset_t hole_start, hole_end; +int kbd_reset; + /* * Extent maps to manage I/O and ISA memory hole space. Allocate * storage for 8 regions in each, initially. Later, ioport_malloc_safe @@ -2115,6 +2117,13 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) case CPU_APMWARN: return (sysctl_int(oldp, oldlenp, newp, newlen, &cpu_apmwarn)); #endif + case CPU_KBDRESET: + if (securelevel > 0) + return (sysctl_rdint(oldp, oldlenp, newp, + kbd_reset)); + else + return (sysctl_int(oldp, oldlenp, newp, newlen, + &kbd_reset)); default: return EOPNOTSUPP; } diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 41187f703b1..aa7e25d5f86 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.26 1999/03/08 23:47:25 downsj Exp $ */ +/* $OpenBSD: cpu.h,v 1.27 1999/07/06 07:59:54 deraadt Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -249,7 +249,8 @@ void setconf __P((void)); #define CPU_CPUID 7 /* cpuid */ #define CPU_CPUFEATURE 8 /* cpuid features */ #define CPU_APMWARN 9 /* APM battery warning percentage */ -#define CPU_MAXID 10 /* number of valid machdep ids */ +#define CPU_KBDRESET 10 /* keyboard reset under pcvt */ +#define CPU_MAXID 11 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -262,6 +263,7 @@ void setconf __P((void)); { "cpuid", CTLTYPE_INT }, \ { "cpufeature", CTLTYPE_INT }, \ { "apmwarn", CTLTYPE_INT }, \ + { "kbdreset", CTLTYPE_INT }, \ } #endif /* !_I386_CPU_H_ */ diff --git a/sys/arch/i386/isa/pcvt/pcvt_kbd.c b/sys/arch/i386/isa/pcvt/pcvt_kbd.c index c56446626e4..293955e4ef3 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_kbd.c +++ b/sys/arch/i386/isa/pcvt/pcvt_kbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_kbd.c,v 1.19 1998/09/06 23:00:03 niklas Exp $ */ +/* $OpenBSD: pcvt_kbd.c,v 1.20 1999/07/06 07:59:54 deraadt Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -115,6 +115,8 @@ static int tpmrate = KBD_TPD500|KBD_TPM100; static u_char altkpflag = 0; static u_short altkpval = 0; +extern int kbd_reset; + #if PCVT_SHOWKEYS u_char rawkeybuf[80]; #endif @@ -1472,10 +1474,11 @@ regular: kbd_status.extended = kbd_status.ext1 = 0; -#if PCVT_CTRL_ALT_DEL /* Check for cntl-alt-del */ - if((key == 76) && ctrl_down && (meta_down||altgr_down)) - cpu_reset(); -#endif /* PCVT_CTRL_ALT_DEL */ + if(kbd_reset && (key == 76) && ctrl_down && (meta_down||altgr_down)) { + printf("\nconsole halt requested: going down.\n"); + kbd_reset = 0; + psignal(initproc, SIGUSR1); + } #if NDDB > 0 || defined(DDB) /* Check for cntl-alt-esc */ |