summaryrefslogtreecommitdiffstats
path: root/usr.sbin/apmd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-04-02 04:12:46 +0000
committerderaadt <deraadt@openbsd.org>2010-04-02 04:12:46 +0000
commitb08222aea213b1b2c117898360f1ad4b3ccbb5ab (patch)
treefaa13eff0950b3f078ff43afe679fd07a3c6d916 /usr.sbin/apmd
parentAdd PCI_PRODUCT_ATI_RADEON_HD4500_M to the list (diff)
downloadwireguard-openbsd-b08222aea213b1b2c117898360f1ad4b3ccbb5ab.tar.xz
wireguard-openbsd-b08222aea213b1b2c117898360f1ad4b3ccbb5ab.zip
In automatic mode if the battery is absent go to 100%
From Pawlowski Marcin Piotr ok tedu
Diffstat (limited to 'usr.sbin/apmd')
-rw-r--r--usr.sbin/apmd/apmd.85
-rw-r--r--usr.sbin/apmd/apmd.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/apmd/apmd.8 b/usr.sbin/apmd/apmd.8
index 0951d3ac48a..6c9e28b6c7f 100644
--- a/usr.sbin/apmd/apmd.8
+++ b/usr.sbin/apmd/apmd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: apmd.8,v 1.41 2009/10/22 15:02:12 sobrado Exp $
+.\" $OpenBSD: apmd.8,v 1.42 2010/04/02 04:12:46 deraadt Exp $
.\"
.\" Copyright (c) 1995 John T. Kohl
.\" All rights reserved.
@@ -26,7 +26,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: October 22 2009 $
+.Dd $Mdocdate: April 2 2010 $
.Dt APMD 8
.Os
.Sh NAME
@@ -71,6 +71,7 @@ Start
in automatic performance adjustment mode.
In this mode, when CPU idle time falls below 10%,
or if the AC power is connected and the battery is more than 15% charged,
+or if the battery is absent,
.Nm
raises
.Va hw.setperf
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 918d6974fed..0435a1c89fe 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.55 2010/03/30 17:42:05 oga Exp $ */
+/* $OpenBSD: apmd.c,v 1.56 2010/04/02 04:12:46 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -320,9 +320,11 @@ perf_status(struct apm_power_info *pinfo, int ncpu)
case PERF_AUTO:
/*
* force setperf towards the max if we are connected to AC
- * power and have a battery life greater than 15%
+ * power and have a battery life greater than 15%, or if
+ * the battery is absent
*/
- if (pinfo->ac_state == APM_AC_ON && pinfo->battery_life > 15)
+ if (pinfo->ac_state == APM_AC_ON && pinfo->battery_life > 15 ||
+ pinfo->battery_state == APM_BATTERY_ABSENT)
forcehi = 1;
break;
case PERF_COOL: