summaryrefslogtreecommitdiff
path: root/kernel/include/madt.h
blob: de3eb95da9c3c449a188a12888ae1d09400f8835 (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
54
55
#ifndef MADT_H
#define MADT_H

#include <rsdp.h>

struct MADT {
	struct ACPI_header h;
	uint32_t lacpi_addr;
	uint32_t flags;
} __attribute__((packed));

struct MADT_type_header  {
	uint8_t type;
	uint8_t len;
} __attribute__((packed));

struct MADT_cpu_local_apic {
	struct MADT_type_header h;
	uint8_t acpi_id;
	uint8_t apic_id;
	uint32_t flags;
} __attribute__((packed));

struct MADT_io_apic {
	struct MADT_type_header h;
	uint8_t apic_id;
	uint8_t reserved;
	uint32_t io_apic_addr;
	uint32_t int_base;
} __attribute__((packed));

struct MADT_io_apic_int {
	struct MADT_type_header h;
	uint8_t bus_source;
	uint8_t irq_source;
	uint32_t global_sys_int;
	uint16_t flags;
} __attribute__((packed));

struct MADT_lapic_nmi {
	struct MADT_type_header h;
	uint8_t acpi_cpu_id;
	uint16_t flags;
	uint8_t lint;
} __attribute__((packed));

struct MADT_lapic_addr {
	struct MADT_type_header h;
	uint16_t reserved;
	uint64_t phys_addr;
} __attribute__((packed));

void parse_madt(void);

#endif