diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2006-06-21 21:53:33 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2006-06-21 21:53:33 +0000 |
commit | c4c2198d9316130a94cbefc07d774b308c91e53c (patch) | |
tree | fcad871b69d479f606f07bc8832bd11109e0d740 | |
parent | 0953d30f918e77954012c8359905278959d6416f (diff) |
add the machdep.kbdreset logic to sparc64 (stuff to use it is coming)
-rw-r--r-- | etc/etc.sparc64/sysctl.conf | 1 | ||||
-rw-r--r-- | sys/arch/sparc64/include/cpu.h | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 7 |
3 files changed, 11 insertions, 3 deletions
diff --git a/etc/etc.sparc64/sysctl.conf b/etc/etc.sparc64/sysctl.conf index 38cba543cc2..101cc47ccd4 100644 --- a/etc/etc.sparc64/sysctl.conf +++ b/etc/etc.sparc64/sysctl.conf @@ -1,2 +1,3 @@ #machdep.led_blink=1 # 1=On sparc64, make led(s) blink #machdep.allowaperture=1 # See xf86(4) +#machdep.kbdreset=1 # permit console to do a nice halt diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h index d425242bac8..5012b20c971 100644 --- a/sys/arch/sparc64/include/cpu.h +++ b/sys/arch/sparc64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.34 2006/02/22 22:17:07 miod Exp $ */ +/* $OpenBSD: cpu.h,v 1.35 2006/06/21 21:53:32 jason Exp $ */ /* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */ /* @@ -52,7 +52,8 @@ #define CPU_CPUTYPE 4 /* cpu type */ #define CPU_CECCERRORS 5 /* Correctable ECC errors */ #define CPU_CECCLAST 6 /* Correctable ECC last fault addr */ -#define CPU_MAXID 7 /* number of valid machdep ids */ +#define CPU_KBDRESET 7 /* soft reset via keyboard */ +#define CPU_MAXID 8 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ @@ -62,6 +63,7 @@ { "cputype", CTLTYPE_INT }, \ { "ceccerrs", CTLTYPE_INT }, \ { "cecclast", CTLTYPE_QUAD }, \ + { "kbdreset", CTLTYPE_INT }, \ } #ifdef _KERNEL diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 9b665ad871b..4156134e678 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.82 2006/06/07 19:13:08 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.83 2006/06/21 21:53:32 jason Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -194,6 +194,7 @@ u_long _randseed; extern caddr_t msgbufaddr; int sparc_led_blink; +int kbd_reset; #ifdef APERTURE #ifdef INSECURE @@ -544,6 +545,10 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) return (sysctl_rdint(oldp, oldlenp, newp, ceccerrs)); case CPU_CECCLAST: return (sysctl_rdquad(oldp, oldlenp, newp, cecclast)); + case CPU_KBDRESET: + if (securelevel > 0) + return (sysctl_rdint(oldp, oldlenp, newp, kbd_reset)); + return (sysctl_int(oldp, oldlenp, newp, newlen, &kbd_reset)); default: return (EOPNOTSUPP); } |