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 } __attribute__((packed)) acpi_ics_hdr_t;
21 * @brief ACPI Processor Local APIC Structure (PLAS)
22 * This structure tell information about our Local APIC per processor. Including
28 acpi_ics_hdr_t header;
32 } __attribute__((packed)) acpi_apic_t;
35 * @brief ACPI IO APIC Structure (IOAS)
37 * This structure tell information about our I/O APIC on motherboard. Including
43 acpi_ics_hdr_t header;
47 // The global system interrupt offset for this IOAPIC. (Kind of IRQ offset for a slave IOAPIC)
49 } __attribute__((packed)) acpi_ioapic_t;
52 * @brief ACPI Interrupt Source Override (INTSO)
54 * According to the ACPI Spec, the IRQ config between APIC and 8259 PIC can be
55 * assumed to be identically mapped. However, some manufactures may have their
56 * own preference and hence expections may be introduced. This structure provide
57 * information on such exception.
62 acpi_ics_hdr_t header;
64 // source, which is the original IRQ back in the era of IBM PC/AT, the 8259
67 // global system interrupt. The override of source in APIC mode
70 } __attribute__((packed)) acpi_intso_t;
77 // Here is a bunch of packed ICS reside here back-to-back.
78 } __attribute__((packed)) acpi_madt_t;
84 acpi_ioapic_t* ioapic;
85 acpi_intso_t** irq_exception;
86 } __attribute__((packed)) acpi_madt_toc_t;
88 #endif /* __LUNAIX_ACPI_MADT_H */