1 /****************************************************************************** 2 * 3 * Name: actbl1.h - Additional ACPI table definitions 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2014, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44 #ifndef __ACTBL1_H__ 45 #define __ACTBL1_H__ 46 47 48 /******************************************************************************* 49 * 50 * Additional ACPI Tables (1) 51 * 52 * These tables are not consumed directly by the ACPICA subsystem, but are 53 * included here to support device drivers and the AML disassembler. 54 * 55 * The tables in this file are fully defined within the ACPI specification. 56 * 57 ******************************************************************************/ 58 59 60 /* 61 * Values for description table header signatures for tables defined in this 62 * file. Useful because they make it more difficult to inadvertently type in 63 * the wrong signature. 64 */ 65 #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */ 66 #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 67 #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 68 #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */ 69 #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */ 70 #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */ 71 #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 72 #define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */ 73 #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 74 #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 75 #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ 76 77 78 /* 79 * All tables must be byte-packed to match the ACPI specification, since 80 * the tables are provided by the system BIOS. 81 */ 82 #pragma pack(1) 83 84 /* 85 * Note: C bitfields are not used for this reason: 86 * 87 * "Bitfields are great and easy to read, but unfortunately the C language 88 * does not specify the layout of bitfields in memory, which means they are 89 * essentially useless for dealing with packed data in on-disk formats or 90 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, 91 * this decision was a design error in C. Ritchie could have picked an order 92 * and stuck with it." Norman Ramsey. 93 * See http://stackoverflow.com/a/1053662/41661 94 */ 95 96 97 /******************************************************************************* 98 * 99 * Common subtable headers 100 * 101 ******************************************************************************/ 102 103 /* Generic subtable header (used in MADT, SRAT, etc.) */ 104 105 typedef struct acpi_subtable_header 106 { 107 UINT8 Type; 108 UINT8 Length; 109 110 } ACPI_SUBTABLE_HEADER; 111 112 113 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */ 114 115 typedef struct acpi_whea_header 116 { 117 UINT8 Action; 118 UINT8 Instruction; 119 UINT8 Flags; 120 UINT8 Reserved; 121 ACPI_GENERIC_ADDRESS RegisterRegion; 122 UINT64 Value; /* Value used with Read/Write register */ 123 UINT64 Mask; /* Bitmask required for this register instruction */ 124 125 } ACPI_WHEA_HEADER; 126 127 128 /******************************************************************************* 129 * 130 * BERT - Boot Error Record Table (ACPI 4.0) 131 * Version 1 132 * 133 ******************************************************************************/ 134 135 typedef struct acpi_table_bert 136 { 137 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 138 UINT32 RegionLength; /* Length of the boot error region */ 139 UINT64 Address; /* Physical address of the error region */ 140 141 } ACPI_TABLE_BERT; 142 143 144 /* Boot Error Region (not a subtable, pointed to by Address field above) */ 145 146 typedef struct acpi_bert_region 147 { 148 UINT32 BlockStatus; /* Type of error information */ 149 UINT32 RawDataOffset; /* Offset to raw error data */ 150 UINT32 RawDataLength; /* Length of raw error data */ 151 UINT32 DataLength; /* Length of generic error data */ 152 UINT32 ErrorSeverity; /* Severity code */ 153 154 } ACPI_BERT_REGION; 155 156 /* Values for BlockStatus flags above */ 157 158 #define ACPI_BERT_UNCORRECTABLE (1) 159 #define ACPI_BERT_CORRECTABLE (1<<1) 160 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2) 161 #define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3) 162 #define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ 163 164 /* Values for ErrorSeverity above */ 165 166 enum AcpiBertErrorSeverity 167 { 168 ACPI_BERT_ERROR_CORRECTABLE = 0, 169 ACPI_BERT_ERROR_FATAL = 1, 170 ACPI_BERT_ERROR_CORRECTED = 2, 171 ACPI_BERT_ERROR_NONE = 3, 172 ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */ 173 }; 174 175 /* 176 * Note: The generic error data that follows the ErrorSeverity field above 177 * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below 178 */ 179 180 181 /******************************************************************************* 182 * 183 * CPEP - Corrected Platform Error Polling table (ACPI 4.0) 184 * Version 1 185 * 186 ******************************************************************************/ 187 188 typedef struct acpi_table_cpep 189 { 190 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 191 UINT64 Reserved; 192 193 } ACPI_TABLE_CPEP; 194 195 196 /* Subtable */ 197 198 typedef struct acpi_cpep_polling 199 { 200 ACPI_SUBTABLE_HEADER Header; 201 UINT8 Id; /* Processor ID */ 202 UINT8 Eid; /* Processor EID */ 203 UINT32 Interval; /* Polling interval (msec) */ 204 205 } ACPI_CPEP_POLLING; 206 207 208 /******************************************************************************* 209 * 210 * ECDT - Embedded Controller Boot Resources Table 211 * Version 1 212 * 213 ******************************************************************************/ 214 215 typedef struct acpi_table_ecdt 216 { 217 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 218 ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */ 219 ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */ 220 UINT32 Uid; /* Unique ID - must be same as the EC _UID method */ 221 UINT8 Gpe; /* The GPE for the EC */ 222 UINT8 Id[1]; /* Full namepath of the EC in the ACPI namespace */ 223 224 } ACPI_TABLE_ECDT; 225 226 227 /******************************************************************************* 228 * 229 * EINJ - Error Injection Table (ACPI 4.0) 230 * Version 1 231 * 232 ******************************************************************************/ 233 234 typedef struct acpi_table_einj 235 { 236 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 237 UINT32 HeaderLength; 238 UINT8 Flags; 239 UINT8 Reserved[3]; 240 UINT32 Entries; 241 242 } ACPI_TABLE_EINJ; 243 244 245 /* EINJ Injection Instruction Entries (actions) */ 246 247 typedef struct acpi_einj_entry 248 { 249 ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */ 250 251 } ACPI_EINJ_ENTRY; 252 253 /* Masks for Flags field above */ 254 255 #define ACPI_EINJ_PRESERVE (1) 256 257 /* Values for Action field above */ 258 259 enum AcpiEinjActions 260 { 261 ACPI_EINJ_BEGIN_OPERATION = 0, 262 ACPI_EINJ_GET_TRIGGER_TABLE = 1, 263 ACPI_EINJ_SET_ERROR_TYPE = 2, 264 ACPI_EINJ_GET_ERROR_TYPE = 3, 265 ACPI_EINJ_END_OPERATION = 4, 266 ACPI_EINJ_EXECUTE_OPERATION = 5, 267 ACPI_EINJ_CHECK_BUSY_STATUS = 6, 268 ACPI_EINJ_GET_COMMAND_STATUS = 7, 269 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, 270 ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */ 271 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ 272 }; 273 274 /* Values for Instruction field above */ 275 276 enum AcpiEinjInstructions 277 { 278 ACPI_EINJ_READ_REGISTER = 0, 279 ACPI_EINJ_READ_REGISTER_VALUE = 1, 280 ACPI_EINJ_WRITE_REGISTER = 2, 281 ACPI_EINJ_WRITE_REGISTER_VALUE = 3, 282 ACPI_EINJ_NOOP = 4, 283 ACPI_EINJ_FLUSH_CACHELINE = 5, 284 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */ 285 }; 286 287 typedef struct acpi_einj_error_type_with_addr 288 { 289 UINT32 ErrorType; 290 UINT32 VendorStructOffset; 291 UINT32 Flags; 292 UINT32 ApicId; 293 UINT64 Address; 294 UINT64 Range; 295 UINT32 PcieId; 296 297 } ACPI_EINJ_ERROR_TYPE_WITH_ADDR; 298 299 typedef struct acpi_einj_vendor 300 { 301 UINT32 Length; 302 UINT32 PcieId; 303 UINT16 VendorId; 304 UINT16 DeviceId; 305 UINT8 RevisionId; 306 UINT8 Reserved[3]; 307 308 } ACPI_EINJ_VENDOR; 309 310 311 /* EINJ Trigger Error Action Table */ 312 313 typedef struct acpi_einj_trigger 314 { 315 UINT32 HeaderSize; 316 UINT32 Revision; 317 UINT32 TableSize; 318 UINT32 EntryCount; 319 320 } ACPI_EINJ_TRIGGER; 321 322 /* Command status return values */ 323 324 enum AcpiEinjCommandStatus 325 { 326 ACPI_EINJ_SUCCESS = 0, 327 ACPI_EINJ_FAILURE = 1, 328 ACPI_EINJ_INVALID_ACCESS = 2, 329 ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */ 330 }; 331 332 333 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */ 334 335 #define ACPI_EINJ_PROCESSOR_CORRECTABLE (1) 336 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1) 337 #define ACPI_EINJ_PROCESSOR_FATAL (1<<2) 338 #define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3) 339 #define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4) 340 #define ACPI_EINJ_MEMORY_FATAL (1<<5) 341 #define ACPI_EINJ_PCIX_CORRECTABLE (1<<6) 342 #define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7) 343 #define ACPI_EINJ_PCIX_FATAL (1<<8) 344 #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) 345 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) 346 #define ACPI_EINJ_PLATFORM_FATAL (1<<11) 347 #define ACPI_EINJ_VENDOR_DEFINED (1<<31) 348 349 350 /******************************************************************************* 351 * 352 * ERST - Error Record Serialization Table (ACPI 4.0) 353 * Version 1 354 * 355 ******************************************************************************/ 356 357 typedef struct acpi_table_erst 358 { 359 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 360 UINT32 HeaderLength; 361 UINT32 Reserved; 362 UINT32 Entries; 363 364 } ACPI_TABLE_ERST; 365 366 367 /* ERST Serialization Entries (actions) */ 368 369 typedef struct acpi_erst_entry 370 { 371 ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */ 372 373 } ACPI_ERST_ENTRY; 374 375 /* Masks for Flags field above */ 376 377 #define ACPI_ERST_PRESERVE (1) 378 379 /* Values for Action field above */ 380 381 enum AcpiErstActions 382 { 383 ACPI_ERST_BEGIN_WRITE = 0, 384 ACPI_ERST_BEGIN_READ = 1, 385 ACPI_ERST_BEGIN_CLEAR = 2, 386 ACPI_ERST_END = 3, 387 ACPI_ERST_SET_RECORD_OFFSET = 4, 388 ACPI_ERST_EXECUTE_OPERATION = 5, 389 ACPI_ERST_CHECK_BUSY_STATUS = 6, 390 ACPI_ERST_GET_COMMAND_STATUS = 7, 391 ACPI_ERST_GET_RECORD_ID = 8, 392 ACPI_ERST_SET_RECORD_ID = 9, 393 ACPI_ERST_GET_RECORD_COUNT = 10, 394 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11, 395 ACPI_ERST_NOT_USED = 12, 396 ACPI_ERST_GET_ERROR_RANGE = 13, 397 ACPI_ERST_GET_ERROR_LENGTH = 14, 398 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15, 399 ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */ 400 }; 401 402 /* Values for Instruction field above */ 403 404 enum AcpiErstInstructions 405 { 406 ACPI_ERST_READ_REGISTER = 0, 407 ACPI_ERST_READ_REGISTER_VALUE = 1, 408 ACPI_ERST_WRITE_REGISTER = 2, 409 ACPI_ERST_WRITE_REGISTER_VALUE = 3, 410 ACPI_ERST_NOOP = 4, 411 ACPI_ERST_LOAD_VAR1 = 5, 412 ACPI_ERST_LOAD_VAR2 = 6, 413 ACPI_ERST_STORE_VAR1 = 7, 414 ACPI_ERST_ADD = 8, 415 ACPI_ERST_SUBTRACT = 9, 416 ACPI_ERST_ADD_VALUE = 10, 417 ACPI_ERST_SUBTRACT_VALUE = 11, 418 ACPI_ERST_STALL = 12, 419 ACPI_ERST_STALL_WHILE_TRUE = 13, 420 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14, 421 ACPI_ERST_GOTO = 15, 422 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16, 423 ACPI_ERST_SET_DST_ADDRESS_BASE = 17, 424 ACPI_ERST_MOVE_DATA = 18, 425 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */ 426 }; 427 428 /* Command status return values */ 429 430 enum AcpiErstCommandStatus 431 { 432 ACPI_ERST_SUCESS = 0, 433 ACPI_ERST_NO_SPACE = 1, 434 ACPI_ERST_NOT_AVAILABLE = 2, 435 ACPI_ERST_FAILURE = 3, 436 ACPI_ERST_RECORD_EMPTY = 4, 437 ACPI_ERST_NOT_FOUND = 5, 438 ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */ 439 }; 440 441 442 /* Error Record Serialization Information */ 443 444 typedef struct acpi_erst_info 445 { 446 UINT16 Signature; /* Should be "ER" */ 447 UINT8 Data[48]; 448 449 } ACPI_ERST_INFO; 450 451 452 /******************************************************************************* 453 * 454 * HEST - Hardware Error Source Table (ACPI 4.0) 455 * Version 1 456 * 457 ******************************************************************************/ 458 459 typedef struct acpi_table_hest 460 { 461 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 462 UINT32 ErrorSourceCount; 463 464 } ACPI_TABLE_HEST; 465 466 467 /* HEST subtable header */ 468 469 typedef struct acpi_hest_header 470 { 471 UINT16 Type; 472 UINT16 SourceId; 473 474 } ACPI_HEST_HEADER; 475 476 477 /* Values for Type field above for subtables */ 478 479 enum AcpiHestTypes 480 { 481 ACPI_HEST_TYPE_IA32_CHECK = 0, 482 ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1, 483 ACPI_HEST_TYPE_IA32_NMI = 2, 484 ACPI_HEST_TYPE_NOT_USED3 = 3, 485 ACPI_HEST_TYPE_NOT_USED4 = 4, 486 ACPI_HEST_TYPE_NOT_USED5 = 5, 487 ACPI_HEST_TYPE_AER_ROOT_PORT = 6, 488 ACPI_HEST_TYPE_AER_ENDPOINT = 7, 489 ACPI_HEST_TYPE_AER_BRIDGE = 8, 490 ACPI_HEST_TYPE_GENERIC_ERROR = 9, 491 ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */ 492 }; 493 494 495 /* 496 * HEST substructures contained in subtables 497 */ 498 499 /* 500 * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and 501 * ACPI_HEST_IA_CORRECTED structures. 502 */ 503 typedef struct acpi_hest_ia_error_bank 504 { 505 UINT8 BankNumber; 506 UINT8 ClearStatusOnInit; 507 UINT8 StatusFormat; 508 UINT8 Reserved; 509 UINT32 ControlRegister; 510 UINT64 ControlData; 511 UINT32 StatusRegister; 512 UINT32 AddressRegister; 513 UINT32 MiscRegister; 514 515 } ACPI_HEST_IA_ERROR_BANK; 516 517 518 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */ 519 520 typedef struct acpi_hest_aer_common 521 { 522 UINT16 Reserved1; 523 UINT8 Flags; 524 UINT8 Enabled; 525 UINT32 RecordsToPreallocate; 526 UINT32 MaxSectionsPerRecord; 527 UINT32 Bus; /* Bus and Segment numbers */ 528 UINT16 Device; 529 UINT16 Function; 530 UINT16 DeviceControl; 531 UINT16 Reserved2; 532 UINT32 UncorrectableMask; 533 UINT32 UncorrectableSeverity; 534 UINT32 CorrectableMask; 535 UINT32 AdvancedCapabilities; 536 537 } ACPI_HEST_AER_COMMON; 538 539 /* Masks for HEST Flags fields */ 540 541 #define ACPI_HEST_FIRMWARE_FIRST (1) 542 #define ACPI_HEST_GLOBAL (1<<1) 543 544 /* 545 * Macros to access the bus/segment numbers in Bus field above: 546 * Bus number is encoded in bits 7:0 547 * Segment number is encoded in bits 23:8 548 */ 549 #define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF) 550 #define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF) 551 552 553 /* Hardware Error Notification */ 554 555 typedef struct acpi_hest_notify 556 { 557 UINT8 Type; 558 UINT8 Length; 559 UINT16 ConfigWriteEnable; 560 UINT32 PollInterval; 561 UINT32 Vector; 562 UINT32 PollingThresholdValue; 563 UINT32 PollingThresholdWindow; 564 UINT32 ErrorThresholdValue; 565 UINT32 ErrorThresholdWindow; 566 567 } ACPI_HEST_NOTIFY; 568 569 /* Values for Notify Type field above */ 570 571 enum AcpiHestNotifyTypes 572 { 573 ACPI_HEST_NOTIFY_POLLED = 0, 574 ACPI_HEST_NOTIFY_EXTERNAL = 1, 575 ACPI_HEST_NOTIFY_LOCAL = 2, 576 ACPI_HEST_NOTIFY_SCI = 3, 577 ACPI_HEST_NOTIFY_NMI = 4, 578 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ 579 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ 580 ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */ 581 }; 582 583 /* Values for ConfigWriteEnable bitfield above */ 584 585 #define ACPI_HEST_TYPE (1) 586 #define ACPI_HEST_POLL_INTERVAL (1<<1) 587 #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2) 588 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3) 589 #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4) 590 #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5) 591 592 593 /* 594 * HEST subtables 595 */ 596 597 /* 0: IA32 Machine Check Exception */ 598 599 typedef struct acpi_hest_ia_machine_check 600 { 601 ACPI_HEST_HEADER Header; 602 UINT16 Reserved1; 603 UINT8 Flags; 604 UINT8 Enabled; 605 UINT32 RecordsToPreallocate; 606 UINT32 MaxSectionsPerRecord; 607 UINT64 GlobalCapabilityData; 608 UINT64 GlobalControlData; 609 UINT8 NumHardwareBanks; 610 UINT8 Reserved3[7]; 611 612 } ACPI_HEST_IA_MACHINE_CHECK; 613 614 615 /* 1: IA32 Corrected Machine Check */ 616 617 typedef struct acpi_hest_ia_corrected 618 { 619 ACPI_HEST_HEADER Header; 620 UINT16 Reserved1; 621 UINT8 Flags; 622 UINT8 Enabled; 623 UINT32 RecordsToPreallocate; 624 UINT32 MaxSectionsPerRecord; 625 ACPI_HEST_NOTIFY Notify; 626 UINT8 NumHardwareBanks; 627 UINT8 Reserved2[3]; 628 629 } ACPI_HEST_IA_CORRECTED; 630 631 632 /* 2: IA32 Non-Maskable Interrupt */ 633 634 typedef struct acpi_hest_ia_nmi 635 { 636 ACPI_HEST_HEADER Header; 637 UINT32 Reserved; 638 UINT32 RecordsToPreallocate; 639 UINT32 MaxSectionsPerRecord; 640 UINT32 MaxRawDataLength; 641 642 } ACPI_HEST_IA_NMI; 643 644 645 /* 3,4,5: Not used */ 646 647 /* 6: PCI Express Root Port AER */ 648 649 typedef struct acpi_hest_aer_root 650 { 651 ACPI_HEST_HEADER Header; 652 ACPI_HEST_AER_COMMON Aer; 653 UINT32 RootErrorCommand; 654 655 } ACPI_HEST_AER_ROOT; 656 657 658 /* 7: PCI Express AER (AER Endpoint) */ 659 660 typedef struct acpi_hest_aer 661 { 662 ACPI_HEST_HEADER Header; 663 ACPI_HEST_AER_COMMON Aer; 664 665 } ACPI_HEST_AER; 666 667 668 /* 8: PCI Express/PCI-X Bridge AER */ 669 670 typedef struct acpi_hest_aer_bridge 671 { 672 ACPI_HEST_HEADER Header; 673 ACPI_HEST_AER_COMMON Aer; 674 UINT32 UncorrectableMask2; 675 UINT32 UncorrectableSeverity2; 676 UINT32 AdvancedCapabilities2; 677 678 } ACPI_HEST_AER_BRIDGE; 679 680 681 /* 9: Generic Hardware Error Source */ 682 683 typedef struct acpi_hest_generic 684 { 685 ACPI_HEST_HEADER Header; 686 UINT16 RelatedSourceId; 687 UINT8 Reserved; 688 UINT8 Enabled; 689 UINT32 RecordsToPreallocate; 690 UINT32 MaxSectionsPerRecord; 691 UINT32 MaxRawDataLength; 692 ACPI_GENERIC_ADDRESS ErrorStatusAddress; 693 ACPI_HEST_NOTIFY Notify; 694 UINT32 ErrorBlockLength; 695 696 } ACPI_HEST_GENERIC; 697 698 699 /* Generic Error Status block */ 700 701 typedef struct acpi_hest_generic_status 702 { 703 UINT32 BlockStatus; 704 UINT32 RawDataOffset; 705 UINT32 RawDataLength; 706 UINT32 DataLength; 707 UINT32 ErrorSeverity; 708 709 } ACPI_HEST_GENERIC_STATUS; 710 711 /* Values for BlockStatus flags above */ 712 713 #define ACPI_HEST_UNCORRECTABLE (1) 714 #define ACPI_HEST_CORRECTABLE (1<<1) 715 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) 716 #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) 717 #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ 718 719 720 /* Generic Error Data entry */ 721 722 typedef struct acpi_hest_generic_data 723 { 724 UINT8 SectionType[16]; 725 UINT32 ErrorSeverity; 726 UINT16 Revision; 727 UINT8 ValidationBits; 728 UINT8 Flags; 729 UINT32 ErrorDataLength; 730 UINT8 FruId[16]; 731 UINT8 FruText[20]; 732 733 } ACPI_HEST_GENERIC_DATA; 734 735 736 /******************************************************************************* 737 * 738 * MADT - Multiple APIC Description Table 739 * Version 3 740 * 741 ******************************************************************************/ 742 743 typedef struct acpi_table_madt 744 { 745 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 746 UINT32 Address; /* Physical address of local APIC */ 747 UINT32 Flags; 748 749 } ACPI_TABLE_MADT; 750 751 /* Masks for Flags field above */ 752 753 #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ 754 755 /* Values for PCATCompat flag */ 756 757 #define ACPI_MADT_DUAL_PIC 0 758 #define ACPI_MADT_MULTIPLE_APIC 1 759 760 761 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */ 762 763 enum AcpiMadtType 764 { 765 ACPI_MADT_TYPE_LOCAL_APIC = 0, 766 ACPI_MADT_TYPE_IO_APIC = 1, 767 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, 768 ACPI_MADT_TYPE_NMI_SOURCE = 3, 769 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, 770 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, 771 ACPI_MADT_TYPE_IO_SAPIC = 6, 772 ACPI_MADT_TYPE_LOCAL_SAPIC = 7, 773 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 774 ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 775 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 776 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 777 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 778 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13, 779 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14, 780 ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */ 781 }; 782 783 784 /* 785 * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER 786 */ 787 788 /* 0: Processor Local APIC */ 789 790 typedef struct acpi_madt_local_apic 791 { 792 ACPI_SUBTABLE_HEADER Header; 793 UINT8 ProcessorId; /* ACPI processor id */ 794 UINT8 Id; /* Processor's local APIC id */ 795 UINT32 LapicFlags; 796 797 } ACPI_MADT_LOCAL_APIC; 798 799 800 /* 1: IO APIC */ 801 802 typedef struct acpi_madt_io_apic 803 { 804 ACPI_SUBTABLE_HEADER Header; 805 UINT8 Id; /* I/O APIC ID */ 806 UINT8 Reserved; /* Reserved - must be zero */ 807 UINT32 Address; /* APIC physical address */ 808 UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */ 809 810 } ACPI_MADT_IO_APIC; 811 812 813 /* 2: Interrupt Override */ 814 815 typedef struct acpi_madt_interrupt_override 816 { 817 ACPI_SUBTABLE_HEADER Header; 818 UINT8 Bus; /* 0 - ISA */ 819 UINT8 SourceIrq; /* Interrupt source (IRQ) */ 820 UINT32 GlobalIrq; /* Global system interrupt */ 821 UINT16 IntiFlags; 822 823 } ACPI_MADT_INTERRUPT_OVERRIDE; 824 825 826 /* 3: NMI Source */ 827 828 typedef struct acpi_madt_nmi_source 829 { 830 ACPI_SUBTABLE_HEADER Header; 831 UINT16 IntiFlags; 832 UINT32 GlobalIrq; /* Global system interrupt */ 833 834 } ACPI_MADT_NMI_SOURCE; 835 836 837 /* 4: Local APIC NMI */ 838 839 typedef struct acpi_madt_local_apic_nmi 840 { 841 ACPI_SUBTABLE_HEADER Header; 842 UINT8 ProcessorId; /* ACPI processor id */ 843 UINT16 IntiFlags; 844 UINT8 Lint; /* LINTn to which NMI is connected */ 845 846 } ACPI_MADT_LOCAL_APIC_NMI; 847 848 849 /* 5: Address Override */ 850 851 typedef struct acpi_madt_local_apic_override 852 { 853 ACPI_SUBTABLE_HEADER Header; 854 UINT16 Reserved; /* Reserved, must be zero */ 855 UINT64 Address; /* APIC physical address */ 856 857 } ACPI_MADT_LOCAL_APIC_OVERRIDE; 858 859 860 /* 6: I/O Sapic */ 861 862 typedef struct acpi_madt_io_sapic 863 { 864 ACPI_SUBTABLE_HEADER Header; 865 UINT8 Id; /* I/O SAPIC ID */ 866 UINT8 Reserved; /* Reserved, must be zero */ 867 UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */ 868 UINT64 Address; /* SAPIC physical address */ 869 870 } ACPI_MADT_IO_SAPIC; 871 872 873 /* 7: Local Sapic */ 874 875 typedef struct acpi_madt_local_sapic 876 { 877 ACPI_SUBTABLE_HEADER Header; 878 UINT8 ProcessorId; /* ACPI processor id */ 879 UINT8 Id; /* SAPIC ID */ 880 UINT8 Eid; /* SAPIC EID */ 881 UINT8 Reserved[3]; /* Reserved, must be zero */ 882 UINT32 LapicFlags; 883 UINT32 Uid; /* Numeric UID - ACPI 3.0 */ 884 char UidString[1]; /* String UID - ACPI 3.0 */ 885 886 } ACPI_MADT_LOCAL_SAPIC; 887 888 889 /* 8: Platform Interrupt Source */ 890 891 typedef struct acpi_madt_interrupt_source 892 { 893 ACPI_SUBTABLE_HEADER Header; 894 UINT16 IntiFlags; 895 UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */ 896 UINT8 Id; /* Processor ID */ 897 UINT8 Eid; /* Processor EID */ 898 UINT8 IoSapicVector; /* Vector value for PMI interrupts */ 899 UINT32 GlobalIrq; /* Global system interrupt */ 900 UINT32 Flags; /* Interrupt Source Flags */ 901 902 } ACPI_MADT_INTERRUPT_SOURCE; 903 904 /* Masks for Flags field above */ 905 906 #define ACPI_MADT_CPEI_OVERRIDE (1) 907 908 909 /* 9: Processor Local X2APIC (ACPI 4.0) */ 910 911 typedef struct acpi_madt_local_x2apic 912 { 913 ACPI_SUBTABLE_HEADER Header; 914 UINT16 Reserved; /* Reserved - must be zero */ 915 UINT32 LocalApicId; /* Processor x2APIC ID */ 916 UINT32 LapicFlags; 917 UINT32 Uid; /* ACPI processor UID */ 918 919 } ACPI_MADT_LOCAL_X2APIC; 920 921 922 /* 10: Local X2APIC NMI (ACPI 4.0) */ 923 924 typedef struct acpi_madt_local_x2apic_nmi 925 { 926 ACPI_SUBTABLE_HEADER Header; 927 UINT16 IntiFlags; 928 UINT32 Uid; /* ACPI processor UID */ 929 UINT8 Lint; /* LINTn to which NMI is connected */ 930 UINT8 Reserved[3]; /* Reserved - must be zero */ 931 932 } ACPI_MADT_LOCAL_X2APIC_NMI; 933 934 935 /* 11: Generic Interrupt (ACPI 5.0) */ 936 937 typedef struct acpi_madt_generic_interrupt 938 { 939 ACPI_SUBTABLE_HEADER Header; 940 UINT16 Reserved; /* Reserved - must be zero */ 941 UINT32 CpuInterfaceNumber; 942 UINT32 Uid; 943 UINT32 Flags; 944 UINT32 ParkingVersion; 945 UINT32 PerformanceInterrupt; 946 UINT64 ParkedAddress; 947 UINT64 BaseAddress; 948 UINT64 GicvBaseAddress; 949 UINT64 GichBaseAddress; 950 UINT32 VgicInterrupt; 951 UINT64 GicrBaseAddress; 952 UINT64 ArmMpidr; 953 954 } ACPI_MADT_GENERIC_INTERRUPT; 955 956 /* Masks for Flags field above */ 957 958 /* ACPI_MADT_ENABLED (1) Processor is usable if set */ 959 #define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */ 960 #define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */ 961 962 963 /* 12: Generic Distributor (ACPI 5.0) */ 964 965 typedef struct acpi_madt_generic_distributor 966 { 967 ACPI_SUBTABLE_HEADER Header; 968 UINT16 Reserved; /* Reserved - must be zero */ 969 UINT32 GicId; 970 UINT64 BaseAddress; 971 UINT32 GlobalIrqBase; 972 UINT32 Reserved2; /* Reserved - must be zero */ 973 974 } ACPI_MADT_GENERIC_DISTRIBUTOR; 975 976 977 /* 13: Generic MSI Frame (ACPI 5.1) */ 978 979 typedef struct acpi_madt_generic_msi_frame 980 { 981 ACPI_SUBTABLE_HEADER Header; 982 UINT16 Reserved; /* Reserved - must be zero */ 983 UINT32 MsiFrameId; 984 UINT64 BaseAddress; 985 UINT32 Flags; 986 UINT16 SpiCount; 987 UINT16 SpiBase; 988 989 } ACPI_MADT_GENERIC_MSI_FRAME; 990 991 /* Masks for Flags field above */ 992 993 #define ACPI_MADT_OVERRIDE_SPI_VALUES (1) 994 995 996 /* 14: Generic Redistributor (ACPI 5.1) */ 997 998 typedef struct acpi_madt_generic_redistributor 999 { 1000 ACPI_SUBTABLE_HEADER Header; 1001 UINT16 Reserved; /* reserved - must be zero */ 1002 UINT64 BaseAddress; 1003 UINT32 Length; 1004 1005 } ACPI_MADT_GENERIC_REDISTRIBUTOR; 1006 1007 1008 /* 1009 * Common flags fields for MADT subtables 1010 */ 1011 1012 /* MADT Local APIC flags */ 1013 1014 #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 1015 1016 /* MADT MPS INTI flags (IntiFlags) */ 1017 1018 #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */ 1019 #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */ 1020 1021 /* Values for MPS INTI flags */ 1022 1023 #define ACPI_MADT_POLARITY_CONFORMS 0 1024 #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 1025 #define ACPI_MADT_POLARITY_RESERVED 2 1026 #define ACPI_MADT_POLARITY_ACTIVE_LOW 3 1027 1028 #define ACPI_MADT_TRIGGER_CONFORMS (0) 1029 #define ACPI_MADT_TRIGGER_EDGE (1<<2) 1030 #define ACPI_MADT_TRIGGER_RESERVED (2<<2) 1031 #define ACPI_MADT_TRIGGER_LEVEL (3<<2) 1032 1033 1034 /******************************************************************************* 1035 * 1036 * MSCT - Maximum System Characteristics Table (ACPI 4.0) 1037 * Version 1 1038 * 1039 ******************************************************************************/ 1040 1041 typedef struct acpi_table_msct 1042 { 1043 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1044 UINT32 ProximityOffset; /* Location of proximity info struct(s) */ 1045 UINT32 MaxProximityDomains;/* Max number of proximity domains */ 1046 UINT32 MaxClockDomains; /* Max number of clock domains */ 1047 UINT64 MaxAddress; /* Max physical address in system */ 1048 1049 } ACPI_TABLE_MSCT; 1050 1051 1052 /* Subtable - Maximum Proximity Domain Information. Version 1 */ 1053 1054 typedef struct acpi_msct_proximity 1055 { 1056 UINT8 Revision; 1057 UINT8 Length; 1058 UINT32 RangeStart; /* Start of domain range */ 1059 UINT32 RangeEnd; /* End of domain range */ 1060 UINT32 ProcessorCapacity; 1061 UINT64 MemoryCapacity; /* In bytes */ 1062 1063 } ACPI_MSCT_PROXIMITY; 1064 1065 1066 /******************************************************************************* 1067 * 1068 * SBST - Smart Battery Specification Table 1069 * Version 1 1070 * 1071 ******************************************************************************/ 1072 1073 typedef struct acpi_table_sbst 1074 { 1075 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1076 UINT32 WarningLevel; 1077 UINT32 LowLevel; 1078 UINT32 CriticalLevel; 1079 1080 } ACPI_TABLE_SBST; 1081 1082 1083 /******************************************************************************* 1084 * 1085 * SLIT - System Locality Distance Information Table 1086 * Version 1 1087 * 1088 ******************************************************************************/ 1089 1090 typedef struct acpi_table_slit 1091 { 1092 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1093 UINT64 LocalityCount; 1094 UINT8 Entry[1]; /* Real size = localities^2 */ 1095 1096 } ACPI_TABLE_SLIT; 1097 1098 1099 /******************************************************************************* 1100 * 1101 * SRAT - System Resource Affinity Table 1102 * Version 3 1103 * 1104 ******************************************************************************/ 1105 1106 typedef struct acpi_table_srat 1107 { 1108 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1109 UINT32 TableRevision; /* Must be value '1' */ 1110 UINT64 Reserved; /* Reserved, must be zero */ 1111 1112 } ACPI_TABLE_SRAT; 1113 1114 /* Values for subtable type in ACPI_SUBTABLE_HEADER */ 1115 1116 enum AcpiSratType 1117 { 1118 ACPI_SRAT_TYPE_CPU_AFFINITY = 0, 1119 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, 1120 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, 1121 ACPI_SRAT_TYPE_GICC_AFFINITY = 3, 1122 ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */ 1123 }; 1124 1125 /* 1126 * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER 1127 */ 1128 1129 /* 0: Processor Local APIC/SAPIC Affinity */ 1130 1131 typedef struct acpi_srat_cpu_affinity 1132 { 1133 ACPI_SUBTABLE_HEADER Header; 1134 UINT8 ProximityDomainLo; 1135 UINT8 ApicId; 1136 UINT32 Flags; 1137 UINT8 LocalSapicEid; 1138 UINT8 ProximityDomainHi[3]; 1139 UINT32 ClockDomain; 1140 1141 } ACPI_SRAT_CPU_AFFINITY; 1142 1143 /* Flags */ 1144 1145 #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */ 1146 1147 1148 /* 1: Memory Affinity */ 1149 1150 typedef struct acpi_srat_mem_affinity 1151 { 1152 ACPI_SUBTABLE_HEADER Header; 1153 UINT32 ProximityDomain; 1154 UINT16 Reserved; /* Reserved, must be zero */ 1155 UINT64 BaseAddress; 1156 UINT64 Length; 1157 UINT32 Reserved1; 1158 UINT32 Flags; 1159 UINT64 Reserved2; /* Reserved, must be zero */ 1160 1161 } ACPI_SRAT_MEM_AFFINITY; 1162 1163 /* Flags */ 1164 1165 #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */ 1166 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ 1167 #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ 1168 1169 1170 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ 1171 1172 typedef struct acpi_srat_x2apic_cpu_affinity 1173 { 1174 ACPI_SUBTABLE_HEADER Header; 1175 UINT16 Reserved; /* Reserved, must be zero */ 1176 UINT32 ProximityDomain; 1177 UINT32 ApicId; 1178 UINT32 Flags; 1179 UINT32 ClockDomain; 1180 UINT32 Reserved2; 1181 1182 } ACPI_SRAT_X2APIC_CPU_AFFINITY; 1183 1184 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */ 1185 1186 #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ 1187 1188 1189 /* 3: GICC Affinity (ACPI 5.1) */ 1190 1191 typedef struct acpi_srat_gicc_affinity 1192 { 1193 ACPI_SUBTABLE_HEADER Header; 1194 UINT32 ProximityDomain; 1195 UINT32 AcpiProcessorUid; 1196 UINT32 Flags; 1197 UINT32 ClockDomain; 1198 1199 } ACPI_SRAT_GICC_AFFINITY; 1200 1201 /* Flags for ACPI_SRAT_GICC_AFFINITY */ 1202 1203 #define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */ 1204 1205 /* Reset to default packing */ 1206 1207 #pragma pack() 1208 1209 #endif /* __ACTBL1_H__ */ 1210