4 #include "kernel/kernel.h"
6 /* ACPI root system description pointer */
8 char signature
[8]; /* must be "RSD PTR " */
16 #define ACPI_SDT_SIGNATURE_LEN 4
18 #define ACPI_SDT_SIGNATURE(name) #name
20 /* header common to all system description tables */
21 struct acpi_sdt_header
{
22 char signature
[ACPI_SDT_SIGNATURE_LEN
];
30 u32_t creator_revision
;
33 struct acpi_generic_address
{
34 u8_t address_space_id
;
35 u8_t register_bit_width
;
36 u8_t register_bit_offset
;
41 struct acpi_fadt_header
43 struct acpi_sdt_header hdr
;
47 u8_t preferred_pm_profile
;
82 struct acpi_generic_address reset_reg
;
87 struct acpi_generic_address xpm1a_evt_blk
;
88 struct acpi_generic_address xpm1b_evt_blk
;
89 struct acpi_generic_address xpm1a_cnt_blk
;
90 struct acpi_generic_address xpm1b_cnt_blk
;
91 struct acpi_generic_address xpm2_cnt_blk
;
92 struct acpi_generic_address xpm_tmr_blk
;
93 struct acpi_generic_address xgpe0_blk
;
94 struct acpi_generic_address xgpe1_blk
;
97 struct acpi_madt_hdr
{
98 struct acpi_sdt_header hdr
;
99 u32_t local_apic_address
;
103 #define ACPI_MADT_TYPE_LAPIC 0
104 #define ACPI_MADT_TYPE_IOAPIC 1
105 #define ACPI_MADT_TYPE_INT_SRC 2
106 #define ACPI_MADT_TYPE_NMI_SRC 3
107 #define ACPI_MADT_TYPE_LAPIC_NMI 4
108 #define ACPI_MADT_TYPE_LAPIC_ADRESS 5
109 #define ACPI_MADT_TYPE_IOSAPIC 6
110 #define ACPI_MADT_TYPE_LSAPIC 7
111 #define ACPI_MADT_TYPE_PLATFORM_INT_SRC 8
112 #define ACPI_MADT_TYPE_Lx2APIC 9
113 #define ACPI_MADT_TYPE_Lx2APIC_NMI 10
115 struct acpi_madt_item_hdr
{
120 struct acpi_madt_lapic
{
121 struct acpi_madt_item_hdr hdr
;
127 struct acpi_madt_ioapic
{
128 struct acpi_madt_item_hdr hdr
;
132 u32_t global_int_base
;
135 struct acpi_madt_int_src
{
136 struct acpi_madt_item_hdr hdr
;
143 struct acpi_madt_nmi
{
144 struct acpi_madt_item_hdr hdr
;
149 void acpi_init(void);
151 void acpi_poweroff(void);
154 * Returns a pointer to the io acpi structure in the MADT table in ACPI. The
155 * pointer is valid only until paging is turned off. No memory is allocated in
156 * this function thus no memory needs to be freed
158 struct acpi_madt_ioapic
* acpi_get_ioapic_next(void);
159 /* same as above for local APICs */
160 struct acpi_madt_lapic
* acpi_get_lapic_next(void);
162 #endif /* __ACPI_H__ */