3 * FILE : reactos/hal/x86/apm.c
4 * DESCRIPTION: Turn CPU off...
5 * PROJECT : ReactOS Operating System
6 * AUTHOR : D. Lindauer (July 11 1997)
7 * NOTE : This program is public domain
12 #define APM_FUNCTION_AVAILABLE 0x5300
13 #define APM_FUNCTION_CONNREAL 0x5301
14 #define APM_FUNCTION_POWEROFF 0x5307
15 #define APM_FUNCTION_ENABLECPU 0x530d
16 #define APM_FUNCTION_ENABLEAPM 0x530e
18 #define APM_DEVICE_BIOS 0
19 #define APM_DEVICE_ALL 1
21 #define APM_MODE_DISABLE 0
22 #define APM_MODE_ENABLE 1
26 nopm db 'No power management functionality',10,13,'$'
27 errmsg db 'Power management error',10,13,'$'
28 wrongver db 'Need APM version 1.1 or better',10,13,'$'
35 cmp ax,101h ; See if version 1.1 or greater
36 mov dx,offset wrongver
40 mov ax,5301h ; Do a real mode connection
41 mov bx,0 ; device = BIOS
45 cmp ah,2 ; Pass if already connected
46 mov dx,offset errmsg ; else error
49 mov ax,530eh ; Enable latest version of APM
50 mov bx,0 ; device = BIOS
51 mov cx,[ver] ; version
56 mov ax,530dh ; Now engage and enable CPU management
57 mov bx,1 ; device = all
64 mov bx,1 ; device = ALL
89 __asm__("int 21\n"); /* 0x15 */
97 APM_FUNCTION_AVAILABLE,
102 APM_FUNCTION_ENABLEAPM,
106 APM_FUNCTION_POWEROFF,