Jonathan Zhang | 6d27778 | 2020-06-09 17:56:53 -0700 | [diff] [blame] | 1 | /** @file |
| 2 | ACPI 1.0b definitions from the ACPI Specification, revision 1.0b |
| 3 | |
| 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR> |
| 5 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | **/ |
| 7 | |
| 8 | #ifndef _ACPI_1_0_H_ |
| 9 | #define _ACPI_1_0_H_ |
| 10 | |
| 11 | #include <IndustryStandard/AcpiAml.h> |
| 12 | |
| 13 | /// |
| 14 | /// Common table header, this prefaces all ACPI tables, including FACS, but |
| 15 | /// excluding the RSD PTR structure. |
| 16 | /// |
| 17 | typedef struct { |
| 18 | UINT32 Signature; |
| 19 | UINT32 Length; |
| 20 | } EFI_ACPI_COMMON_HEADER; |
| 21 | |
| 22 | #pragma pack(1) |
| 23 | /// |
| 24 | /// The common ACPI description table header. This structure prefaces most ACPI tables. |
| 25 | /// |
| 26 | typedef struct { |
| 27 | UINT32 Signature; |
| 28 | UINT32 Length; |
| 29 | UINT8 Revision; |
| 30 | UINT8 Checksum; |
| 31 | UINT8 OemId[6]; |
| 32 | UINT64 OemTableId; |
| 33 | UINT32 OemRevision; |
| 34 | UINT32 CreatorId; |
| 35 | UINT32 CreatorRevision; |
| 36 | } EFI_ACPI_DESCRIPTION_HEADER; |
| 37 | #pragma pack() |
| 38 | |
| 39 | // |
| 40 | // Define for Descriptor |
| 41 | // |
| 42 | #define ACPI_SMALL_ITEM_FLAG 0x00 |
| 43 | #define ACPI_LARGE_ITEM_FLAG 0x01 |
| 44 | |
| 45 | // |
| 46 | // Small Item Descriptor Name |
| 47 | // |
| 48 | #define ACPI_SMALL_IRQ_DESCRIPTOR_NAME 0x04 |
| 49 | #define ACPI_SMALL_DMA_DESCRIPTOR_NAME 0x05 |
| 50 | #define ACPI_SMALL_START_DEPENDENT_DESCRIPTOR_NAME 0x06 |
| 51 | #define ACPI_SMALL_END_DEPENDENT_DESCRIPTOR_NAME 0x07 |
| 52 | #define ACPI_SMALL_IO_PORT_DESCRIPTOR_NAME 0x08 |
| 53 | #define ACPI_SMALL_FIXED_IO_PORT_DESCRIPTOR_NAME 0x09 |
| 54 | #define ACPI_SMALL_VENDOR_DEFINED_DESCRIPTOR_NAME 0x0E |
| 55 | #define ACPI_SMALL_END_TAG_DESCRIPTOR_NAME 0x0F |
| 56 | |
| 57 | // |
| 58 | // Large Item Descriptor Name |
| 59 | // |
| 60 | #define ACPI_LARGE_24_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x01 |
| 61 | #define ACPI_LARGE_VENDOR_DEFINED_DESCRIPTOR_NAME 0x04 |
| 62 | #define ACPI_LARGE_32_BIT_MEMORY_RANGE_DESCRIPTOR_NAME 0x05 |
| 63 | #define ACPI_LARGE_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR_NAME 0x06 |
| 64 | #define ACPI_LARGE_DWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x07 |
| 65 | #define ACPI_LARGE_WORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x08 |
| 66 | #define ACPI_LARGE_EXTENDED_IRQ_DESCRIPTOR_NAME 0x09 |
| 67 | #define ACPI_LARGE_QWORD_ADDRESS_SPACE_DESCRIPTOR_NAME 0x0A |
| 68 | |
| 69 | // |
| 70 | // Small Item Descriptor Value |
| 71 | // |
| 72 | #define ACPI_IRQ_NOFLAG_DESCRIPTOR 0x22 |
| 73 | #define ACPI_IRQ_DESCRIPTOR 0x23 |
| 74 | #define ACPI_DMA_DESCRIPTOR 0x2A |
| 75 | #define ACPI_START_DEPENDENT_DESCRIPTOR 0x30 |
| 76 | #define ACPI_START_DEPENDENT_EX_DESCRIPTOR 0x31 |
| 77 | #define ACPI_END_DEPENDENT_DESCRIPTOR 0x38 |
| 78 | #define ACPI_IO_PORT_DESCRIPTOR 0x47 |
| 79 | #define ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR 0x4B |
| 80 | #define ACPI_END_TAG_DESCRIPTOR 0x79 |
| 81 | |
| 82 | // |
| 83 | // Large Item Descriptor Value |
| 84 | // |
| 85 | #define ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR 0x81 |
| 86 | #define ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR 0x85 |
| 87 | #define ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR 0x86 |
| 88 | #define ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR 0x87 |
| 89 | #define ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR 0x88 |
| 90 | #define ACPI_EXTENDED_INTERRUPT_DESCRIPTOR 0x89 |
| 91 | #define ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR 0x8A |
| 92 | #define ACPI_ADDRESS_SPACE_DESCRIPTOR 0x8A |
| 93 | |
| 94 | // |
| 95 | // Resource Type |
| 96 | // |
| 97 | #define ACPI_ADDRESS_SPACE_TYPE_MEM 0x00 |
| 98 | #define ACPI_ADDRESS_SPACE_TYPE_IO 0x01 |
| 99 | #define ACPI_ADDRESS_SPACE_TYPE_BUS 0x02 |
| 100 | |
| 101 | /// |
| 102 | /// Power Management Timer frequency is fixed at 3.579545MHz. |
| 103 | /// |
| 104 | #define ACPI_TIMER_FREQUENCY 3579545 |
| 105 | |
| 106 | // |
| 107 | // Ensure proper structure formats |
| 108 | // |
| 109 | #pragma pack(1) |
| 110 | |
| 111 | /// |
| 112 | /// The common definition of QWORD, DWORD, and WORD |
| 113 | /// Address Space Descriptors. |
| 114 | /// |
| 115 | typedef PACKED struct { |
| 116 | UINT8 Desc; |
| 117 | UINT16 Len; |
| 118 | UINT8 ResType; |
| 119 | UINT8 GenFlag; |
| 120 | UINT8 SpecificFlag; |
| 121 | UINT64 AddrSpaceGranularity; |
| 122 | UINT64 AddrRangeMin; |
| 123 | UINT64 AddrRangeMax; |
| 124 | UINT64 AddrTranslationOffset; |
| 125 | UINT64 AddrLen; |
| 126 | } EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR; |
| 127 | |
| 128 | typedef PACKED union { |
| 129 | UINT8 Byte; |
| 130 | PACKED struct { |
| 131 | UINT8 Length : 3; |
| 132 | UINT8 Name : 4; |
| 133 | UINT8 Type : 1; |
| 134 | } Bits; |
| 135 | } ACPI_SMALL_RESOURCE_HEADER; |
| 136 | |
| 137 | typedef PACKED struct { |
| 138 | PACKED union { |
| 139 | UINT8 Byte; |
| 140 | PACKED struct { |
| 141 | UINT8 Name : 7; |
| 142 | UINT8 Type : 1; |
| 143 | }Bits; |
| 144 | } Header; |
| 145 | UINT16 Length; |
| 146 | } ACPI_LARGE_RESOURCE_HEADER; |
| 147 | |
| 148 | /// |
| 149 | /// IRQ Descriptor. |
| 150 | /// |
| 151 | typedef PACKED struct { |
| 152 | ACPI_SMALL_RESOURCE_HEADER Header; |
| 153 | UINT16 Mask; |
| 154 | } EFI_ACPI_IRQ_NOFLAG_DESCRIPTOR; |
| 155 | |
| 156 | /// |
| 157 | /// IRQ Descriptor. |
| 158 | /// |
| 159 | typedef PACKED struct { |
| 160 | ACPI_SMALL_RESOURCE_HEADER Header; |
| 161 | UINT16 Mask; |
| 162 | UINT8 Information; |
| 163 | } EFI_ACPI_IRQ_DESCRIPTOR; |
| 164 | |
| 165 | /// |
| 166 | /// DMA Descriptor. |
| 167 | /// |
| 168 | typedef PACKED struct { |
| 169 | ACPI_SMALL_RESOURCE_HEADER Header; |
| 170 | UINT8 ChannelMask; |
| 171 | UINT8 Information; |
| 172 | } EFI_ACPI_DMA_DESCRIPTOR; |
| 173 | |
| 174 | /// |
| 175 | /// I/O Port Descriptor |
| 176 | /// |
| 177 | typedef PACKED struct { |
| 178 | ACPI_SMALL_RESOURCE_HEADER Header; |
| 179 | UINT8 Information; |
| 180 | UINT16 BaseAddressMin; |
| 181 | UINT16 BaseAddressMax; |
| 182 | UINT8 Alignment; |
| 183 | UINT8 Length; |
| 184 | } EFI_ACPI_IO_PORT_DESCRIPTOR; |
| 185 | |
| 186 | /// |
| 187 | /// Fixed Location I/O Port Descriptor. |
| 188 | /// |
| 189 | typedef PACKED struct { |
| 190 | ACPI_SMALL_RESOURCE_HEADER Header; |
| 191 | UINT16 BaseAddress; |
| 192 | UINT8 Length; |
| 193 | } EFI_ACPI_FIXED_LOCATION_IO_PORT_DESCRIPTOR; |
| 194 | |
| 195 | /// |
| 196 | /// 24-Bit Memory Range Descriptor |
| 197 | /// |
| 198 | typedef PACKED struct { |
| 199 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 200 | UINT8 Information; |
| 201 | UINT16 BaseAddressMin; |
| 202 | UINT16 BaseAddressMax; |
| 203 | UINT16 Alignment; |
| 204 | UINT16 Length; |
| 205 | } EFI_ACPI_24_BIT_MEMORY_RANGE_DESCRIPTOR; |
| 206 | |
| 207 | /// |
| 208 | /// 32-Bit Memory Range Descriptor |
| 209 | /// |
| 210 | typedef PACKED struct { |
| 211 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 212 | UINT8 Information; |
| 213 | UINT32 BaseAddressMin; |
| 214 | UINT32 BaseAddressMax; |
| 215 | UINT32 Alignment; |
| 216 | UINT32 Length; |
| 217 | } EFI_ACPI_32_BIT_MEMORY_RANGE_DESCRIPTOR; |
| 218 | |
| 219 | /// |
| 220 | /// Fixed 32-Bit Fixed Memory Range Descriptor |
| 221 | /// |
| 222 | typedef PACKED struct { |
| 223 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 224 | UINT8 Information; |
| 225 | UINT32 BaseAddress; |
| 226 | UINT32 Length; |
| 227 | } EFI_ACPI_32_BIT_FIXED_MEMORY_RANGE_DESCRIPTOR; |
| 228 | |
| 229 | /// |
| 230 | /// QWORD Address Space Descriptor |
| 231 | /// |
| 232 | typedef PACKED struct { |
| 233 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 234 | UINT8 ResType; |
| 235 | UINT8 GenFlag; |
| 236 | UINT8 SpecificFlag; |
| 237 | UINT64 AddrSpaceGranularity; |
| 238 | UINT64 AddrRangeMin; |
| 239 | UINT64 AddrRangeMax; |
| 240 | UINT64 AddrTranslationOffset; |
| 241 | UINT64 AddrLen; |
| 242 | } EFI_ACPI_QWORD_ADDRESS_SPACE_DESCRIPTOR; |
| 243 | |
| 244 | /// |
| 245 | /// DWORD Address Space Descriptor |
| 246 | /// |
| 247 | typedef PACKED struct { |
| 248 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 249 | UINT8 ResType; |
| 250 | UINT8 GenFlag; |
| 251 | UINT8 SpecificFlag; |
| 252 | UINT32 AddrSpaceGranularity; |
| 253 | UINT32 AddrRangeMin; |
| 254 | UINT32 AddrRangeMax; |
| 255 | UINT32 AddrTranslationOffset; |
| 256 | UINT32 AddrLen; |
| 257 | } EFI_ACPI_DWORD_ADDRESS_SPACE_DESCRIPTOR; |
| 258 | |
| 259 | /// |
| 260 | /// WORD Address Space Descriptor |
| 261 | /// |
| 262 | typedef PACKED struct { |
| 263 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 264 | UINT8 ResType; |
| 265 | UINT8 GenFlag; |
| 266 | UINT8 SpecificFlag; |
| 267 | UINT16 AddrSpaceGranularity; |
| 268 | UINT16 AddrRangeMin; |
| 269 | UINT16 AddrRangeMax; |
| 270 | UINT16 AddrTranslationOffset; |
| 271 | UINT16 AddrLen; |
| 272 | } EFI_ACPI_WORD_ADDRESS_SPACE_DESCRIPTOR; |
| 273 | |
| 274 | /// |
| 275 | /// Extended Interrupt Descriptor |
| 276 | /// |
| 277 | typedef PACKED struct { |
| 278 | ACPI_LARGE_RESOURCE_HEADER Header; |
| 279 | UINT8 InterruptVectorFlags; |
| 280 | UINT8 InterruptTableLength; |
| 281 | UINT32 InterruptNumber[1]; |
| 282 | } EFI_ACPI_EXTENDED_INTERRUPT_DESCRIPTOR; |
| 283 | |
| 284 | #pragma pack() |
| 285 | |
| 286 | /// |
| 287 | /// The End tag identifies an end of resource data. |
| 288 | /// |
| 289 | typedef struct { |
| 290 | UINT8 Desc; |
| 291 | UINT8 Checksum; |
| 292 | } EFI_ACPI_END_TAG_DESCRIPTOR; |
| 293 | |
| 294 | // |
| 295 | // General use definitions |
| 296 | // |
| 297 | #define EFI_ACPI_RESERVED_BYTE 0x00 |
| 298 | #define EFI_ACPI_RESERVED_WORD 0x0000 |
| 299 | #define EFI_ACPI_RESERVED_DWORD 0x00000000 |
| 300 | #define EFI_ACPI_RESERVED_QWORD 0x0000000000000000 |
| 301 | |
| 302 | // |
| 303 | // Resource Type Specific Flags |
| 304 | // Ref ACPI specification 6.4.3.5.5 |
| 305 | // |
| 306 | // Bit [0] : Write Status, _RW |
| 307 | // |
| 308 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_WRITE (1 << 0) |
| 309 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_READ_ONLY (0 << 0) |
| 310 | // |
| 311 | // Bit [2:1] : Memory Attributes, _MEM |
| 312 | // |
| 313 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_NON_CACHEABLE (0 << 1) |
| 314 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE (1 << 1) |
| 315 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_WRITE_COMBINING (2 << 1) |
| 316 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_CACHEABLE_PREFETCHABLE (3 << 1) |
| 317 | // |
| 318 | // Bit [4:3] : Memory Attributes, _MTP |
| 319 | // |
| 320 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_MEMORY (0 << 3) |
| 321 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_RESERVED (1 << 3) |
| 322 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_ACPI (2 << 3) |
| 323 | #define EFI_APCI_MEMORY_RESOURCE_SPECIFIC_FLAG_ADDRESS_RANGE_NVS (3 << 3) |
| 324 | // |
| 325 | // Bit [5] : Memory to I/O Translation, _TTP |
| 326 | // |
| 327 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_TRANSLATION (1 << 5) |
| 328 | #define EFI_ACPI_MEMORY_RESOURCE_SPECIFIC_FLAG_TYPE_STATIC (0 << 5) |
| 329 | |
| 330 | // |
| 331 | // IRQ Information |
| 332 | // Ref ACPI specification 6.4.2.1 |
| 333 | // |
| 334 | #define EFI_ACPI_IRQ_SHARABLE_MASK 0x10 |
| 335 | #define EFI_ACPI_IRQ_SHARABLE 0x10 |
| 336 | |
| 337 | #define EFI_ACPI_IRQ_POLARITY_MASK 0x08 |
| 338 | #define EFI_ACPI_IRQ_HIGH_TRUE 0x00 |
| 339 | #define EFI_ACPI_IRQ_LOW_FALSE 0x08 |
| 340 | |
| 341 | #define EFI_ACPI_IRQ_MODE 0x01 |
| 342 | #define EFI_ACPI_IRQ_LEVEL_TRIGGERED 0x00 |
| 343 | #define EFI_ACPI_IRQ_EDGE_TRIGGERED 0x01 |
| 344 | |
| 345 | // |
| 346 | // DMA Information |
| 347 | // Ref ACPI specification 6.4.2.2 |
| 348 | // |
| 349 | #define EFI_ACPI_DMA_SPEED_TYPE_MASK 0x60 |
| 350 | #define EFI_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00 |
| 351 | #define EFI_ACPI_DMA_SPEED_TYPE_A 0x20 |
| 352 | #define EFI_ACPI_DMA_SPEED_TYPE_B 0x40 |
| 353 | #define EFI_ACPI_DMA_SPEED_TYPE_F 0x60 |
| 354 | |
| 355 | #define EFI_ACPI_DMA_BUS_MASTER_MASK 0x04 |
| 356 | #define EFI_ACPI_DMA_BUS_MASTER 0x04 |
| 357 | |
| 358 | #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03 |
| 359 | #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00 |
| 360 | #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01 |
| 361 | #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10 |
| 362 | |
| 363 | // |
| 364 | // IO Information |
| 365 | // Ref ACPI specification 6.4.2.5 |
| 366 | // |
| 367 | #define EFI_ACPI_IO_DECODE_MASK 0x01 |
| 368 | #define EFI_ACPI_IO_DECODE_16_BIT 0x01 |
| 369 | #define EFI_ACPI_IO_DECODE_10_BIT 0x00 |
| 370 | |
| 371 | // |
| 372 | // Memory Information |
| 373 | // Ref ACPI specification 6.4.3.4 |
| 374 | // |
| 375 | #define EFI_ACPI_MEMORY_WRITE_STATUS_MASK 0x01 |
| 376 | #define EFI_ACPI_MEMORY_WRITABLE 0x01 |
| 377 | #define EFI_ACPI_MEMORY_NON_WRITABLE 0x00 |
| 378 | |
| 379 | // |
| 380 | // Ensure proper structure formats |
| 381 | // |
| 382 | #pragma pack(1) |
| 383 | // |
| 384 | // ACPI 1.0b table structures |
| 385 | // |
| 386 | |
| 387 | /// |
| 388 | /// Root System Description Pointer Structure. |
| 389 | /// |
| 390 | typedef struct { |
| 391 | UINT64 Signature; |
| 392 | UINT8 Checksum; |
| 393 | UINT8 OemId[6]; |
| 394 | UINT8 Reserved; |
| 395 | UINT32 RsdtAddress; |
| 396 | } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER; |
| 397 | |
| 398 | // |
| 399 | // Root System Description Table |
| 400 | // No definition needed as it is a common description table header, the same with |
| 401 | // EFI_ACPI_DESCRIPTION_HEADER, followed by a variable number of UINT32 table pointers. |
| 402 | // |
| 403 | |
| 404 | /// |
| 405 | /// RSDT Revision (as defined in ACPI 1.0b specification). |
| 406 | /// |
| 407 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01 |
| 408 | |
| 409 | /// |
| 410 | /// Fixed ACPI Description Table Structure (FADT). |
| 411 | /// |
| 412 | typedef struct { |
| 413 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 414 | UINT32 FirmwareCtrl; |
| 415 | UINT32 Dsdt; |
| 416 | UINT8 IntModel; |
| 417 | UINT8 Reserved1; |
| 418 | UINT16 SciInt; |
| 419 | UINT32 SmiCmd; |
| 420 | UINT8 AcpiEnable; |
| 421 | UINT8 AcpiDisable; |
| 422 | UINT8 S4BiosReq; |
| 423 | UINT8 Reserved2; |
| 424 | UINT32 Pm1aEvtBlk; |
| 425 | UINT32 Pm1bEvtBlk; |
| 426 | UINT32 Pm1aCntBlk; |
| 427 | UINT32 Pm1bCntBlk; |
| 428 | UINT32 Pm2CntBlk; |
| 429 | UINT32 PmTmrBlk; |
| 430 | UINT32 Gpe0Blk; |
| 431 | UINT32 Gpe1Blk; |
| 432 | UINT8 Pm1EvtLen; |
| 433 | UINT8 Pm1CntLen; |
| 434 | UINT8 Pm2CntLen; |
| 435 | UINT8 PmTmLen; |
| 436 | UINT8 Gpe0BlkLen; |
| 437 | UINT8 Gpe1BlkLen; |
| 438 | UINT8 Gpe1Base; |
| 439 | UINT8 Reserved3; |
| 440 | UINT16 PLvl2Lat; |
| 441 | UINT16 PLvl3Lat; |
| 442 | UINT16 FlushSize; |
| 443 | UINT16 FlushStride; |
| 444 | UINT8 DutyOffset; |
| 445 | UINT8 DutyWidth; |
| 446 | UINT8 DayAlrm; |
| 447 | UINT8 MonAlrm; |
| 448 | UINT8 Century; |
| 449 | UINT8 Reserved4; |
| 450 | UINT8 Reserved5; |
| 451 | UINT8 Reserved6; |
| 452 | UINT32 Flags; |
| 453 | } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE; |
| 454 | |
| 455 | /// |
| 456 | /// FADT Version (as defined in ACPI 1.0b specification). |
| 457 | /// |
| 458 | #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION 0x01 |
| 459 | |
| 460 | #define EFI_ACPI_1_0_INT_MODE_DUAL_PIC 0 |
| 461 | #define EFI_ACPI_1_0_INT_MODE_MULTIPLE_APIC 1 |
| 462 | |
| 463 | // |
| 464 | // Fixed ACPI Description Table Fixed Feature Flags |
| 465 | // All other bits are reserved and must be set to 0. |
| 466 | // |
| 467 | #define EFI_ACPI_1_0_WBINVD BIT0 |
| 468 | #define EFI_ACPI_1_0_WBINVD_FLUSH BIT1 |
| 469 | #define EFI_ACPI_1_0_PROC_C1 BIT2 |
| 470 | #define EFI_ACPI_1_0_P_LVL2_UP BIT3 |
| 471 | #define EFI_ACPI_1_0_PWR_BUTTON BIT4 |
| 472 | #define EFI_ACPI_1_0_SLP_BUTTON BIT5 |
| 473 | #define EFI_ACPI_1_0_FIX_RTC BIT6 |
| 474 | #define EFI_ACPI_1_0_RTC_S4 BIT7 |
| 475 | #define EFI_ACPI_1_0_TMR_VAL_EXT BIT8 |
| 476 | #define EFI_ACPI_1_0_DCK_CAP BIT9 |
| 477 | |
| 478 | /// |
| 479 | /// Firmware ACPI Control Structure. |
| 480 | /// |
| 481 | typedef struct { |
| 482 | UINT32 Signature; |
| 483 | UINT32 Length; |
| 484 | UINT32 HardwareSignature; |
| 485 | UINT32 FirmwareWakingVector; |
| 486 | UINT32 GlobalLock; |
| 487 | UINT32 Flags; |
| 488 | UINT8 Reserved[40]; |
| 489 | } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE; |
| 490 | |
| 491 | /// |
| 492 | /// Firmware Control Structure Feature Flags. |
| 493 | /// All other bits are reserved and must be set to 0. |
| 494 | /// |
| 495 | #define EFI_ACPI_1_0_S4BIOS_F BIT0 |
| 496 | |
| 497 | /// |
| 498 | /// Multiple APIC Description Table header definition. The rest of the table |
| 499 | /// must be defined in a platform-specific manner. |
| 500 | /// |
| 501 | typedef struct { |
| 502 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 503 | UINT32 LocalApicAddress; |
| 504 | UINT32 Flags; |
| 505 | } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER; |
| 506 | |
| 507 | /// |
| 508 | /// MADT Revision (as defined in ACPI 1.0b specification). |
| 509 | /// |
| 510 | #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01 |
| 511 | |
| 512 | /// |
| 513 | /// Multiple APIC Flags |
| 514 | /// All other bits are reserved and must be set to 0. |
| 515 | /// |
| 516 | #define EFI_ACPI_1_0_PCAT_COMPAT BIT0 |
| 517 | |
| 518 | // |
| 519 | // Multiple APIC Description Table APIC structure types |
| 520 | // All other values between 0x05 an 0xFF are reserved and |
| 521 | // will be ignored by OSPM. |
| 522 | // |
| 523 | #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC 0x00 |
| 524 | #define EFI_ACPI_1_0_IO_APIC 0x01 |
| 525 | #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE 0x02 |
| 526 | #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE 0x03 |
| 527 | #define EFI_ACPI_1_0_LOCAL_APIC_NMI 0x04 |
| 528 | |
| 529 | // |
| 530 | // APIC Structure Definitions |
| 531 | // |
| 532 | |
| 533 | /// |
| 534 | /// Processor Local APIC Structure Definition. |
| 535 | /// |
| 536 | typedef struct { |
| 537 | UINT8 Type; |
| 538 | UINT8 Length; |
| 539 | UINT8 AcpiProcessorId; |
| 540 | UINT8 ApicId; |
| 541 | UINT32 Flags; |
| 542 | } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE; |
| 543 | |
| 544 | /// |
| 545 | /// Local APIC Flags. All other bits are reserved and must be 0. |
| 546 | /// |
| 547 | #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED BIT0 |
| 548 | |
| 549 | /// |
| 550 | /// IO APIC Structure. |
| 551 | /// |
| 552 | typedef struct { |
| 553 | UINT8 Type; |
| 554 | UINT8 Length; |
| 555 | UINT8 IoApicId; |
| 556 | UINT8 Reserved; |
| 557 | UINT32 IoApicAddress; |
| 558 | UINT32 SystemVectorBase; |
| 559 | } EFI_ACPI_1_0_IO_APIC_STRUCTURE; |
| 560 | |
| 561 | /// |
| 562 | /// Interrupt Source Override Structure. |
| 563 | /// |
| 564 | typedef struct { |
| 565 | UINT8 Type; |
| 566 | UINT8 Length; |
| 567 | UINT8 Bus; |
| 568 | UINT8 Source; |
| 569 | UINT32 GlobalSystemInterruptVector; |
| 570 | UINT16 Flags; |
| 571 | } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE; |
| 572 | |
| 573 | /// |
| 574 | /// Non-Maskable Interrupt Source Structure. |
| 575 | /// |
| 576 | typedef struct { |
| 577 | UINT8 Type; |
| 578 | UINT8 Length; |
| 579 | UINT16 Flags; |
| 580 | UINT32 GlobalSystemInterruptVector; |
| 581 | } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE; |
| 582 | |
| 583 | /// |
| 584 | /// Local APIC NMI Structure. |
| 585 | /// |
| 586 | typedef struct { |
| 587 | UINT8 Type; |
| 588 | UINT8 Length; |
| 589 | UINT8 AcpiProcessorId; |
| 590 | UINT16 Flags; |
| 591 | UINT8 LocalApicInti; |
| 592 | } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE; |
| 593 | |
| 594 | /// |
| 595 | /// Smart Battery Description Table (SBST) |
| 596 | /// |
| 597 | typedef struct { |
| 598 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 599 | UINT32 WarningEnergyLevel; |
| 600 | UINT32 LowEnergyLevel; |
| 601 | UINT32 CriticalEnergyLevel; |
| 602 | } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE; |
| 603 | |
| 604 | // |
| 605 | // Known table signatures |
| 606 | // |
| 607 | |
| 608 | /// |
| 609 | /// "RSD PTR " Root System Description Pointer. |
| 610 | /// |
| 611 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE SIGNATURE_64('R', 'S', 'D', ' ', 'P', 'T', 'R', ' ') |
| 612 | |
| 613 | /// |
| 614 | /// "APIC" Multiple APIC Description Table. |
| 615 | /// |
| 616 | #define EFI_ACPI_1_0_APIC_SIGNATURE SIGNATURE_32('A', 'P', 'I', 'C') |
| 617 | |
| 618 | /// |
| 619 | /// "DSDT" Differentiated System Description Table. |
| 620 | /// |
| 621 | #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('D', 'S', 'D', 'T') |
| 622 | |
| 623 | /// |
| 624 | /// "FACS" Firmware ACPI Control Structure. |
| 625 | /// |
| 626 | #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'S') |
| 627 | |
| 628 | /// |
| 629 | /// "FACP" Fixed ACPI Description Table. |
| 630 | /// |
| 631 | #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('F', 'A', 'C', 'P') |
| 632 | |
| 633 | /// |
| 634 | /// "PSDT" Persistent System Description Table. |
| 635 | /// |
| 636 | #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('P', 'S', 'D', 'T') |
| 637 | |
| 638 | /// |
| 639 | /// "RSDT" Root System Description Table. |
| 640 | /// |
| 641 | #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('R', 'S', 'D', 'T') |
| 642 | |
| 643 | /// |
| 644 | /// "SBST" Smart Battery Specification Table. |
| 645 | /// |
| 646 | #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE SIGNATURE_32('S', 'B', 'S', 'T') |
| 647 | |
| 648 | /// |
| 649 | /// "SSDT" Secondary System Description Table. |
| 650 | /// |
| 651 | #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE SIGNATURE_32('S', 'S', 'D', 'T') |
| 652 | |
| 653 | #pragma pack() |
| 654 | |
| 655 | #endif |