1.\" LP (Laptop Package) 2.\" 3.\" Copyright (c) 1994 by HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> 4.\" 5.\" This software may be used, modified, copied, and distributed, in 6.\" both source and binary form provided that the above copyright and 7.\" these terms are retained. Under no circumstances is the author 8.\" responsible for the proper functioning of this software, nor does 9.\" the author assume any responsibility for damages incurred with its 10.\" use. 11.Dd November 1, 1994 12.Dt APM 4 13.Os 14.Sh NAME 15.Nm apm 16.Nd APM BIOS interface 17.Sh SYNOPSIS 18.Cd options APM 19.Cd device apm0 at isa? 20.Sh DESCRIPTION 21.Nm apm 22is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS 23on laptop PCs. 24.Pp 25.Nm apm 26provides the following power management functions. 27.Bl -enum -offset indent 28.It 29When the system wakes up from suspended mode, 30.Nm apm 31adjusts the system clock to RTC. 32.It 33When the system wakes up from suspended mode, 34.Nm apm 35passes a message to 36.Xr syslogd 8 37comprising of system wakeup time and elapsed time during suspended mode. 38.It 39.Nm apm 40slows CPU clock when there are no system activities (runnable processes, 41interrupts, etc.). This function is available only on systems whose APM 42supports CPU idling. 43.It 44.Nm apm 45exports an application interface as a character device. Applications 46can control APM, or retrieve APM status information via this interface. 47.Nm apm 48exports the following interfaces. These symbols are defined in 49.Dq Pa /usr/include/machine/apm_bios.h. 50.Bl -tag -width 4n -offset indent 51.It Sy APMIO_SUSPEND 52Suspend system. 53.It Sy APMIO_GET 54Get power management information. 55.It Sy APMIO_ENABLE 56.It Sy APMIO_DISABLE 57Enable / Disable power management. 58.It Sy APMIO_HALTCPU 59.It Sy APMIO_NOTHALTCPU 60Control execution of HLT in the kernel context switch routine. 61.Pp 62Some APM implementations execute the HLT 63.Pq Halt CPU until an interrupt occurs 64instruction in the 65.Dq Pa Idle CPU 66call, while others do not. Thus enabling this may result in 67redundant HLT executions because 68.Dq Pa Idle CPU 69is called from the kernel context switch routine that inherently executes 70HLT. This may reduce peak system performance. 71.Pp 72Also the system hangs up if HLT instruction is disabled in the kernel 73context switch routine, and if the APM implementation of the machine 74does not execute HLT in 75.Dq Pa Idle CPU. 76On some implementations that do not support CPU clock slowdown, APM 77might not execute HLT. 78.Nm apm 79disables 80.Sy APMIO_NOTHALTCPU 81operation on such machines. 82.Pp 83The current version of 84.Nm apm 85does not call 86.Dq Pa Idle CPU 87from the kernel context switch routine if clock slowdown is not supported, 88and it executes HLT instruction by default. Therefore, there is 89no need to use these two operations in most cases. 90.El 91.Pp 92These interfaces are used by 93.Xr apm 8 94and 95.Xr apmconf 8 . 96.It 97.Nm apm 98polls APM events and handles the following events. 99.Bl -column PMEV_POWERSTATECHANGEXXX "suspend system xxxxx" 100.It Sy "Name " "Action " "Description" 101.It Dv "PMEV_STANDBYREQ " No "suspend system " "standby request" 102.It Dv "PMEV_SUSPENDREQ " No "suspend system " "suspend request" 103.It Dv "PMEV_USERSUSPENDREQ " No "suspend system " "user suspend request" 104.It Dv "PMEV_CRITSUSPEND " No "suspend system " "critical suspend request" 105.It Dv "PMEV_NORMRESUME " No "resume system " "normal resume" 106.It Dv "PMEV_CRITRESUME " No "resume system " "critical resume" 107.It Dv "PMEV_STANDBYRESUME " No "resume system " "standby resume" 108.It Dv "PMEV_BATTERYLOW " No "notify message " "battery low" 109.It Dv "PMEV_UPDATETIME " No "adjust clock " "update time" 110.El 111.El 112.Sh BUGS 113WARNING! Many, if not most, of the implementations of APM-bios in laptops 114today are buggy. You may be putting your LCD-display and batteries at 115a risk by using this interface. (The reason this isn't a problem for 116MS-windows is that they use the real-mode interface.) If you see any 117weird behaviour from your system with this code in use, unplug the 118power and batteries ASAP, if not imidiately, and disable this code. 119.Pp 120We are very interested in getting this code working, so please send you 121observations of any anormalous behaviour to us. 122.Pp 123When 124.Nm apm 125is active, calling the BIOS setup routine by using hotkeys, 126may cause serious trouble when resuming the system. 127BIOS setup programs should be called during bootstrap, or from DOS. 128.Pp 129Some APM implementations cannot handle events such as pushing the 130power button or closing the cover. On such implementations, the system 131.Ar must 132be suspended 133.Ar only 134by using 135.Xr apm 8 136or 137.Xr zzz 8 . 138.Pp 139Disk spindown, LCD backlight control, and power on demand have not 140been supported on the current version. 141.Sh SEE ALSO 142.Xr apm 8 , 143.Xr zzz 8 , 144.Xr apmconf 8 145.Sh AUTHOR 146HOSOKAWA, Tatsumi <hosokawa@mt.cs.keio.ac.jp> (Keio Univ., Japan) 147