summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2017-08-17 19:44:28 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2017-08-17 19:44:28 +0000
commite22eb9cf1a892bfbb0a7523bf0c3616b110f9fd1 (patch)
treeccab420217cb7ab5699dcea2b3784f11110decb1 /sys/arch/i386
parentbbec3ce5ff9da1b4b861e6bc82e0f24f013e6852 (diff)
remove the useless apmwarn and mostly obsolete apmhalt sysctls.
probably ok
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/apm.c8
-rw-r--r--sys/arch/i386/i386/machdep.c29
-rw-r--r--sys/arch/i386/include/cpu.h11
3 files changed, 7 insertions, 41 deletions
diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c
index cad0ce93088..d55e5d96d59 100644
--- a/sys/arch/i386/i386/apm.c
+++ b/sys/arch/i386/i386/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.116 2016/10/08 05:49:08 guenther Exp $ */
+/* $OpenBSD: apm.c,v 1.117 2017/08/17 19:44:27 tedu Exp $ */
/*-
* Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved.
@@ -107,12 +107,6 @@ struct filterops apmread_filtops = {
1, NULL, filt_apmrdetach, filt_apmread
};
-/* battery percentage at where we get verbose in our warnings. This
- * value can be changed using sysctl(8), value machdep.apmwarn.
- * Setting it to zero kills all warnings
- */
-int cpu_apmwarn = 10;
-
#define APM_RESUME_HOLDOFF 3
/*
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 99023b9d86c..cda97fb361b 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.604 2017/07/12 06:26:32 natano Exp $ */
+/* $OpenBSD: machdep.c,v 1.605 2017/08/17 19:44:27 tedu Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -185,12 +185,6 @@ void (*cpu_idle_leave_fcn)(void) = NULL;
void (*cpu_idle_cycle_fcn)(void) = NULL;
void (*cpu_idle_enter_fcn)(void) = NULL;
-/*
- * Declare these as initialized data so we can patch them.
- */
-#if NAPM > 0
-int cpu_apmhalt = 0; /* sysctl'd to 1 for halt -p hack */
-#endif
struct uvm_constraint_range isa_constraint = { 0x0, 0x00ffffffUL };
struct uvm_constraint_range dma_constraint = { 0x0, 0xffffffffUL };
@@ -2694,19 +2688,8 @@ haltsys:
* try to turn the system off.
*/
delay(500000);
- /*
- * It's been reported that the following bit of code
- * is required on most systems <mickey@openbsd.org>
- * but cause powerdown problem on other systems
- * <smcho@tsp.korea.ac.kr>. Use sysctl to set
- * apmhalt to a non-zero value to skip the offending
- * code.
- */
- if (!cpu_apmhalt) {
- apm_set_powstate(APM_DEV_DISK(0xff),
- APM_SYS_OFF);
- delay(500000);
- }
+ apm_set_powstate(APM_DEV_DISK(0xff), APM_SYS_OFF);
+ delay(500000);
rv = apm_set_powstate(APM_DEV_DISK(0xff), APM_SYS_OFF);
if (rv == 0 || rv == ENXIO) {
delay(500000);
@@ -3529,12 +3512,6 @@ cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_rdint(oldp, oldlenp, newp, cpu_id));
case CPU_CPUFEATURE:
return (sysctl_rdint(oldp, oldlenp, newp, curcpu()->ci_feature_flags));
-#if NAPM > 0
- case CPU_APMWARN:
- return (sysctl_int(oldp, oldlenp, newp, newlen, &cpu_apmwarn));
- case CPU_APMHALT:
- return (sysctl_int(oldp, oldlenp, newp, newlen, &cpu_apmhalt));
-#endif
case CPU_KBDRESET:
if (securelevel > 0)
return (sysctl_rdint(oldp, oldlenp, newp,
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index 677fcb7f6b6..2b0ff5aa9ce 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.156 2017/07/12 06:26:33 natano Exp $ */
+/* $OpenBSD: cpu.h,v 1.157 2017/08/17 19:44:27 tedu Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -396,9 +396,6 @@ extern void (*cpu_idle_enter_fcn)(void);
extern void (*cpu_idle_cycle_fcn)(void);
extern void (*cpu_idle_leave_fcn)(void);
-/* apm.c */
-extern int cpu_apmwarn;
-
extern int cpuspeed;
#if !defined(SMALL_KERNEL)
@@ -516,9 +513,7 @@ int cpu_paenable(void *);
#define CPU_CPUVENDOR 6 /* cpuid vendor string */
#define CPU_CPUID 7 /* cpuid */
#define CPU_CPUFEATURE 8 /* cpuid features */
-#define CPU_APMWARN 9 /* APM battery warning percentage */
#define CPU_KBDRESET 10 /* keyboard reset under pcvt */
-#define CPU_APMHALT 11 /* halt -p hack */
#define CPU_OSFXSR 13 /* uses FXSAVE/FXRSTOR */
#define CPU_SSE 14 /* supports SSE */
#define CPU_SSE2 15 /* supports SSE2 */
@@ -537,9 +532,9 @@ int cpu_paenable(void *);
{ "cpuvendor", CTLTYPE_STRING }, \
{ "cpuid", CTLTYPE_INT }, \
{ "cpufeature", CTLTYPE_INT }, \
- { "apmwarn", CTLTYPE_INT }, \
+ { 0, 0 }, \
{ "kbdreset", CTLTYPE_INT }, \
- { "apmhalt", CTLTYPE_INT }, \
+ { 0, 0 }, \
{ 0, 0 }, \
{ "osfxsr", CTLTYPE_INT }, \
{ "sse", CTLTYPE_INT }, \