diff options
Diffstat (limited to 'include/acpi/actbl.h')
-rw-r--r-- | include/acpi/actbl.h | 260 |
1 files changed, 106 insertions, 154 deletions
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index c1e9110c3661..a46f406e1c94 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h | |||
@@ -44,27 +44,24 @@ | |||
44 | #ifndef __ACTBL_H__ | 44 | #ifndef __ACTBL_H__ |
45 | #define __ACTBL_H__ | 45 | #define __ACTBL_H__ |
46 | 46 | ||
47 | |||
48 | /* | 47 | /* |
49 | * Values for description table header signatures | 48 | * Values for description table header signatures |
50 | */ | 49 | */ |
51 | #define RSDP_NAME "RSDP" | 50 | #define RSDP_NAME "RSDP" |
52 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ | 51 | #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ |
53 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ | 52 | #define APIC_SIG "APIC" /* Multiple APIC Description Table */ |
54 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ | 53 | #define DSDT_SIG "DSDT" /* Differentiated System Description Table */ |
55 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ | 54 | #define FADT_SIG "FACP" /* Fixed ACPI Description Table */ |
56 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ | 55 | #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ |
57 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ | 56 | #define PSDT_SIG "PSDT" /* Persistent System Description Table */ |
58 | #define RSDT_SIG "RSDT" /* Root System Description Table */ | 57 | #define RSDT_SIG "RSDT" /* Root System Description Table */ |
59 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ | 58 | #define XSDT_SIG "XSDT" /* Extended System Description Table */ |
60 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ | 59 | #define SSDT_SIG "SSDT" /* Secondary System Description Table */ |
61 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ | 60 | #define SBST_SIG "SBST" /* Smart Battery Specification Table */ |
62 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ | 61 | #define SPIC_SIG "SPIC" /* IOSAPIC table */ |
63 | #define BOOT_SIG "BOOT" /* Boot table */ | 62 | #define BOOT_SIG "BOOT" /* Boot table */ |
64 | 63 | ||
65 | 64 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | |
66 | #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */ | ||
67 | |||
68 | 65 | ||
69 | /* | 66 | /* |
70 | * Common table types. The base code can remain | 67 | * Common table types. The base code can remain |
@@ -75,7 +72,6 @@ | |||
75 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 | 72 | #define FACS_DESCRIPTOR struct facs_descriptor_rev2 |
76 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 | 73 | #define FADT_DESCRIPTOR struct fadt_descriptor_rev2 |
77 | 74 | ||
78 | |||
79 | #pragma pack(1) | 75 | #pragma pack(1) |
80 | 76 | ||
81 | /* | 77 | /* |
@@ -84,28 +80,24 @@ | |||
84 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) | 80 | * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) |
85 | * are in separate files. | 81 | * are in separate files. |
86 | */ | 82 | */ |
87 | struct rsdp_descriptor /* Root System Descriptor Pointer */ | 83 | struct rsdp_descriptor { /* Root System Descriptor Pointer */ |
88 | { | 84 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ |
89 | char signature[8]; /* ACPI signature, contains "RSD PTR " */ | 85 | u8 checksum; /* ACPI 1.0 checksum */ |
90 | u8 checksum; /* ACPI 1.0 checksum */ | 86 | char oem_id[6]; /* OEM identification */ |
91 | char oem_id[6]; /* OEM identification */ | 87 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ |
92 | u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ | 88 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ |
93 | u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ | 89 | u32 length; /* XSDT Length in bytes, including header */ |
94 | u32 length; /* XSDT Length in bytes, including header */ | 90 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ |
95 | u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */ | 91 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ |
96 | u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */ | 92 | char reserved[3]; /* Reserved, must be zero */ |
97 | char reserved[3]; /* Reserved, must be zero */ | ||
98 | }; | 93 | }; |
99 | 94 | ||
100 | 95 | struct acpi_common_facs { /* Common FACS for internal use */ | |
101 | struct acpi_common_facs /* Common FACS for internal use */ | 96 | u32 *global_lock; |
102 | { | 97 | u64 *firmware_waking_vector; |
103 | u32 *global_lock; | 98 | u8 vector_width; |
104 | u64 *firmware_waking_vector; | ||
105 | u8 vector_width; | ||
106 | }; | 99 | }; |
107 | 100 | ||
108 | |||
109 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ | 101 | #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ |
110 | char signature[4]; /* ASCII table signature */\ | 102 | char signature[4]; /* ASCII table signature */\ |
111 | u32 length; /* Length of table in bytes, including this header */\ | 103 | u32 length; /* Length of table in bytes, including this header */\ |
@@ -115,14 +107,10 @@ struct acpi_common_facs /* Common FACS for internal use */ | |||
115 | char oem_table_id[8]; /* ASCII OEM table identification */\ | 107 | char oem_table_id[8]; /* ASCII OEM table identification */\ |
116 | u32 oem_revision; /* OEM revision number */\ | 108 | u32 oem_revision; /* OEM revision number */\ |
117 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ | 109 | char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ |
118 | u32 asl_compiler_revision; /* ASL compiler version */ | 110 | u32 asl_compiler_revision; /* ASL compiler version */ |
119 | |||
120 | |||
121 | struct acpi_table_header /* ACPI common table header */ | ||
122 | { | ||
123 | ACPI_TABLE_HEADER_DEF | ||
124 | }; | ||
125 | 111 | ||
112 | struct acpi_table_header { /* ACPI common table header */ | ||
113 | ACPI_TABLE_HEADER_DEF}; | ||
126 | 114 | ||
127 | /* | 115 | /* |
128 | * MADT values and structures | 116 | * MADT values and structures |
@@ -135,16 +123,15 @@ struct acpi_table_header /* ACPI common table header */ | |||
135 | 123 | ||
136 | /* Master MADT */ | 124 | /* Master MADT */ |
137 | 125 | ||
138 | struct multiple_apic_table | 126 | struct multiple_apic_table { |
139 | { | 127 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ |
140 | ACPI_TABLE_HEADER_DEF /* ACPI common table header */ | 128 | u32 local_apic_address; /* Physical address of local APIC */ |
141 | u32 local_apic_address; /* Physical address of local APIC */ | ||
142 | 129 | ||
143 | /* Flags (32 bits) */ | 130 | /* Flags (32 bits) */ |
144 | 131 | ||
145 | u8 PCATcompat : 1; /* 00: System also has dual 8259s */ | 132 | u8 PCATcompat:1; /* 00: System also has dual 8259s */ |
146 | u8 : 7; /* 01-07: Reserved, must be zero */ | 133 | u8:7; /* 01-07: Reserved, must be zero */ |
147 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ | 134 | u8 reserved1[3]; /* 08-31: Reserved, must be zero */ |
148 | }; | 135 | }; |
149 | 136 | ||
150 | /* Values for Type in APIC_HEADER_DEF */ | 137 | /* Values for Type in APIC_HEADER_DEF */ |
@@ -158,7 +145,7 @@ struct multiple_apic_table | |||
158 | #define APIC_IO_SAPIC 6 | 145 | #define APIC_IO_SAPIC 6 |
159 | #define APIC_LOCAL_SAPIC 7 | 146 | #define APIC_LOCAL_SAPIC 7 |
160 | #define APIC_XRUPT_SOURCE 8 | 147 | #define APIC_XRUPT_SOURCE 8 |
161 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ | 148 | #define APIC_RESERVED 9 /* 9 and greater are reserved */ |
162 | 149 | ||
163 | /* | 150 | /* |
164 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) | 151 | * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) |
@@ -167,10 +154,8 @@ struct multiple_apic_table | |||
167 | u8 type; \ | 154 | u8 type; \ |
168 | u8 length; | 155 | u8 length; |
169 | 156 | ||
170 | struct apic_header | 157 | struct apic_header { |
171 | { | 158 | APIC_HEADER_DEF}; |
172 | APIC_HEADER_DEF | ||
173 | }; | ||
174 | 159 | ||
175 | /* Values for MPS INTI flags */ | 160 | /* Values for MPS INTI flags */ |
176 | 161 | ||
@@ -190,113 +175,84 @@ struct apic_header | |||
190 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ | 175 | u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\ |
191 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ | 176 | u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\ |
192 | u8 : 4; /* 04-07: Reserved, must be zero */\ | 177 | u8 : 4; /* 04-07: Reserved, must be zero */\ |
193 | u8 reserved1; /* 08-15: Reserved, must be zero */ | 178 | u8 reserved1; /* 08-15: Reserved, must be zero */ |
194 | 179 | ||
195 | #define LOCAL_APIC_FLAGS \ | 180 | #define LOCAL_APIC_FLAGS \ |
196 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ | 181 | u8 processor_enabled: 1; /* 00: Processor is usable if set */\ |
197 | u8 : 7; /* 01-07: Reserved, must be zero */\ | 182 | u8 : 7; /* 01-07: Reserved, must be zero */\ |
198 | u8 reserved2; /* 08-15: Reserved, must be zero */ | 183 | u8 reserved2; /* 08-15: Reserved, must be zero */ |
199 | 184 | ||
200 | /* Sub-structures for MADT */ | 185 | /* Sub-structures for MADT */ |
201 | 186 | ||
202 | struct madt_processor_apic | 187 | struct madt_processor_apic { |
203 | { | 188 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
204 | APIC_HEADER_DEF | 189 | u8 local_apic_id; /* Processor's local APIC id */ |
205 | u8 processor_id; /* ACPI processor id */ | 190 | LOCAL_APIC_FLAGS}; |
206 | u8 local_apic_id; /* Processor's local APIC id */ | 191 | |
207 | LOCAL_APIC_FLAGS | 192 | struct madt_io_apic { |
193 | APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ | ||
194 | u8 reserved; /* Reserved - must be zero */ | ||
195 | u32 address; /* APIC physical address */ | ||
196 | u32 interrupt; /* Global system interrupt where INTI | ||
197 | * lines start */ | ||
208 | }; | 198 | }; |
209 | 199 | ||
210 | struct madt_io_apic | 200 | struct madt_interrupt_override { |
211 | { | 201 | APIC_HEADER_DEF u8 bus; /* 0 - ISA */ |
212 | APIC_HEADER_DEF | 202 | u8 source; /* Interrupt source (IRQ) */ |
213 | u8 io_apic_id; /* I/O APIC ID */ | 203 | u32 interrupt; /* Global system interrupt */ |
214 | u8 reserved; /* Reserved - must be zero */ | 204 | MPS_INTI_FLAGS}; |
215 | u32 address; /* APIC physical address */ | ||
216 | u32 interrupt; /* Global system interrupt where INTI | ||
217 | * lines start */ | ||
218 | }; | ||
219 | |||
220 | struct madt_interrupt_override | ||
221 | { | ||
222 | APIC_HEADER_DEF | ||
223 | u8 bus; /* 0 - ISA */ | ||
224 | u8 source; /* Interrupt source (IRQ) */ | ||
225 | u32 interrupt; /* Global system interrupt */ | ||
226 | MPS_INTI_FLAGS | ||
227 | }; | ||
228 | 205 | ||
229 | struct madt_nmi_source | 206 | struct madt_nmi_source { |
230 | { | 207 | APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ |
231 | APIC_HEADER_DEF | ||
232 | MPS_INTI_FLAGS | ||
233 | u32 interrupt; /* Global system interrupt */ | ||
234 | }; | 208 | }; |
235 | 209 | ||
236 | struct madt_local_apic_nmi | 210 | struct madt_local_apic_nmi { |
237 | { | 211 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
238 | APIC_HEADER_DEF | 212 | MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ |
239 | u8 processor_id; /* ACPI processor id */ | ||
240 | MPS_INTI_FLAGS | ||
241 | u8 lint; /* LINTn to which NMI is connected */ | ||
242 | }; | 213 | }; |
243 | 214 | ||
244 | struct madt_address_override | 215 | struct madt_address_override { |
245 | { | 216 | APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ |
246 | APIC_HEADER_DEF | 217 | u64 address; /* APIC physical address */ |
247 | u16 reserved; /* Reserved, must be zero */ | ||
248 | u64 address; /* APIC physical address */ | ||
249 | }; | 218 | }; |
250 | 219 | ||
251 | struct madt_io_sapic | 220 | struct madt_io_sapic { |
252 | { | 221 | APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ |
253 | APIC_HEADER_DEF | 222 | u8 reserved; /* Reserved, must be zero */ |
254 | u8 io_sapic_id; /* I/O SAPIC ID */ | 223 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ |
255 | u8 reserved; /* Reserved, must be zero */ | 224 | u64 address; /* SAPIC physical address */ |
256 | u32 interrupt_base; /* Glocal interrupt for SAPIC start */ | ||
257 | u64 address; /* SAPIC physical address */ | ||
258 | }; | 225 | }; |
259 | 226 | ||
260 | struct madt_local_sapic | 227 | struct madt_local_sapic { |
261 | { | 228 | APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ |
262 | APIC_HEADER_DEF | 229 | u8 local_sapic_id; /* SAPIC ID */ |
263 | u8 processor_id; /* ACPI processor id */ | 230 | u8 local_sapic_eid; /* SAPIC EID */ |
264 | u8 local_sapic_id; /* SAPIC ID */ | 231 | u8 reserved[3]; /* Reserved, must be zero */ |
265 | u8 local_sapic_eid; /* SAPIC EID */ | 232 | LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ |
266 | u8 reserved[3]; /* Reserved, must be zero */ | 233 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ |
267 | LOCAL_APIC_FLAGS | ||
268 | u32 processor_uID; /* Numeric UID - ACPI 3.0 */ | ||
269 | char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ | ||
270 | }; | 234 | }; |
271 | 235 | ||
272 | struct madt_interrupt_source | 236 | struct madt_interrupt_source { |
273 | { | 237 | APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ |
274 | APIC_HEADER_DEF | 238 | u8 processor_id; /* Processor ID */ |
275 | MPS_INTI_FLAGS | 239 | u8 processor_eid; /* Processor EID */ |
276 | u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ | 240 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ |
277 | u8 processor_id; /* Processor ID */ | 241 | u32 interrupt; /* Global system interrupt */ |
278 | u8 processor_eid; /* Processor EID */ | 242 | u32 flags; /* Interrupt Source Flags */ |
279 | u8 io_sapic_vector; /* Vector value for PMI interrupts */ | ||
280 | u32 interrupt; /* Global system interrupt */ | ||
281 | u32 flags; /* Interrupt Source Flags */ | ||
282 | }; | 243 | }; |
283 | 244 | ||
284 | |||
285 | /* | 245 | /* |
286 | * Smart Battery | 246 | * Smart Battery |
287 | */ | 247 | */ |
288 | struct smart_battery_table | 248 | struct smart_battery_table { |
289 | { | 249 | ACPI_TABLE_HEADER_DEF u32 warning_level; |
290 | ACPI_TABLE_HEADER_DEF | 250 | u32 low_level; |
291 | u32 warning_level; | 251 | u32 critical_level; |
292 | u32 low_level; | ||
293 | u32 critical_level; | ||
294 | }; | 252 | }; |
295 | 253 | ||
296 | |||
297 | #pragma pack() | 254 | #pragma pack() |
298 | 255 | ||
299 | |||
300 | /* | 256 | /* |
301 | * ACPI Table information. We save the table address, length, | 257 | * ACPI Table information. We save the table address, length, |
302 | * and type of memory allocation (mapped or allocated) for each | 258 | * and type of memory allocation (mapped or allocated) for each |
@@ -320,39 +276,35 @@ struct smart_battery_table | |||
320 | 276 | ||
321 | /* Data about each known table type */ | 277 | /* Data about each known table type */ |
322 | 278 | ||
323 | struct acpi_table_support | 279 | struct acpi_table_support { |
324 | { | 280 | char *name; |
325 | char *name; | 281 | char *signature; |
326 | char *signature; | 282 | void **global_ptr; |
327 | void **global_ptr; | 283 | u8 sig_length; |
328 | u8 sig_length; | 284 | u8 flags; |
329 | u8 flags; | ||
330 | }; | 285 | }; |
331 | 286 | ||
332 | |||
333 | /* | 287 | /* |
334 | * Get the ACPI version-specific tables | 288 | * Get the ACPI version-specific tables |
335 | */ | 289 | */ |
336 | #include "actbl1.h" /* Acpi 1.0 table definitions */ | 290 | #include "actbl1.h" /* Acpi 1.0 table definitions */ |
337 | #include "actbl2.h" /* Acpi 2.0 table definitions */ | 291 | #include "actbl2.h" /* Acpi 2.0 table definitions */ |
338 | 292 | ||
339 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, | 293 | extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, |
340 | * needed for certain workarounds */ | 294 | * needed for certain workarounds */ |
341 | 295 | ||
342 | #pragma pack(1) | 296 | #pragma pack(1) |
343 | /* | 297 | /* |
344 | * High performance timer | 298 | * High performance timer |
345 | */ | 299 | */ |
346 | struct hpet_table | 300 | struct hpet_table { |
347 | { | 301 | ACPI_TABLE_HEADER_DEF u32 hardware_id; |
348 | ACPI_TABLE_HEADER_DEF | 302 | struct acpi_generic_address base_address; |
349 | u32 hardware_id; | 303 | u8 hpet_number; |
350 | struct acpi_generic_address base_address; | 304 | u16 clock_tick; |
351 | u8 hpet_number; | 305 | u8 attributes; |
352 | u16 clock_tick; | ||
353 | u8 attributes; | ||
354 | }; | 306 | }; |
355 | 307 | ||
356 | #pragma pack() | 308 | #pragma pack() |
357 | 309 | ||
358 | #endif /* __ACTBL_H__ */ | 310 | #endif /* __ACTBL_H__ */ |