apm4freebsd
Apm bios interface
Usage
device apm
Deprecation notice
This driver is scheduled for removal prior to the release of FreeBSD 13.0.
Overview
apm is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS on laptop PCs.
apm provides the following power management functions.
-
When the system wakes up from suspended mode,
apmadjusts the system clock to RTC. -
When the system wakes up from suspended mode,
apmpasses a message to syslogd(8) comprising of system wakeup time and elapsed time during suspended mode. -
apmslows CPU clock when there are no system activities (runnable processes, interrupts, etc.). This function is available only on systems whose APM supports CPU idling. -
apmexports an application interface as a character device. Applications can control APM, or retrieve APM status information via this interface.apmexports the following interfaces. These symbols are defined in ⟨machine/apm_bios.h⟩.APMIO_SUSPEND-
Suspend system.
APMIO_GET-
Get power management information.
APMIO_ENABLEAPMIO_DISABLE-
Enable / Disable power management.
APMIO_HALTCPUAPMIO_NOTHALTCPU-
Control execution of HLT in the kernel context switch routine.
APMIO_GETPWSTATUS-
Get per battery information.
Some APM implementations execute the HLT (Halt CPU until an interrupt occurs) instruction in the “Idle CPU” call, while others do not. Thus enabling this may result in redundant HLT executions because “Idle CPU” is called from the kernel context switch routine that inherently executes HLT. This may reduce peak system performance.
Also the system hangs up if HLT instruction is disabled in the kernel context switch routine, and if the APM implementation of the machine does not execute HLT in “Idle CPU”. On some implementations that do not support CPU clock slowdown, APM might not execute HLT.
apmdisablesAPMIO_NOTHALTCPUoperation on such machines.The current version of
apmdoes not call “Idle CPU” from the kernel context switch routine if clock slowdown is not supported, and it executes HLT instruction by default. Therefore, there is no need to use these two operations in most cases.These interfaces are used by apm(8).
-
apmpolls APM events and handles the following events.Name Action Description PMEV_STANDBYREQ suspend system standby request PMEV_SUSPENDREQ suspend system suspend request PMEV_USERSUSPENDREQ suspend system user suspend request PMEV_CRITSUSPEND suspend system critical suspend request PMEV_NORMRESUME resume system normal resume PMEV_CRITRESUME resume system critical resume PMEV_STANDBYRESUME resume system standby resume PMEV_BATTERYLOW notify message battery low PMEV_UPDATETIME adjust clock update time
Releases
9 releases since Debian 5.0 (Lenny); the text changed 6 times.