1 /* 2 * Copyright 2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef KERNEL_APM_H 6 #define KERNEL_APM_H 7 8 9 #include <SupportDefs.h> 10 11 struct kernel_args; 12 13 14 // int 0x15 APM definitions 15 #define BIOS_APM_CHECK 0x5300 16 #define BIOS_APM_CONNECT_32_BIT 0x5303 17 #define BIOS_APM_DISCONNECT 0x5304 18 #define BIOS_APM_CPU_IDLE 0x5305 19 #define BIOS_APM_CPU_BUSY 0x5306 20 #define BIOS_APM_SET_STATE 0x5307 21 #define BIOS_APM_ENABLE 0x5308 22 #define BIOS_APM_GET_POWER_STATUS 0x530a 23 #define BIOS_APM_GET_EVENT 0x530b 24 #define BIOS_APM_GET_STATE 0x530c 25 #define BIOS_APM_VERSION 0x530e 26 #define BIOS_APM_ENGAGE 0x530f 27 28 // APM devices 29 #define APM_ALL_DEVICES 0x0001 30 31 // APM power states 32 #define APM_POWER_STATE_ENABLED 0x0000 33 #define APM_POWER_STATE_STANDBY 0x0001 34 #define APM_POWER_STATE_SUSPEND 0x0002 35 #define APM_POWER_STATE_OFF 0x0003 36 37 typedef struct apm_info { 38 uint16 version; 39 uint16 flags; 40 uint16 code32_segment_base; 41 uint32 code32_segment_offset; 42 uint16 code32_segment_length; 43 uint16 code16_segment_base; 44 uint16 code16_segment_length; 45 uint16 data_segment_base; 46 uint16 data_segment_length; 47 } apm_info; 48 49 50 #ifndef _BOOT_MODE 51 #ifdef __cplusplus 52 extern "C" { 53 #endif 54 55 status_t apm_shutdown(void); 56 status_t apm_init(struct kernel_args *args); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 #endif // !_BOOT_MODE 62 63 #endif /* KERNEL_APM_H */ 64