1 #ifndef __LUNAIX_ACPI_MADT_H
2 #define __LUNAIX_ACPI_MADT_H
6 #define ACPI_MADT_LAPIC 0x0 // Local APIC
7 #define ACPI_MADT_IOAPIC 0x1 // I/O APIC
8 #define ACPI_MADT_INTSO 0x2 // Interrupt Source Override
11 * @brief ACPI Interrupt Controller Structure (ICS) Header
18 } ACPI_TABLE_PACKED acpi_ics_hdr_t;
19 #define __acpi_ics_hdr(acpi_ptr) ((acpi_ics_hdr_t*)__ptr(acpi_ptr))
22 * @brief ACPI Processor Local APIC Structure (PLAS)
23 * This structure tell information about our Local APIC per processor. Including
29 acpi_ics_hdr_t header;
33 } ACPI_TABLE_PACKED acpi_apic_t;
34 #define __acpi_apic(acpi_ptr) ((acpi_apic_t*)__ptr(acpi_ptr))
37 * @brief ACPI IO APIC Structure (IOAS)
39 * This structure tell information about our I/O APIC on motherboard. Including
45 acpi_ics_hdr_t header;
49 // The global system interrupt offset for this IOAPIC. (Kind of IRQ offset
50 // for a slave IOAPIC)
52 } ACPI_TABLE_PACKED acpi_ioapic_t;
53 #define __acpi_ioapic(acpi_ptr) ((acpi_ioapic_t*)__ptr(acpi_ptr))
56 * @brief ACPI Interrupt Source Override (INTSO)
58 * According to the ACPI Spec, the IRQ config between APIC and 8259 PIC can be
59 * assumed to be identically mapped. However, some manufactures may have their
60 * own preference and hence expections may be introduced. This structure provide
61 * information on such exception.
66 acpi_ics_hdr_t header;
68 // source, which is the original IRQ back in the era of IBM PC/AT, the 8259
71 // global system interrupt. The override of source in APIC mode
74 } ACPI_TABLE_PACKED acpi_intso_t;
75 #define __acpi_intso(acpi_ptr) ((acpi_intso_t*)__ptr(acpi_ptr))
82 // Here is a bunch of packed ICS reside here back-to-back.
83 } ACPI_TABLE_PACKED acpi_madt_t;
84 #define __acpi_madt(acpi_ptr) ((acpi_madt_t*)__ptr(acpi_ptr))
90 acpi_ioapic_t* ioapic;
91 acpi_intso_t** irq_exception;
92 } ACPI_TABLE_PACKED acpi_madt_toc_t;
94 #endif /* __LUNAIX_ACPI_MADT_H */