blob: 8627edd580acba553a327aaa55e2622a92889e62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/* ----------------------------------------------------------------------- *
*
* Copyright 2009 Erwan Velu - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, Inc., 53 Temple Place Ste 330,
* Boston MA 02111-1307, USA; either version 2 of the License, or
* (at your option) any later version; incorporated herein by reference.
*
* ----------------------------------------------------------------------- */
#ifndef MADT_H
#define MADT_H
#include <inttypes.h>
#include <stdbool.h>
#define MADT "MADT"
#define APIC "APIC"
enum {
PROCESSOR_LOCAL_APIC = 0,
IO_APIC = 1,
INTERRUPT_SOURCE_OVERRIDE = 2,
NMI = 3,
LOCAL_APIC_NMI_STRUCTURE = 4,
LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE = 5,
IO_SAPIC = 6,
LOCAL_SAPIC = 7,
PLATEFORM_INTERRUPT_SOURCES = 8
};
#define MAX_SLP 255
typedef struct {
uint8_t length;
uint8_t acpi_id;
uint8_t apic_id;
uint32_t flags;
} __attribute__ ((packed)) s_processor_local_apic;
typedef struct {
uint64_t address;
s_acpi_description_header header;
uint32_t local_apic_address;
uint32_t flags;
s_processor_local_apic processor_local_apic[MAX_SLP];
uint8_t processor_local_apic_count;
bool valid;
} s_madt;
void print_madt(s_madt *madt);
#endif
|