1994-11-01 22:46:40 +00:00
|
|
|
.\" LP (Laptop Package)
|
2001-07-14 19:41:16 +00:00
|
|
|
.\"
|
1994-11-01 22:46:40 +00:00
|
|
|
.\" Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp>
|
2001-07-14 19:41:16 +00:00
|
|
|
.\"
|
1994-11-01 22:46:40 +00:00
|
|
|
.\" This software may be used, modified, copied, and distributed, in
|
|
|
|
.\" both source and binary form provided that the above copyright and
|
2001-07-14 19:41:16 +00:00
|
|
|
.\" these terms are retained. Under no circumstances is the author
|
|
|
|
.\" responsible for the proper functioning of this software, nor does
|
|
|
|
.\" the author assume any responsibility for damages incurred with its
|
1994-11-01 22:46:40 +00:00
|
|
|
.\" use.
|
1996-12-26 16:16:37 +00:00
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1996-12-26 16:16:37 +00:00
|
|
|
.\"
|
1994-11-01 22:46:40 +00:00
|
|
|
.Dd November 1, 1994
|
1996-12-29 20:36:04 +00:00
|
|
|
.Dt APM 4 i386
|
1994-11-01 22:46:40 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm apm
|
|
|
|
.Nd APM BIOS interface
|
|
|
|
.Sh SYNOPSIS
|
2003-01-29 21:51:05 +00:00
|
|
|
.Cd device apm
|
1994-11-01 22:46:40 +00:00
|
|
|
.Sh DESCRIPTION
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS
|
|
|
|
on laptop PCs.
|
|
|
|
.Pp
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
provides the following power management functions.
|
|
|
|
.Bl -enum -offset indent
|
|
|
|
.It
|
2001-07-14 19:41:16 +00:00
|
|
|
When the system wakes up from suspended mode,
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
adjusts the system clock to RTC.
|
2001-07-14 19:41:16 +00:00
|
|
|
.It
|
|
|
|
When the system wakes up from suspended mode,
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
2001-07-14 19:41:16 +00:00
|
|
|
passes a message to
|
1994-11-01 22:46:40 +00:00
|
|
|
.Xr syslogd 8
|
|
|
|
comprising of system wakeup time and elapsed time during suspended mode.
|
|
|
|
.It
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
2001-07-14 19:41:16 +00:00
|
|
|
slows CPU clock when there are no system activities (runnable processes,
|
2004-07-03 18:29:24 +00:00
|
|
|
interrupts, etc.).
|
|
|
|
This function is available only on systems whose APM
|
1994-11-01 22:46:40 +00:00
|
|
|
supports CPU idling.
|
|
|
|
.It
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
2004-07-03 18:29:24 +00:00
|
|
|
exports an application interface as a character device.
|
|
|
|
Applications
|
1994-11-01 22:46:40 +00:00
|
|
|
can control APM, or retrieve APM status information via this interface.
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
2004-07-03 18:29:24 +00:00
|
|
|
exports the following interfaces.
|
|
|
|
These symbols are defined in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In machine/apm_bios.h .
|
1994-11-01 22:46:40 +00:00
|
|
|
.Bl -tag -width 4n -offset indent
|
|
|
|
.It Sy APMIO_SUSPEND
|
|
|
|
Suspend system.
|
|
|
|
.It Sy APMIO_GET
|
|
|
|
Get power management information.
|
|
|
|
.It Sy APMIO_ENABLE
|
|
|
|
.It Sy APMIO_DISABLE
|
|
|
|
Enable / Disable power management.
|
|
|
|
.It Sy APMIO_HALTCPU
|
|
|
|
.It Sy APMIO_NOTHALTCPU
|
|
|
|
Control execution of HLT in the kernel context switch routine.
|
2000-08-13 17:05:27 +00:00
|
|
|
.It Sy APMIO_GETPWSTATUS
|
|
|
|
Get per battery information.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Some APM implementations execute the HLT
|
2001-08-07 15:48:51 +00:00
|
|
|
(Halt CPU until an interrupt occurs)
|
1994-11-01 22:46:40 +00:00
|
|
|
instruction in the
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dq Em Idle CPU
|
2004-07-03 18:29:24 +00:00
|
|
|
call, while others do not.
|
|
|
|
Thus enabling this may result in
|
1994-11-01 22:46:40 +00:00
|
|
|
redundant HLT executions because
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dq Em Idle CPU
|
2001-07-14 19:41:16 +00:00
|
|
|
is called from the kernel context switch routine that inherently executes
|
2004-07-03 18:29:24 +00:00
|
|
|
HLT.
|
|
|
|
This may reduce peak system performance.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Also the system hangs up if HLT instruction is disabled in the kernel
|
|
|
|
context switch routine, and if the APM implementation of the machine
|
1994-11-01 22:46:40 +00:00
|
|
|
does not execute HLT in
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dq Em Idle CPU .
|
2001-07-14 19:41:16 +00:00
|
|
|
On some implementations that do not support CPU clock slowdown, APM
|
1994-11-01 22:46:40 +00:00
|
|
|
might not execute HLT.
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
disables
|
|
|
|
.Sy APMIO_NOTHALTCPU
|
2001-07-14 19:41:16 +00:00
|
|
|
operation on such machines.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
|
|
|
The current version of
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
does not call
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dq Em Idle CPU
|
2001-07-14 19:41:16 +00:00
|
|
|
from the kernel context switch routine if clock slowdown is not supported,
|
2004-07-03 18:29:24 +00:00
|
|
|
and it executes HLT instruction by default.
|
|
|
|
Therefore, there is
|
1994-11-01 22:46:40 +00:00
|
|
|
no need to use these two operations in most cases.
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
These interfaces are used by
|
2000-01-23 13:41:56 +00:00
|
|
|
.Xr apm 8 .
|
1994-11-01 22:46:40 +00:00
|
|
|
.It
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
1994-11-01 22:46:40 +00:00
|
|
|
polls APM events and handles the following events.
|
2012-04-07 09:05:30 +00:00
|
|
|
.Bl -column "xxxxxxxxxxxxxxxxx" "xxxxxxxxxxxxx" "xxxxxxxx"
|
|
|
|
.It Sy "Name" Ta Sy "Action" Ta Sy "Description"
|
|
|
|
.It Dv "PMEV_STANDBYREQ" Ta No "suspend system" Ta "standby request"
|
|
|
|
.It Dv "PMEV_SUSPENDREQ" Ta No "suspend system" Ta "suspend request"
|
|
|
|
.It Dv "PMEV_USERSUSPENDREQ" Ta No "suspend system" Ta "user suspend request"
|
|
|
|
.It Dv "PMEV_CRITSUSPEND" Ta No "suspend system" Ta "critical suspend request"
|
|
|
|
.It Dv "PMEV_NORMRESUME" Ta No "resume system" Ta "normal resume"
|
|
|
|
.It Dv "PMEV_CRITRESUME" Ta No "resume system" Ta "critical resume"
|
|
|
|
.It Dv "PMEV_STANDBYRESUME" Ta No "resume system" Ta "standby resume"
|
|
|
|
.It Dv "PMEV_BATTERYLOW" Ta No "notify message" Ta "battery low"
|
|
|
|
.It Dv "PMEV_UPDATETIME" Ta No "adjust clock" Ta "update time"
|
1994-11-01 22:46:40 +00:00
|
|
|
.El
|
2001-07-14 19:41:16 +00:00
|
|
|
.El
|
2005-01-21 08:36:40 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr apm 8 ,
|
|
|
|
.Xr zzz 8
|
|
|
|
.Sh AUTHORS
|
2015-02-20 13:50:50 +00:00
|
|
|
.An Tatsumi Hosokawa Aq Mt hosokawa@jp.FreeBSD.org
|
1994-11-01 22:46:40 +00:00
|
|
|
.Sh BUGS
|
2004-07-03 18:29:24 +00:00
|
|
|
WARNING!
|
|
|
|
Many, if not most, of the implementations of APM-bios in laptops
|
|
|
|
today are buggy.
|
|
|
|
You may be putting your LCD-display and batteries at
|
|
|
|
a risk by using this interface.
|
2005-02-13 22:25:33 +00:00
|
|
|
(The reason this is not a problem for
|
2005-01-18 17:53:35 +00:00
|
|
|
MS-Windows is that they use the real-mode interface.)
|
2004-07-03 18:29:24 +00:00
|
|
|
If you see any
|
1998-12-18 03:08:57 +00:00
|
|
|
weird behavior from your system with this code in use, unplug the
|
1998-06-08 06:12:02 +00:00
|
|
|
power and batteries ASAP, if not immediately, and disable this code.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
2005-01-18 17:53:35 +00:00
|
|
|
We are very interested in getting this code working, so please send your
|
1998-12-18 03:08:57 +00:00
|
|
|
observations of any anomalous behavior to us.
|
1994-11-01 22:46:40 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
When
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm
|
2001-07-14 19:41:16 +00:00
|
|
|
is active, calling the BIOS setup routine by using hot-keys,
|
1994-11-01 22:46:40 +00:00
|
|
|
may cause serious trouble when resuming the system.
|
|
|
|
BIOS setup programs should be called during bootstrap, or from DOS.
|
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Some APM implementations cannot handle events such as pushing the
|
2004-07-03 18:29:24 +00:00
|
|
|
power button or closing the cover.
|
|
|
|
On such implementations, the system
|
1994-11-01 22:46:40 +00:00
|
|
|
.Ar must
|
|
|
|
be suspended
|
|
|
|
.Ar only
|
2001-07-14 19:41:16 +00:00
|
|
|
by using
|
1994-11-01 22:46:40 +00:00
|
|
|
.Xr apm 8
|
2001-07-14 19:41:16 +00:00
|
|
|
or
|
1994-11-01 22:46:40 +00:00
|
|
|
.Xr zzz 8 .
|
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Disk spin-down, LCD backlight control, and power on demand have not
|
1994-11-01 22:46:40 +00:00
|
|
|
been supported on the current version.
|