]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Acpi10.h
remove un-necessary #pragma pack(1) and clean up doxgen format.
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Acpi10.h
1 /** @file
2 ACPI 1.0b definitions from the ACPI Specification, revision 1.0b
3
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13
14 #ifndef _ACPI_1_0_H_
15 #define _ACPI_1_0_H_
16
17 ///
18 /// Common table header, this prefaces all ACPI tables, including FACS, but
19 /// excluding the RSD PTR structure
20 ///
21 typedef struct {
22 UINT32 Signature;
23 UINT32 Length;
24 } EFI_ACPI_COMMON_HEADER;
25
26 ///
27 /// Common ACPI description table header. This structure prefaces most ACPI tables.
28 ///
29 typedef struct {
30 UINT32 Signature;
31 UINT32 Length;
32 UINT8 Revision;
33 UINT8 Checksum;
34 UINT8 OemId[6];
35 UINT64 OemTableId;
36 UINT32 OemRevision;
37 UINT32 CreatorId;
38 UINT32 CreatorRevision;
39 } EFI_ACPI_DESCRIPTION_HEADER;
40
41 //
42 // Define for Desriptor
43 //
44 #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A
45 #define ACPI_END_TAG_DESCRIPTOR 0x79
46
47 //
48 // Resource Type
49 //
50 #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00
51 #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01
52 #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02
53
54 ///
55 /// Power Management Timer frequency is fixed at 3.579545MHz
56 ///
57 #define ACPI_TIMER_FREQUENCY 3579545
58
59 //
60 // Ensure proper structure formats
61 //
62 #pragma pack(1)
63
64 ///
65 /// The commond definition of QWORD, DWORD, and WORD
66 /// Address Space Descriptors
67 ///
68 typedef struct {
69 UINT8 Desc;
70 UINT16 Len;
71 UINT8 ResType;
72 UINT8 GenFlag;
73 UINT8 SpecificFlag;
74 UINT64 AddrSpaceGranularity;
75 UINT64 AddrRangeMin;
76 UINT64 AddrRangeMax;
77 UINT64 AddrTranslationOffset;
78 UINT64 AddrLen;
79 } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR;
80
81 #pragma pack()
82
83 typedef struct {
84 UINT8 Desc;
85 UINT8 Checksum;
86 } EFI_ACPI_END_TAG_DESCRIPTOR;
87
88 //
89 // General use definitions
90 //
91 #define EFI_ACPI_RESERVED_BYTE 0x00
92 #define EFI_ACPI_RESERVED_WORD 0x0000
93 #define EFI_ACPI_RESERVED_DWORD 0x00000000
94 #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000
95
96 //
97 // Resource Type Specific Flags
98 // Ref ACPI specification 6.4.3.5.5
99 //
100 // Bit [0] : Write Status, _RW
101 //
102 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0)
103 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0)
104 //
105 // Bit [2:1] : Memory Attributes, _MEM
106 //
107 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1)
108 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1)
109 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1)
110 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1)
111 //
112 // Bit [4:3] : Memory Attributes, _MTP
113 //
114 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3)
115 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3)
116 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3)
117 #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3)
118 //
119 // Bit [5] : Memory to I/O Translation, _TTP
120 //
121 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5)
122 #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5)
123
124 //
125 // ACPI 1.0b table structures
126 //
127
128 ///
129 /// Root System Description Pointer Structure
130 ///
131 typedef struct {
132 UINT64 Signature;
133 UINT8 Checksum;
134 UINT8 OemId[6];
135 UINT8 Reserved;
136 UINT32 RsdtAddress;
137 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;
138
139 //
140 // Root System Description Table
141 // No definition needed as it is a common description table header, the same with
142 // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers.
143 //
144
145 ///
146 /// RSDT Revision (as defined in ACPI 1.0b spec.)
147 ///
148 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01
149
150 ///
151 /// Fixed ACPI Description Table Structure (FADT)
152 ///
153 typedef struct {
154 EFI_ACPI_DESCRIPTION_HEADER Header;
155 UINT32 FirmwareCtrl;
156 UINT32 Dsdt;
157 UINT8 IntModel;
158 UINT8 Reserved1;
159 UINT16 SciInt;
160 UINT32 SmiCmd;
161 UINT8 AcpiEnable;
162 UINT8 AcpiDisable;
163 UINT8 S4BiosReq;
164 UINT8 Reserved2;
165 UINT32 Pm1aEvtBlk;
166 UINT32 Pm1bEvtBlk;
167 UINT32 Pm1aCntBlk;
168 UINT32 Pm1bCntBlk;
169 UINT32 Pm2CntBlk;
170 UINT32 PmTmrBlk;
171 UINT32 Gpe0Blk;
172 UINT32 Gpe1Blk;
173 UINT8 Pm1EvtLen;
174 UINT8 Pm1CntLen;
175 UINT8 Pm2CntLen;
176 UINT8 PmTmLen;
177 UINT8 Gpe0BlkLen;
178 UINT8 Gpe1BlkLen;
179 UINT8 Gpe1Base;
180 UINT8 Reserved3;
181 UINT16 PLvl2Lat;
182 UINT16 PLvl3Lat;
183 UINT16 FlushSize;
184 UINT16 FlushStride;
185 UINT8 DutyOffset;
186 UINT8 DutyWidth;
187 UINT8 DayAlrm;
188 UINT8 MonAlrm;
189 UINT8 Century;
190 UINT8 Reserved4;
191 UINT8 Reserved5;
192 UINT8 Reserved6;
193 UINT32 Flags;
194 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;
195
196 ///
197 /// FADT Version (as defined in ACPI 1.0b spec.)
198 ///
199 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01
200
201 //
202 // Fixed ACPI Description Table Fixed Feature Flags
203 // All other bits are reserved and must be set to 0.
204 //
205 #define EFI_ACPI_1_0_WBINVD BIT0
206 #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1
207 #define EFI_ACPI_1_0_PROC_C1 BIT2
208 #define EFI_ACPI_1_0_P_LVL2_UP BIT3
209 #define EFI_ACPI_1_0_PWR_BUTTON BIT4
210 #define EFI_ACPI_1_0_SLP_BUTTON BIT5
211 #define EFI_ACPI_1_0_FIX_RTC BIT6
212 #define EFI_ACPI_1_0_RTC_S4 BIT7
213 #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8
214 #define EFI_ACPI_1_0_DCK_CAP BIT9
215
216 ///
217 /// Firmware ACPI Control Structure
218 ///
219 typedef struct {
220 UINT32 Signature;
221 UINT32 Length;
222 UINT32 HardwareSignature;
223 UINT32 FirmwareWakingVector;
224 UINT32 GlobalLock;
225 UINT32 Flags;
226 UINT8 Reserved[40];
227 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;
228
229 ///
230 /// Firmware Control Structure Feature Flags
231 /// All other bits are reserved and must be set to 0.
232 ///
233 #define EFI_ACPI_1_0_S4BIOS_F BIT0
234
235 ///
236 /// Multiple APIC Description Table header definition. The rest of the table
237 /// must be defined in a platform specific manner.
238 ///
239 typedef struct {
240 EFI_ACPI_DESCRIPTION_HEADER Header;
241 UINT32 LocalApicAddress;
242 UINT32 Flags;
243 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;
244
245 ///
246 /// MADT Revision (as defined in ACPI 1.0b spec.)
247 ///
248 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01
249
250 ///
251 /// Multiple APIC Flags
252 /// All other bits are reserved and must be set to 0.
253 ///
254 #define EFI_ACPI_1_0_PCAT_COMPAT BIT0
255
256 //
257 // Multiple APIC Description Table APIC structure types
258 // All other values between 0x05 an 0xFF are reserved and
259 // will be ignored by OSPM.
260 //
261 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00
262 #define EFI_ACPI_1_0_IO_APIC 0x01
263 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02
264 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03
265 #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04
266
267 //
268 // APIC Structure Definitions
269 //
270
271 ///
272 /// Processor Local APIC Structure Definition
273 ///
274 typedef struct {
275 UINT8 Type;
276 UINT8 Length;
277 UINT8 AcpiProcessorId;
278 UINT8 ApicId;
279 UINT32 Flags;
280 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;
281
282 ///
283 /// Local APIC Flags. All other bits are reserved and must be 0.
284 ///
285 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0
286
287 ///
288 /// IO APIC Structure
289 ///
290 typedef struct {
291 UINT8 Type;
292 UINT8 Length;
293 UINT8 IoApicId;
294 UINT8 Reserved;
295 UINT32 IoApicAddress;
296 UINT32 SystemVectorBase;
297 } EFI_ACPI_1_0_IO_APIC_STRUCTURE;
298
299 ///
300 /// Interrupt Source Override Structure
301 ///
302 typedef struct {
303 UINT8 Type;
304 UINT8 Length;
305 UINT8 Bus;
306 UINT8 Source;
307 UINT32 GlobalSystemInterruptVector;
308 UINT16 Flags;
309 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;
310
311 ///
312 /// Non-Maskable Interrupt Source Structure
313 ///
314 typedef struct {
315 UINT8 Type;
316 UINT8 Length;
317 UINT16 Flags;
318 UINT32 GlobalSystemInterruptVector;
319 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;
320
321 //
322 // Ensure proper structure formats
323 //
324 #pragma pack(1)
325
326 ///
327 /// Local APIC NMI Structure
328 ///
329 typedef struct {
330 UINT8 Type;
331 UINT8 Length;
332 UINT8 AcpiProcessorId;
333 UINT16 Flags;
334 UINT8 LocalApicInti;
335 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;
336
337 #pragma pack()
338
339 ///
340 /// Smart Battery Description Table (SBST)
341 ///
342 typedef struct {
343 EFI_ACPI_DESCRIPTION_HEADER Header;
344 UINT32 WarningEnergyLevel;
345 UINT32 LowEnergyLevel;
346 UINT32 CriticalEnergyLevel;
347 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;
348
349 //
350 // Known table signatures
351 //
352
353 ///
354 /// "RSD PTR " Root System Description Pointer
355 ///
356 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ')
357
358 ///
359 /// "APIC" Multiple APIC Description Table
360 ///
361 #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C')
362
363 ///
364 /// "DSDT" Differentiated System Description Table
365 ///
366 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T')
367
368 ///
369 /// "FACS" Firmware ACPI Control Structure
370 ///
371 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S')
372
373 ///
374 /// "FACP" Fixed ACPI Description Table
375 ///
376 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P')
377
378 ///
379 /// "PSDT" Persistent System Description Table
380 ///
381 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T')
382
383 ///
384 /// "RSDT" Root System Description Table
385 ///
386 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T')
387
388 ///
389 /// "SBST" Smart Battery Specification Table
390 ///
391 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T')
392
393 ///
394 /// "SSDT" Secondary System Description Table
395 ///
396 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T')
397
398 #endif