2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id: acpi.h,v 1.1 2004/01/02 22:23:57 nicja Exp $
5 Desc: AROS ACPI Definitions.
8 #ifndef __AROS_ACPI_H__
9 #define __AROS_ACPI_H__
12 # include <exec/lists.h>
14 #ifndef EXEC_SEMAPHORES
15 # include <exec/semaphores.h>
17 #ifndef UTILITY_HOOKS_H
18 # include <utility/hooks.h>
21 #ifndef ACPI_MAX_TABLES
22 #define ACPI_MAX_TABLES 32
25 struct KernelACPIData
{
27 int kb_APIC_IRQ_Model
;
30 IPTR kb_ACPI_SDT_Phys
;
31 int kb_ACPI_SDT_Count
;
32 IPTR kb_ACPI_SDT_Entry
[ACPI_MAX_TABLES
];
48 ACPI_TABLE_UNKNOWN
= 0,
69 /* System Description Table (RSDT/XSDT) */
73 enum acpi_table_id id
;
77 struct acpi_table_hook
79 struct MinNode h_MinNode
;
80 IPTR (*h_Entry
)(); /* Main entry point */
81 IPTR (*h_SubEntry
)(); /* Secondary entry point */
82 unsigned long phys_addr
;
86 struct acpi_madt_entry_hook
88 struct MinNode h_MinNode
;
89 IPTR (*h_Entry
)(); /* Main entry point */
90 IPTR (*h_SubEntry
)(); /* Secondary entry point */
91 struct acpi_table_entry_header
*header
;
94 /********** ACPI structure definitions ****************/
96 /* ACPI 2.0 Generic Address Structure (GAS) */
98 struct acpi_generic_address
100 unsigned char address_space_id
; /* Address space where struct or register exists. */
101 unsigned char register_bit_width
; /* Size in bits of given register */
102 unsigned char register_bit_offset
; /* Bit offset within the register */
103 unsigned char reserved
; /* Must be 0 */
104 UQUAD address
; /* 64-bit address of struct or register */
107 /********** ACPI DEFINITIONS ****************/
109 #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
110 char signature [4]; /* ACPI signature (4 ASCII characters) */\
111 unsigned int length; /* Length of table, in bytes, including header */\
112 unsigned char revision; /* ACPI Specification minor version # */\
113 unsigned char checksum; /* To make sum of entire table == 0 */\
114 char oem_id [6]; /* OEM identification */\
115 char oem_table_id [8]; /* OEM table identification */\
116 unsigned int oem_revision; /* OEM revision number */\
117 char asl_compiler_id [4]; /* ASL compiler vendor ID */\
118 unsigned int asl_compiler_revision; /* ASL compiler revision number */
121 struct acpi_table_header
/* ACPI common table header */
123 ACPI_TABLE_HEADER_DEF
128 enum acpi_irq_model_id
130 ACPI_IRQ_MODEL_PIC
= 0,
131 ACPI_IRQ_MODEL_IOAPIC
,
132 ACPI_IRQ_MODEL_IOSAPIC
,
136 /* Root System Description Pointer "RSDP" structures */
138 struct acpi_table_rsdp
141 unsigned char checksum
;
143 unsigned char revision
;
144 unsigned int rsdt_address
;
147 struct acpi20_table_rsdp
150 unsigned char checksum
;
152 unsigned char revision
;
153 unsigned int rsdt_address
;
156 unsigned char ext_checksum
;
157 unsigned char reserved
[3];
160 struct acpi_table_entry_header
163 unsigned char length
;
166 /* Root System Description Table "RSDT" structures */
168 struct acpi_table_rsdt
170 struct acpi_table_header header
;
171 unsigned int entry
[8];
174 /* Extended System Description Table "XSDT" structures */
176 struct acpi_table_xsdt
178 struct acpi_table_header header
;
182 /* Fixed ACPI Description Table "FADT" structures */
184 struct acpi_table_fadt
186 struct acpi_table_header header
;
187 unsigned int facs_addr
;
188 unsigned int dsdt_addr
;
192 /* Multiple APIC Description Table "MADT" structures */
194 struct acpi_table_madt
196 struct acpi_table_header header
;
197 unsigned int lapic_address
;
200 unsigned int pcat_compat
:1;
201 unsigned int reserved
:31;
205 enum acpi_madt_entry_id
209 ACPI_MADT_INT_SRC_OVR
,
212 ACPI_MADT_LAPIC_ADDR_OVR
,
215 ACPI_MADT_PLAT_INT_SRC
,
216 ACPI_MADT_ENTRY_COUNT
224 } acpi_interrupt_flags
;
226 struct acpi_table_lapic
228 struct acpi_table_entry_header header
;
229 unsigned char acpi_id
;
233 unsigned int enabled
:1;
234 unsigned int reserved
:31;
238 struct acpi_table_ioapic
240 struct acpi_table_entry_header header
;
242 unsigned char reserved
;
243 unsigned int address
;
244 unsigned int global_irq_base
;
247 struct acpi_table_int_src_ovr
249 struct acpi_table_entry_header header
;
251 unsigned char bus_irq
;
252 unsigned int global_irq
;
253 acpi_interrupt_flags flags
;
256 struct acpi_table_nmi_src
258 struct acpi_table_entry_header header
;
259 acpi_interrupt_flags flags
;
260 unsigned int global_irq
;
263 struct acpi_table_lapic_nmi
265 struct acpi_table_entry_header header
;
266 unsigned char acpi_id
;
267 acpi_interrupt_flags flags
;
271 struct acpi_table_lapic_addr_ovr
273 struct acpi_table_entry_header header
;
274 unsigned char reserved
[2];
278 struct acpi_table_iosapic
280 struct acpi_table_entry_header header
;
282 unsigned char reserved
;
283 unsigned int global_irq_base
;
287 struct acpi_table_lsapic
289 struct acpi_table_entry_header header
;
290 unsigned char acpi_id
;
293 unsigned char reserved
[3];
295 unsigned int enabled
:1;
296 unsigned int reserved
:31;
300 struct acpi_table_plat_int_src
302 struct acpi_table_entry_header header
;
303 acpi_interrupt_flags flags
;
304 unsigned char type
; /* See acpi_interrupt_type */
307 unsigned char iosapic_vector
;
308 unsigned int global_irq
;
309 unsigned int reserved
;
312 enum acpi_interrupt_id
314 ACPI_INTERRUPT_PMI
= 1,
320 #define ACPI_SPACE_MEM 0
322 struct acpi_gen_regaddr
324 unsigned char space_id
;
325 unsigned char bit_width
;
326 unsigned char bit_offset
;
332 struct acpi_table_hpet
334 struct acpi_table_header header
;
336 struct acpi_gen_regaddr addr
;
337 unsigned char number
;
339 unsigned char page_protect
;
343 * System Resource Affinity Table (SRAT)
344 * see http://www.microsoft.com/hwdev/design/srat.htm
346 struct acpi_table_srat
348 struct acpi_table_header header
;
349 unsigned int table_revision
;
353 enum acpi_srat_entry_id
355 ACPI_SRAT_PROCESSOR_AFFINITY
= 0,
356 ACPI_SRAT_MEMORY_AFFINITY
,
357 ACPI_SRAT_ENTRY_COUNT
360 struct acpi_table_processor_affinity
{
361 struct acpi_table_entry_header header
;
362 unsigned char proximity_domain
;
363 unsigned char apic_id
;
366 unsigned int enabled
:1;
367 unsigned int reserved
:31;
369 unsigned char lsapic_eid
;
370 unsigned char reserved
[7];
373 struct acpi_table_memory_affinity
{
374 struct acpi_table_entry_header header
;
375 unsigned char proximity_domain
;
376 unsigned char reserved1
[5];
377 unsigned int base_addr_lo
;
378 unsigned int base_addr_hi
;
379 unsigned int length_lo
;
380 unsigned int length_hi
;
381 unsigned int memory_type
; /* See acpi_address_range_id */
384 unsigned int enabled
:1;
385 unsigned int hot_pluggable
:1;
386 unsigned int reserved
:30;
391 enum acpi_address_range_id
393 ACPI_ADDRESS_RANGE_MEMORY
= 1,
394 ACPI_ADDRESS_RANGE_RESERVED
= 2,
395 ACPI_ADDRESS_RANGE_ACPI
= 3,
396 ACPI_ADDRESS_RANGE_NVS
= 4,
397 ACPI_ADDRESS_RANGE_COUNT
401 * System Locality Information Table (SLIT)
402 * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf
404 struct acpi_table_slit
406 struct acpi_table_header header
;
408 unsigned char entry
[1]; /* real size = localities^2 */
411 /* Smart Battery Description Table (SBST) */
412 struct acpi_table_sbst
414 struct acpi_table_header header
;
415 unsigned int warning
; /* Warn user */
416 unsigned int low
; /* Critical sleep */
417 unsigned int critical
; /* Critical shutdown */
420 /* Embedded Controller Boot Resources Table (ECDT) */
421 struct acpi_table_ecdt
423 struct acpi_table_header header
;
424 struct acpi_generic_address ec_control
;
425 struct acpi_generic_address ec_data
;
427 unsigned char gpe_bit
;
431 /* ACPI Table Parser hook func protos */
433 AROS_UFP1(int, ACPI_hook_Table_MADT_Parse
,
434 AROS_UFPA(struct acpi_table_hook
*, table_hook
, A0
));
435 AROS_UFP1(int, ACPI_hook_Table_LAPIC_Parse
,
436 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
437 AROS_UFP1(int, ACPI_hook_Table_LAPIC_Addr_Ovr_Parse
,
438 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
439 AROS_UFP1(int, ACPI_hook_Table_LAPIC_NMI_Parse
,
440 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
441 AROS_UFP1(int, ACPI_hook_Table_IOAPIC_Parse
,
442 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
443 AROS_UFP1(int, ACPI_hook_Table_Int_Src_Ovr_Parse
,
444 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
445 AROS_UFP1(int, ACPI_hook_Table_NMI_Src_Parse
,
446 AROS_UFPA(struct acpi_madt_entry_hook
*, table_hook
, A0
));
447 AROS_UFP1(int, ACPI_hook_Table_HPET_Parse
,
448 AROS_UFPA(struct acpi_table_hook
*, table_hook
, A0
));
450 #endif /* __AROS_ACPI_H__ */