scroll mode for very long start menus
[reactos.git] / reactos / drivers / bus / acpi / include / actbl.h
1 /******************************************************************************
2 *
3 * Name: actbl.h - Table data structures defined in ACPI specification
4 * $Revision: 1.1 $
5 *
6 *****************************************************************************/
7
8 /*
9 * Copyright (C) 2000, 2001 R. Byron Moore
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26 #ifndef __ACTBL_H__
27 #define __ACTBL_H__
28
29
30 /*
31 * Values for description table header signatures
32 */
33
34 #define RSDP_NAME "RSDP"
35 #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
36 #define APIC_SIG "APIC" /* Multiple APIC Description Table */
37 #define DSDT_SIG "DSDT" /* Differentiated System Description Table */
38 #define FADT_SIG "FACP" /* Fixed ACPI Description Table */
39 #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
40 #define PSDT_SIG "PSDT" /* Persistent System Description Table */
41 #define RSDT_SIG "RSDT" /* Root System Description Table */
42 #define XSDT_SIG "XSDT" /* Extended System Description Table */
43 #define SSDT_SIG "SSDT" /* Secondary System Description Table */
44 #define SBST_SIG "SBST" /* Smart Battery Specification Table */
45 #define SPIC_SIG "SPIC" /* iosapic table */
46 #define BOOT_SIG "BOOT" /* Boot table */
47
48
49 #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
50
51 /* values of Mapic.Model */
52
53 #define DUAL_PIC 0
54 #define MULTIPLE_APIC 1
55
56 /* values of Type in APIC_HEADER */
57
58 #define APIC_PROC 0
59 #define APIC_IO 1
60
61
62 /*
63 * Common table types. The base code can remain
64 * constant if the underlying tables are changed
65 */
66 #define RSDT_DESCRIPTOR RSDT_DESCRIPTOR_REV2
67 #define XSDT_DESCRIPTOR XSDT_DESCRIPTOR_REV2
68 #define FACS_DESCRIPTOR FACS_DESCRIPTOR_REV2
69 #define FADT_DESCRIPTOR FADT_DESCRIPTOR_REV2
70
71
72 #pragma pack(1)
73
74 /*
75 * Architecture-independent tables
76 * The architecture dependent tables are in separate files
77 */
78
79 typedef struct /* Root System Descriptor Pointer */
80 {
81 NATIVE_CHAR signature [8]; /* contains "RSD PTR " */
82 u8 checksum; /* to make sum of struct == 0 */
83 NATIVE_CHAR oem_id [6]; /* OEM identification */
84 u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */
85 u32 rsdt_physical_address; /* 32-bit physical address of RSDT */
86 u32 length; /* XSDT Length in bytes including hdr */
87 UINT64 xsdt_physical_address; /* 64-bit physical address of XSDT */
88 u8 extended_checksum; /* Checksum of entire table */
89 NATIVE_CHAR reserved [3]; /* reserved field must be 0 */
90
91 } RSDP_DESCRIPTOR;
92
93
94 typedef struct /* ACPI common table header */
95 {
96 NATIVE_CHAR signature [4]; /* identifies type of table */
97 u32 length; /* length of table, in bytes,
98 * including header */
99 u8 revision; /* specification minor version # */
100 u8 checksum; /* to make sum of entire table == 0 */
101 NATIVE_CHAR oem_id [6]; /* OEM identification */
102 NATIVE_CHAR oem_table_id [8]; /* OEM table identification */
103 u32 oem_revision; /* OEM revision number */
104 NATIVE_CHAR asl_compiler_id [4]; /* ASL compiler vendor ID */
105 u32 asl_compiler_revision; /* ASL compiler revision number */
106
107 } ACPI_TABLE_HEADER;
108
109
110 typedef struct /* Common FACS for internal use */
111 {
112 u32 *global_lock;
113 UINT64 *firmware_waking_vector;
114 u8 vector_width;
115
116 } ACPI_COMMON_FACS;
117
118
119 typedef struct /* APIC Table */
120 {
121 ACPI_TABLE_HEADER header; /* table header */
122 u32 local_apic_address; /* Physical address for accessing local APICs */
123 u32 PCATcompat : 1; /* a one indicates system also has dual 8259s */
124 u32 reserved1 : 31;
125
126 } APIC_TABLE;
127
128
129 typedef struct /* APIC Header */
130 {
131 u8 type; /* APIC type. Either APIC_PROC or APIC_IO */
132 u8 length; /* Length of APIC structure */
133
134 } APIC_HEADER;
135
136
137 typedef struct /* Processor APIC */
138 {
139 APIC_HEADER header;
140 u8 processor_apic_id; /* ACPI processor id */
141 u8 local_apic_id; /* processor's local APIC id */
142 u32 processor_enabled: 1; /* Processor is usable if set */
143 u32 reserved1 : 32;
144
145 } PROCESSOR_APIC;
146
147
148 typedef struct /* IO APIC */
149 {
150 APIC_HEADER header;
151 u8 io_apic_id; /* I/O APIC ID */
152 u8 reserved; /* reserved - must be zero */
153 u32 io_apic_address; /* APIC's physical address */
154 u32 vector; /* interrupt vector index where INTI
155 * lines start */
156 } IO_APIC;
157
158
159 /*
160 ** IA64 TODO: Add SAPIC Tables
161 */
162
163 /*
164 ** IA64 TODO: Modify Smart Battery Description to comply with ACPI IA64
165 ** extensions.
166 */
167 typedef struct /* Smart Battery Description Table */
168 {
169 ACPI_TABLE_HEADER header;
170 u32 warning_level;
171 u32 low_level;
172 u32 critical_level;
173
174 } SMART_BATTERY_DESCRIPTION_TABLE;
175
176
177 #pragma pack()
178
179
180 /*
181 * ACPI Table information. We save the table address, length,
182 * and type of memory allocation (mapped or allocated) for each
183 * table for 1) when we exit, and 2) if a new table is installed
184 */
185
186 #define ACPI_MEM_NOT_ALLOCATED 0
187 #define ACPI_MEM_ALLOCATED 1
188 #define ACPI_MEM_MAPPED 2
189
190 /* Definitions for the Flags bitfield member of ACPI_TABLE_SUPPORT */
191
192 #define ACPI_TABLE_SINGLE 0
193 #define ACPI_TABLE_MULTIPLE 1
194
195
196 /* Data about each known table type */
197
198 typedef struct _acpi_table_support
199 {
200 NATIVE_CHAR *name;
201 NATIVE_CHAR *signature;
202 u8 sig_length;
203 u8 flags;
204 u16 status;
205 void **global_ptr;
206
207 } ACPI_TABLE_SUPPORT;
208
209 /*
210 * Get the architecture-specific tables
211 */
212
213 #include "actbl1.h" /* Acpi 1.0 table defintions */
214 #include "actbl71.h" /* Acpi 0.71 IA-64 Extension table defintions */
215 #include "actbl2.h" /* Acpi 2.0 table definitions */
216
217 #endif /* __ACTBL_H__ */