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#include <SupportDefs.h>
9
10#include <arch/x86/apm_defs.h>
11
12
13struct kernel_args;
14
15
16// int 0x15 APM definitions
17#define BIOS_APM_CHECK				0x5300
18#define BIOS_APM_CONNECT_32_BIT		0x5303
19#define BIOS_APM_DISCONNECT			0x5304
20#define BIOS_APM_CPU_IDLE			0x5305
21#define BIOS_APM_CPU_BUSY			0x5306
22#define BIOS_APM_SET_STATE			0x5307
23#define BIOS_APM_ENABLE				0x5308
24#define BIOS_APM_GET_POWER_STATUS	0x530a
25#define BIOS_APM_GET_EVENT			0x530b
26#define BIOS_APM_GET_STATE			0x530c
27#define BIOS_APM_VERSION			0x530e
28#define BIOS_APM_ENGAGE				0x530f
29
30// APM devices
31#define APM_ALL_DEVICES				0x0001
32
33// APM power states
34#define APM_POWER_STATE_ENABLED		0x0000
35#define APM_POWER_STATE_STANDBY		0x0001
36#define APM_POWER_STATE_SUSPEND		0x0002
37#define APM_POWER_STATE_OFF			0x0003
38
39typedef struct apm_info {
40	uint16	version;
41	uint16	flags;
42	uint16	code32_segment_base;
43	uint32	code32_segment_offset;
44	uint16	code32_segment_length;
45	uint16	code16_segment_base;
46	uint16	code16_segment_length;
47	uint16	data_segment_base;
48	uint16	data_segment_length;
49} apm_info;
50
51
52#ifndef _BOOT_MODE
53#ifndef __x86_64__
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58status_t apm_shutdown(void);
59status_t apm_init(struct kernel_args *args);
60
61#ifdef __cplusplus
62}
63#endif
64#endif	// !__x86_64__
65#endif	// !_BOOT_MODE
66
67#endif	/* KERNEL_APM_H */
68