coverity appeasement
[minix.git] / kernel / arch / i386 / acpi.h
blobddbd50419f2eef2a6a5176a754808b55adfd5efd
1 #ifndef __ACPI_H__
2 #define __ACPI_H__
4 #include "kernel/kernel.h"
6 /* ACPI root system description pointer */
7 struct acpi_rsdp {
8 char signature[8]; /* must be "RSD PTR " */
9 u8_t checksum;
10 char oemid[6];
11 u8_t revision;
12 u32_t rsdt_addr;
13 u32_t length;
14 };
16 #define ACPI_SDT_SIGNATURE_LEN 4
18 #define ACPI_SDT_SIGNATURE(name) #name
20 /* header common to all system description tables */
21 struct acpi_sdt_header {
22 char signature[ACPI_SDT_SIGNATURE_LEN];
23 u32_t length;
24 u8_t revision;
25 u8_t checksum;
26 char oemid[6];
27 char oem_table_id[8];
28 u32_t oem_revision;
29 u32_t creator_id;
30 u32_t creator_revision;
33 struct acpi_madt_hdr {
34 struct acpi_sdt_header hdr;
35 u32_t local_apic_address;
36 u32_t flags;
39 #define ACPI_MADT_TYPE_LAPIC 0
40 #define ACPI_MADT_TYPE_IOAPIC 1
41 #define ACPI_MADT_TYPE_INT_SRC 2
42 #define ACPI_MADT_TYPE_NMI_SRC 3
43 #define ACPI_MADT_TYPE_LAPIC_NMI 4
44 #define ACPI_MADT_TYPE_LAPIC_ADRESS 5
45 #define ACPI_MADT_TYPE_IOSAPIC 6
46 #define ACPI_MADT_TYPE_LSAPIC 7
47 #define ACPI_MADT_TYPE_PLATFORM_INT_SRC 8
48 #define ACPI_MADT_TYPE_Lx2APIC 9
49 #define ACPI_MADT_TYPE_Lx2APIC_NMI 10
51 struct acpi_madt_item_hdr{
52 u8_t type;
53 u8_t length;
56 struct acpi_madt_lapic {
57 struct acpi_madt_item_hdr hdr;
58 u8_t acpi_cpu_id;
59 u8_t apic_id;
60 u32_t flags;
63 struct acpi_madt_ioapic {
64 struct acpi_madt_item_hdr hdr;
65 u8_t id;
66 u8_t __reserved;
67 u32_t address;
68 u32_t global_int_base;
71 struct acpi_madt_int_src {
72 struct acpi_madt_item_hdr hdr;
73 u8_t bus;
74 u8_t bus_int;
75 u32_t global_int;
76 u16_t mps_flags;
79 struct acpi_madt_nmi {
80 struct acpi_madt_item_hdr hdr;
81 u16_t flags;
82 u32_t global_int;
85 void acpi_init(void);
87 /*
88 * Returns a pointer to the io acpi structure in the MADT table in ACPI. The
89 * pointer is valid only until paging is turned off. No memory is allocated in
90 * this function thus no memory needs to be freed
92 struct acpi_madt_ioapic * acpi_get_ioapic_next(void);
93 /* same as above for local APICs */
94 struct acpi_madt_lapic * acpi_get_lapic_next(void);
96 #endif /* __ACPI_H__ */