Amine lost his bet, part 2 of x
[reactos.git] / include / reactos / drivers / acpi / acpi.h
1 /*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: include/reactos/drivers/acpi/acpi.h
5 * PURPOSE: ACPI Tables and NT Registry Data
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 //
10 // ACPI BIOS Registry Component Configuration Data
11 //
12 typedef struct _ACPI_E820_ENTRY
13 {
14 PHYSICAL_ADDRESS Base;
15 LARGE_INTEGER Length;
16 ULONGLONG Type;
17 } ACPI_E820_ENTRY, *PACPI_E820_ENTRY;
18
19 typedef struct _ACPI_BIOS_MULTI_NODE
20 {
21 PHYSICAL_ADDRESS RsdtAddress;
22 ULONGLONG Count;
23 ACPI_E820_ENTRY E820Entry[1];
24 } ACPI_BIOS_MULTI_NODE, *PACPI_BIOS_MULTI_NODE;
25
26 //
27 // ACPI Signatures
28 //
29 #define RSDP_SIGNATURE 0x2052545020445352 // "RSD PTR "
30 #define FACS_SIGNATURE 0x53434146 // "FACS"
31 #define FADT_SIGNATURE 0x50434146 // "FACP"
32 #define RSDT_SIGNATURE 0x54445352 // "RSDT"
33 #define APIC_SIGNATURE 0x43495041 // "APIC"
34 #define DSDT_SIGNATURE 0x54445344 // "DSDT"
35 #define SSDT_SIGNATURE 0x54445353 // "SSDT"
36 #define PSDT_SIGNATURE 0x54445350 // "PSDT"
37 #define SBST_SIGNATURE 0x54534253 // "SBST"
38 #define DBGP_SIGNATURE 0x50474244 // "DBGP"
39 #define XSDT_SIGNATURE 'TDSX'
40 #define BOOT_SIGNATURE 'TOOB'
41 #define SRAT_SIGNATURE 'TARS'
42 #define WDRT_SIGNATURE 'TRDW'
43
44 //
45 // FADT Flags
46 //
47 #define ACPI_TMR_VAL_EXT 0x100
48
49 //
50 // ACPI Generic Register Address
51 //
52 typedef struct _GEN_ADDR
53 {
54 UCHAR AddressSpaceID;
55 UCHAR BitWidth;
56 UCHAR BitOffset;
57 UCHAR Reserved;
58 PHYSICAL_ADDRESS Address;
59 } GEN_ADDR, *PGEN_ADDR;
60
61 //
62 // ACPI BIOS Structures (packed)
63 //
64 #include <pshpack1.h>
65 typedef struct _RSDP
66 {
67 ULONGLONG Signature;
68 UCHAR Checksum;
69 UCHAR OEMID[6];
70 UCHAR Reserved[1];
71 ULONG RsdtAddress;
72 } RSDP;
73 typedef RSDP *PRSDP;
74
75 typedef struct _DESCRIPTION_HEADER
76 {
77 ULONG Signature;
78 ULONG Length;
79 UCHAR Revision;
80 UCHAR Checksum;
81 UCHAR OEMID[6];
82 UCHAR OEMTableID[8];
83 ULONG OEMRevision;
84 UCHAR CreatorID[4];
85 ULONG CreatorRev;
86 } DESCRIPTION_HEADER;
87 typedef DESCRIPTION_HEADER *PDESCRIPTION_HEADER;
88
89 typedef struct _FACS
90 {
91 ULONG Signature;
92 ULONG Length;
93 ULONG HardwareSignature;
94 ULONG pFirmwareWakingVector;
95 ULONG GlobalLock;
96 ULONG Flags;
97 PHYSICAL_ADDRESS x_FirmwareWakingVector;
98 UCHAR version;
99 UCHAR Reserved[32];
100 } FACS;
101 typedef FACS *PFACS;
102
103 typedef struct _FADT
104 {
105 DESCRIPTION_HEADER Header;
106 ULONG facs;
107 ULONG dsdt;
108 UCHAR int_model;
109 UCHAR pm_profile;
110 USHORT sci_int_vector;
111 ULONG smi_cmd_io_port;
112 UCHAR acpi_on_value;
113 UCHAR acpi_off_value;
114 UCHAR s4bios_req;
115 UCHAR pstate_control;
116 ULONG pm1a_evt_blk_io_port;
117 ULONG pm1b_evt_blk_io_port;
118 ULONG pm1a_ctrl_blk_io_port;
119 ULONG pm1b_ctrl_blk_io_port;
120 ULONG pm2_ctrl_blk_io_port;
121 ULONG pm_tmr_blk_io_port;
122 ULONG gp0_blk_io_port;
123 ULONG gp1_blk_io_port;
124 UCHAR pm1_evt_len;
125 UCHAR pm1_ctrl_len;
126 UCHAR pm2_ctrl_len;
127 UCHAR pm_tmr_len;
128 UCHAR gp0_blk_len;
129 UCHAR gp1_blk_len;
130 UCHAR gp1_base;
131 UCHAR cstate_control;
132 USHORT lvl2_latency;
133 USHORT lvl3_latency;
134 USHORT flush_size;
135 USHORT flush_stride;
136 UCHAR duty_offset;
137 UCHAR duty_width;
138 UCHAR day_alarm_index;
139 UCHAR month_alarm_index;
140 UCHAR century_alarm_index;
141 USHORT boot_arch;
142 UCHAR reserved3[1];
143 ULONG flags;
144 GEN_ADDR reset_reg;
145 UCHAR reset_val;
146 UCHAR reserved4[3];
147 PHYSICAL_ADDRESS x_firmware_ctrl;
148 PHYSICAL_ADDRESS x_dsdt;
149 GEN_ADDR x_pm1a_evt_blk;
150 GEN_ADDR x_pm1b_evt_blk;
151 GEN_ADDR x_pm1a_ctrl_blk;
152 GEN_ADDR x_pm1b_ctrl_blk;
153 GEN_ADDR x_pm2_ctrl_blk;
154 GEN_ADDR x_pm_tmr_blk;
155 GEN_ADDR x_gp0_blk;
156 GEN_ADDR x_gp1_blk;
157 } FADT;
158 typedef FADT *PFADT;
159
160 typedef struct _DSDT
161 {
162 DESCRIPTION_HEADER Header;
163 UCHAR DiffDefBlock[ANYSIZE_ARRAY];
164 } DSDT;
165 typedef DSDT *PDSDT;
166
167 typedef struct _RSDT
168 {
169 DESCRIPTION_HEADER Header;
170 ULONG Tables[ANYSIZE_ARRAY];
171 } RSDT;
172 typedef RSDT *PRSDT;
173
174 typedef struct _XSDT
175 {
176 DESCRIPTION_HEADER Header;
177 PHYSICAL_ADDRESS Tables[ANYSIZE_ARRAY];
178 } XSDT;
179 typedef XSDT *PXSDT;
180 #include <poppack.h>
181
182 //
183 // Microsoft-specific (pretty much) ACPI Tables, normal MS ABI packing
184 //
185 typedef struct _DEBUG_PORT_TABLE
186 {
187 DESCRIPTION_HEADER Header;
188 UCHAR InterfaceType;
189 UCHAR Reserved[3];
190 GEN_ADDR BaseAddress;
191 } DEBUG_PORT_TABLE, *PDEBUG_PORT_TABLE;
192
193 typedef struct _WATCHDOG_TABLE
194 {
195 DESCRIPTION_HEADER Header;
196 GEN_ADDR ControlRegister;
197 GEN_ADDR CountRegister;
198 USHORT PciDeviceId;
199 USHORT PciVendorId;
200 UCHAR PciBus;
201 UCHAR PciDevice;
202 UCHAR PciFunction;
203 UCHAR PciSegment;
204 USHORT MaxCount;
205 UCHAR Units;
206 } WATCHDOG_TABLE, *PWATCHDOG_TABLE;
207
208 typedef struct _BOOT_TABLE
209 {
210 DESCRIPTION_HEADER Header;
211 UCHAR CMOSIndex;
212 UCHAR Reserved[3];
213 } BOOT_TABLE, *PBOOT_TABLE;
214
215 typedef struct _ACPI_SRAT
216 {
217 DESCRIPTION_HEADER Header;
218 UCHAR TableRevision;
219 ULONG Reserved[2];
220 } ACPI_SRAT, *PACPI_SRAT;
221
222 /* EOF */