1 /* ----------------------------------------------------------------------- *
3 * Copyright 2009-2011 Erwan Velu - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
22 PROCESSOR_LOCAL_APIC
= 0,
24 INTERRUPT_SOURCE_OVERRIDE
= 2,
26 LOCAL_APIC_NMI_STRUCTURE
= 4,
27 LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE
= 5,
30 PLATEFORM_INTERRUPT_SOURCES
= 8
34 * - processor_local_apic flags
37 #define PROCESSOR_LOCAL_APIC_ENABLE 1
46 } __attribute__ ((packed
)) s_processor_local_apic
;
48 #define MAX_IO_APIC 255
54 uint32_t io_apic_address
;
55 uint32_t global_system_interrupt_base
;
56 } __attribute__ ((packed
)) s_io_apic
;
59 * - interrupt_source_override
62 /* Bits 1&2 must be set to 0 */
63 #define POLARITY_CONFORM_MASK 0x0
64 #define POLARITY_ACTIVE_HIGH 0x1
65 #define POLARITY_RESERVED 0x2
66 #define POLARITY_ACTIVE_LOW 0x3
67 /* Bits 3&4 must be set to 0 */
68 #define TRIGGER_CONFORM_MASK 0x3
69 #define TRIGGER_EDGE 0x4
70 #define TRIGGER_RESERVED 0x8
71 #define TRIGGER_LEVEL 0xA
79 uint32_t global_system_interrupt
;
81 } __attribute__ ((packed
)) s_interrupt_source_override
;
87 uint32_t global_system_interrupt
;
88 } __attribute__ ((packed
)) s_nmi
;
90 #define MAX_LOCAL_APIC_NMI 255
94 uint8_t acpi_processor_id
;
96 uint8_t local_apic_lint
;
97 } __attribute__ ((packed
)) s_local_apic_nmi
;
99 #define MAX_L_A_A_O 255
104 uint64_t local_apic_address
;
105 } __attribute__ ((packed
)) s_local_apic_address_override
;
107 #define MAX_IO_SAPIC 255
113 uint32_t global_system_interrupt_base
;
114 uint64_t io_sapic_address
;
115 } __attribute__ ((packed
)) s_io_sapic
;
117 #define ACPI_PROCESSOR_UID_STRING_OFFSET 16
118 #define MAX_LOCAL_SAPIC 255
122 uint8_t acpi_processor_id
;
123 uint8_t local_sapic_id
;
124 uint8_t local_sapic_eid
;
127 uint32_t acpi_processor_uid_value
;
128 char *acpi_processor_uid_string
;
129 } __attribute__ ((packed
)) s_local_sapic
;
133 s_acpi_description_header header
;
134 uint32_t local_apic_address
;
136 s_processor_local_apic processor_local_apic
[MAX_S_L_P
];
137 uint8_t processor_local_apic_count
;
138 s_io_apic io_apic
[MAX_IO_APIC
];
139 uint8_t io_apic_count
;
140 s_interrupt_source_override interrupt_source_override
[MAX_I_S_O
];
141 uint8_t interrupt_source_override_count
;
142 s_nmi nmi
[MAX_I_S_O
];
144 s_local_apic_nmi local_apic_nmi
[MAX_LOCAL_APIC_NMI
];
145 uint8_t local_apic_nmi_count
;
146 s_local_apic_address_override local_apic_address_override
[MAX_L_A_A_O
];
147 uint8_t local_apic_address_override_count
;
148 s_io_sapic io_sapic
[MAX_IO_SAPIC
];
149 uint8_t io_sapic_count
;
150 s_local_sapic local_sapic
[MAX_LOCAL_SAPIC
];
151 uint8_t local_sapic_count
;
155 void print_madt(s_madt
* madt
);