0001
0002
0003
0004
0005
0006 #ifndef _LINUX_APM_H
0007 #define _LINUX_APM_H
0008
0009 #include <uapi/linux/apm_bios.h>
0010
0011
0012 #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8)
0013 #define APM_CS_16 (APM_CS + 8)
0014 #define APM_DS (APM_CS_16 + 8)
0015
0016
0017 #define APM_16_BIT_SUPPORT 0x0001
0018 #define APM_32_BIT_SUPPORT 0x0002
0019 #define APM_IDLE_SLOWS_CLOCK 0x0004
0020 #define APM_BIOS_DISABLED 0x0008
0021 #define APM_BIOS_DISENGAGED 0x0010
0022
0023
0024
0025
0026 struct apm_info {
0027 struct apm_bios_info bios;
0028 unsigned short connection_version;
0029 int get_power_status_broken;
0030 int get_power_status_swabinminutes;
0031 int allow_ints;
0032 int forbid_idle;
0033 int realmode_power_off;
0034 int disabled;
0035 };
0036
0037
0038
0039
0040 #define APM_FUNC_INST_CHECK 0x5300
0041 #define APM_FUNC_REAL_CONN 0x5301
0042 #define APM_FUNC_16BIT_CONN 0x5302
0043 #define APM_FUNC_32BIT_CONN 0x5303
0044 #define APM_FUNC_DISCONN 0x5304
0045 #define APM_FUNC_IDLE 0x5305
0046 #define APM_FUNC_BUSY 0x5306
0047 #define APM_FUNC_SET_STATE 0x5307
0048 #define APM_FUNC_ENABLE_PM 0x5308
0049 #define APM_FUNC_RESTORE_BIOS 0x5309
0050 #define APM_FUNC_GET_STATUS 0x530a
0051 #define APM_FUNC_GET_EVENT 0x530b
0052 #define APM_FUNC_GET_STATE 0x530c
0053 #define APM_FUNC_ENABLE_DEV_PM 0x530d
0054 #define APM_FUNC_VERSION 0x530e
0055 #define APM_FUNC_ENGAGE_PM 0x530f
0056 #define APM_FUNC_GET_CAP 0x5310
0057 #define APM_FUNC_RESUME_TIMER 0x5311
0058 #define APM_FUNC_RESUME_ON_RING 0x5312
0059 #define APM_FUNC_TIMER 0x5313
0060
0061
0062
0063
0064 #define APM_FUNC_DISABLE_TIMER 0
0065 #define APM_FUNC_GET_TIMER 1
0066 #define APM_FUNC_SET_TIMER 2
0067
0068
0069
0070
0071 #define APM_FUNC_DISABLE_RING 0
0072 #define APM_FUNC_ENABLE_RING 1
0073 #define APM_FUNC_GET_RING 2
0074
0075
0076
0077
0078 #define APM_FUNC_TIMER_DISABLE 0
0079 #define APM_FUNC_TIMER_ENABLE 1
0080 #define APM_FUNC_TIMER_GET 2
0081
0082
0083
0084
0085 extern struct apm_info apm_info;
0086
0087
0088
0089
0090 #define APM_DEVICE_BALL ((apm_info.connection_version > 0x0100) ? \
0091 APM_DEVICE_ALL : APM_DEVICE_OLD_ALL)
0092 #endif