MOS Source Code
Loading...
Searching...
No Matches
acpi_types.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <mos/types.h>
6
7typedef struct
8{
9 char signature[8];
11 char oem_id[6];
15
16MOS_STATIC_ASSERT(sizeof(acpi_rsdp_v1_t) == 20, "acpi_rsdp_v1_t is not 20 bytes");
17
18typedef struct
19{
21
22 // below fields are only available in ACPI 2.0+
26 u8 reserved[3];
28
29#define ACPI_SIGNATURE_RSDP "RSD PTR "
31
32typedef struct
33{
34 char signature[4];
38 char oem_id[6];
39 char oem_table_id[8];
44
45typedef struct
46{
48 ptr32_t sdts[]; // 32-bit physical addresses of other SDTs
50
51typedef struct
52{
54 ptr64_t sdts[]; // 64-bit physical addresses of other SDTs
56
57#define ACPI_SIGNATURE_RSDT "RSDT" // Root System Description Table
58
67
68typedef struct
69{
73
74 // field used in ACPI 1.0; no longer in use, for compatibility only
76
109
110 // reserved in ACPI 1.0; used since ACPI 2.0+
112
115
116 // 12 byte structure; see below for details
118
120 u8 reserved3[3];
121
122 // 64bit pointers - Available on ACPI 2.0+
125
135
136#define ACPI_SIGNATURE_FADT "FACP" // Fixed ACPI Description Table
137
143
144// Type 0 - Processor Local APIC
152
153// Type 1 - I/O APIC
162
163// Type 2 - IO/APIC Interrupt Source Override
172
173// Type 3 - IO/APIC Non-maskable interrupt source
182
183// Type 4 - Local APIC Non-maskable interrupts
191
192// Type 5 - Local APIC Address Override
199
200// Type 9 - Processor Local x2APIC
209
216
217#define ACPI_SIGNATURE_MADT "APIC" // Multiple APIC Description Table
218
219#define madt_type_is_valid(var) (var->record_length && ((var->type >= 0 && var->type <= 5) || var->type == 9))
220#define madt_entry_foreach(var, madt) \
221 for (acpi_madt_header_t *var = (void *) ((char *) madt + sizeof(acpi_madt_t)); madt_type_is_valid(var); var = (void *) ((char *) var + var->record_length))
222
237
238#define ACPI_SIGNATURE_HPET "HPET" // High Precision Event Timer Description Table
239
acpi_rsdp_v2_t acpi_rsdp_t
Definition acpi_types.h:30
#define __packed
Definition mos_global.h:29
#define MOS_STATIC_ASSERT
Definition mos_global.h:14
generic_addr_t reset_reg
Definition acpi_types.h:117
generic_addr_t X_GPE1Block
Definition acpi_types.h:133
generic_addr_t X_PM1aEventBlock
Definition acpi_types.h:126
u32 pm_timer_block
Definition acpi_types.h:89
generic_addr_t X_PM1bControlBlock
Definition acpi_types.h:129
generic_addr_t X_GPE0Block
Definition acpi_types.h:132
u8 pm1_control_len
Definition acpi_types.h:93
u32 pm2_control_block
Definition acpi_types.h:88
u32 pm1b_control_block
Definition acpi_types.h:87
u32 pm1a_control_block
Definition acpi_types.h:86
u8 c_state_control
Definition acpi_types.h:99
u16 worst_c2_latency
Definition acpi_types.h:100
generic_addr_t X_PM1bEventBlock
Definition acpi_types.h:127
u16 sci_interrupt
Definition acpi_types.h:78
u32 smi_command_port
Definition acpi_types.h:79
generic_addr_t X_PM1aControlBlock
Definition acpi_types.h:128
u32 pm1b_event_block
Definition acpi_types.h:85
u16 boot_arch_flags
Definition acpi_types.h:111
u8 pstate_control
Definition acpi_types.h:83
generic_addr_t X_PM2ControlBlock
Definition acpi_types.h:130
u8 pm2_control_len
Definition acpi_types.h:94
u8 preferred_power_management_profile
Definition acpi_types.h:77
u64 X_FirmwareControl
Definition acpi_types.h:123
acpi_sdt_header_t sdt_header
Definition acpi_types.h:70
u32 pm1a_event_block
Definition acpi_types.h:84
generic_addr_t X_PMTimerBlock
Definition acpi_types.h:131
u16 worst_c3_latency
Definition acpi_types.h:101
u8 legacy_replacement
Definition acpi_types.h:230
u16 pci_vendor_id
Definition acpi_types.h:231
generic_addr_t addr
Definition acpi_types.h:232
acpi_sdt_header_t sdt_header
Definition acpi_types.h:225
acpi_madt_header_t header
Definition acpi_types.h:147
acpi_madt_header_t header
Definition acpi_types.h:156
acpi_madt_header_t header
Definition acpi_types.h:176
acpi_madt_header_t header
Definition acpi_types.h:186
acpi_madt_header_t header
Definition acpi_types.h:195
acpi_madt_header_t header
Definition acpi_types.h:203
acpi_sdt_header_t sdt_header
Definition acpi_types.h:212
acpi_rsdp_v1_t v1
Definition acpi_types.h:20
acpi_sdt_header_t sdt_header
Definition acpi_types.h:47
acpi_sdt_header_t sdt_header
Definition acpi_types.h:53
u8 * definition_block
Definition acpi_types.h:243
bool valid
Definition acpi_types.h:244
acpi_sdt_header_t header
Definition acpi_types.h:242
unsigned int u32
Definition types.h:21
unsigned short u16
Definition types.h:20
unsigned int ptr32_t
Definition types.h:26
unsigned long long u64
Definition types.h:23
unsigned long long ptr64_t
Definition types.h:27
unsigned char u8
Definition types.h:19