1 /****************************************************************************** 2 * 3 * Name: actbl1.h - Additional ACPI table definitions 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2012, 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; 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 /* Hardware Error Notification */ 546 547 typedef struct acpi_hest_notify 548 { 549 UINT8 Type; 550 UINT8 Length; 551 UINT16 ConfigWriteEnable; 552 UINT32 PollInterval; 553 UINT32 Vector; 554 UINT32 PollingThresholdValue; 555 UINT32 PollingThresholdWindow; 556 UINT32 ErrorThresholdValue; 557 UINT32 ErrorThresholdWindow; 558 559 } ACPI_HEST_NOTIFY; 560 561 /* Values for Notify Type field above */ 562 563 enum AcpiHestNotifyTypes 564 { 565 ACPI_HEST_NOTIFY_POLLED = 0, 566 ACPI_HEST_NOTIFY_EXTERNAL = 1, 567 ACPI_HEST_NOTIFY_LOCAL = 2, 568 ACPI_HEST_NOTIFY_SCI = 3, 569 ACPI_HEST_NOTIFY_NMI = 4, 570 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ 571 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ 572 ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */ 573 }; 574 575 /* Values for ConfigWriteEnable bitfield above */ 576 577 #define ACPI_HEST_TYPE (1) 578 #define ACPI_HEST_POLL_INTERVAL (1<<1) 579 #define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2) 580 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3) 581 #define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4) 582 #define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5) 583 584 585 /* 586 * HEST subtables 587 */ 588 589 /* 0: IA32 Machine Check Exception */ 590 591 typedef struct acpi_hest_ia_machine_check 592 { 593 ACPI_HEST_HEADER Header; 594 UINT16 Reserved1; 595 UINT8 Flags; 596 UINT8 Enabled; 597 UINT32 RecordsToPreallocate; 598 UINT32 MaxSectionsPerRecord; 599 UINT64 GlobalCapabilityData; 600 UINT64 GlobalControlData; 601 UINT8 NumHardwareBanks; 602 UINT8 Reserved3[7]; 603 604 } ACPI_HEST_IA_MACHINE_CHECK; 605 606 607 /* 1: IA32 Corrected Machine Check */ 608 609 typedef struct acpi_hest_ia_corrected 610 { 611 ACPI_HEST_HEADER Header; 612 UINT16 Reserved1; 613 UINT8 Flags; 614 UINT8 Enabled; 615 UINT32 RecordsToPreallocate; 616 UINT32 MaxSectionsPerRecord; 617 ACPI_HEST_NOTIFY Notify; 618 UINT8 NumHardwareBanks; 619 UINT8 Reserved2[3]; 620 621 } ACPI_HEST_IA_CORRECTED; 622 623 624 /* 2: IA32 Non-Maskable Interrupt */ 625 626 typedef struct acpi_hest_ia_nmi 627 { 628 ACPI_HEST_HEADER Header; 629 UINT32 Reserved; 630 UINT32 RecordsToPreallocate; 631 UINT32 MaxSectionsPerRecord; 632 UINT32 MaxRawDataLength; 633 634 } ACPI_HEST_IA_NMI; 635 636 637 /* 3,4,5: Not used */ 638 639 /* 6: PCI Express Root Port AER */ 640 641 typedef struct acpi_hest_aer_root 642 { 643 ACPI_HEST_HEADER Header; 644 ACPI_HEST_AER_COMMON Aer; 645 UINT32 RootErrorCommand; 646 647 } ACPI_HEST_AER_ROOT; 648 649 650 /* 7: PCI Express AER (AER Endpoint) */ 651 652 typedef struct acpi_hest_aer 653 { 654 ACPI_HEST_HEADER Header; 655 ACPI_HEST_AER_COMMON Aer; 656 657 } ACPI_HEST_AER; 658 659 660 /* 8: PCI Express/PCI-X Bridge AER */ 661 662 typedef struct acpi_hest_aer_bridge 663 { 664 ACPI_HEST_HEADER Header; 665 ACPI_HEST_AER_COMMON Aer; 666 UINT32 UncorrectableMask2; 667 UINT32 UncorrectableSeverity2; 668 UINT32 AdvancedCapabilities2; 669 670 } ACPI_HEST_AER_BRIDGE; 671 672 673 /* 9: Generic Hardware Error Source */ 674 675 typedef struct acpi_hest_generic 676 { 677 ACPI_HEST_HEADER Header; 678 UINT16 RelatedSourceId; 679 UINT8 Reserved; 680 UINT8 Enabled; 681 UINT32 RecordsToPreallocate; 682 UINT32 MaxSectionsPerRecord; 683 UINT32 MaxRawDataLength; 684 ACPI_GENERIC_ADDRESS ErrorStatusAddress; 685 ACPI_HEST_NOTIFY Notify; 686 UINT32 ErrorBlockLength; 687 688 } ACPI_HEST_GENERIC; 689 690 691 /* Generic Error Status block */ 692 693 typedef struct acpi_hest_generic_status 694 { 695 UINT32 BlockStatus; 696 UINT32 RawDataOffset; 697 UINT32 RawDataLength; 698 UINT32 DataLength; 699 UINT32 ErrorSeverity; 700 701 } ACPI_HEST_GENERIC_STATUS; 702 703 /* Values for BlockStatus flags above */ 704 705 #define ACPI_HEST_UNCORRECTABLE (1) 706 #define ACPI_HEST_CORRECTABLE (1<<1) 707 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2) 708 #define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3) 709 #define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */ 710 711 712 /* Generic Error Data entry */ 713 714 typedef struct acpi_hest_generic_data 715 { 716 UINT8 SectionType[16]; 717 UINT32 ErrorSeverity; 718 UINT16 Revision; 719 UINT8 ValidationBits; 720 UINT8 Flags; 721 UINT32 ErrorDataLength; 722 UINT8 FruId[16]; 723 UINT8 FruText[20]; 724 725 } ACPI_HEST_GENERIC_DATA; 726 727 728 /******************************************************************************* 729 * 730 * MADT - Multiple APIC Description Table 731 * Version 3 732 * 733 ******************************************************************************/ 734 735 typedef struct acpi_table_madt 736 { 737 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 738 UINT32 Address; /* Physical address of local APIC */ 739 UINT32 Flags; 740 741 } ACPI_TABLE_MADT; 742 743 /* Masks for Flags field above */ 744 745 #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */ 746 747 /* Values for PCATCompat flag */ 748 749 #define ACPI_MADT_DUAL_PIC 0 750 #define ACPI_MADT_MULTIPLE_APIC 1 751 752 753 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */ 754 755 enum AcpiMadtType 756 { 757 ACPI_MADT_TYPE_LOCAL_APIC = 0, 758 ACPI_MADT_TYPE_IO_APIC = 1, 759 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2, 760 ACPI_MADT_TYPE_NMI_SOURCE = 3, 761 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4, 762 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5, 763 ACPI_MADT_TYPE_IO_SAPIC = 6, 764 ACPI_MADT_TYPE_LOCAL_SAPIC = 7, 765 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, 766 ACPI_MADT_TYPE_LOCAL_X2APIC = 9, 767 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 768 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 769 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 770 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ 771 }; 772 773 774 /* 775 * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER 776 */ 777 778 /* 0: Processor Local APIC */ 779 780 typedef struct acpi_madt_local_apic 781 { 782 ACPI_SUBTABLE_HEADER Header; 783 UINT8 ProcessorId; /* ACPI processor id */ 784 UINT8 Id; /* Processor's local APIC id */ 785 UINT32 LapicFlags; 786 787 } ACPI_MADT_LOCAL_APIC; 788 789 790 /* 1: IO APIC */ 791 792 typedef struct acpi_madt_io_apic 793 { 794 ACPI_SUBTABLE_HEADER Header; 795 UINT8 Id; /* I/O APIC ID */ 796 UINT8 Reserved; /* Reserved - must be zero */ 797 UINT32 Address; /* APIC physical address */ 798 UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */ 799 800 } ACPI_MADT_IO_APIC; 801 802 803 /* 2: Interrupt Override */ 804 805 typedef struct acpi_madt_interrupt_override 806 { 807 ACPI_SUBTABLE_HEADER Header; 808 UINT8 Bus; /* 0 - ISA */ 809 UINT8 SourceIrq; /* Interrupt source (IRQ) */ 810 UINT32 GlobalIrq; /* Global system interrupt */ 811 UINT16 IntiFlags; 812 813 } ACPI_MADT_INTERRUPT_OVERRIDE; 814 815 816 /* 3: NMI Source */ 817 818 typedef struct acpi_madt_nmi_source 819 { 820 ACPI_SUBTABLE_HEADER Header; 821 UINT16 IntiFlags; 822 UINT32 GlobalIrq; /* Global system interrupt */ 823 824 } ACPI_MADT_NMI_SOURCE; 825 826 827 /* 4: Local APIC NMI */ 828 829 typedef struct acpi_madt_local_apic_nmi 830 { 831 ACPI_SUBTABLE_HEADER Header; 832 UINT8 ProcessorId; /* ACPI processor id */ 833 UINT16 IntiFlags; 834 UINT8 Lint; /* LINTn to which NMI is connected */ 835 836 } ACPI_MADT_LOCAL_APIC_NMI; 837 838 839 /* 5: Address Override */ 840 841 typedef struct acpi_madt_local_apic_override 842 { 843 ACPI_SUBTABLE_HEADER Header; 844 UINT16 Reserved; /* Reserved, must be zero */ 845 UINT64 Address; /* APIC physical address */ 846 847 } ACPI_MADT_LOCAL_APIC_OVERRIDE; 848 849 850 /* 6: I/O Sapic */ 851 852 typedef struct acpi_madt_io_sapic 853 { 854 ACPI_SUBTABLE_HEADER Header; 855 UINT8 Id; /* I/O SAPIC ID */ 856 UINT8 Reserved; /* Reserved, must be zero */ 857 UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */ 858 UINT64 Address; /* SAPIC physical address */ 859 860 } ACPI_MADT_IO_SAPIC; 861 862 863 /* 7: Local Sapic */ 864 865 typedef struct acpi_madt_local_sapic 866 { 867 ACPI_SUBTABLE_HEADER Header; 868 UINT8 ProcessorId; /* ACPI processor id */ 869 UINT8 Id; /* SAPIC ID */ 870 UINT8 Eid; /* SAPIC EID */ 871 UINT8 Reserved[3]; /* Reserved, must be zero */ 872 UINT32 LapicFlags; 873 UINT32 Uid; /* Numeric UID - ACPI 3.0 */ 874 char UidString[1]; /* String UID - ACPI 3.0 */ 875 876 } ACPI_MADT_LOCAL_SAPIC; 877 878 879 /* 8: Platform Interrupt Source */ 880 881 typedef struct acpi_madt_interrupt_source 882 { 883 ACPI_SUBTABLE_HEADER Header; 884 UINT16 IntiFlags; 885 UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */ 886 UINT8 Id; /* Processor ID */ 887 UINT8 Eid; /* Processor EID */ 888 UINT8 IoSapicVector; /* Vector value for PMI interrupts */ 889 UINT32 GlobalIrq; /* Global system interrupt */ 890 UINT32 Flags; /* Interrupt Source Flags */ 891 892 } ACPI_MADT_INTERRUPT_SOURCE; 893 894 /* Masks for Flags field above */ 895 896 #define ACPI_MADT_CPEI_OVERRIDE (1) 897 898 899 /* 9: Processor Local X2APIC (ACPI 4.0) */ 900 901 typedef struct acpi_madt_local_x2apic 902 { 903 ACPI_SUBTABLE_HEADER Header; 904 UINT16 Reserved; /* Reserved - must be zero */ 905 UINT32 LocalApicId; /* Processor x2APIC ID */ 906 UINT32 LapicFlags; 907 UINT32 Uid; /* ACPI processor UID */ 908 909 } ACPI_MADT_LOCAL_X2APIC; 910 911 912 /* 10: Local X2APIC NMI (ACPI 4.0) */ 913 914 typedef struct acpi_madt_local_x2apic_nmi 915 { 916 ACPI_SUBTABLE_HEADER Header; 917 UINT16 IntiFlags; 918 UINT32 Uid; /* ACPI processor UID */ 919 UINT8 Lint; /* LINTn to which NMI is connected */ 920 UINT8 Reserved[3]; /* Reserved - must be zero */ 921 922 } ACPI_MADT_LOCAL_X2APIC_NMI; 923 924 925 /* 11: Generic Interrupt (ACPI 5.0) */ 926 927 typedef struct acpi_madt_generic_interrupt 928 { 929 ACPI_SUBTABLE_HEADER Header; 930 UINT16 Reserved; /* Reserved - must be zero */ 931 UINT32 GicId; 932 UINT32 Uid; 933 UINT32 Flags; 934 UINT32 ParkingVersion; 935 UINT32 PerformanceInterrupt; 936 UINT64 ParkedAddress; 937 UINT64 BaseAddress; 938 939 } ACPI_MADT_GENERIC_INTERRUPT; 940 941 942 /* 12: Generic Distributor (ACPI 5.0) */ 943 944 typedef struct acpi_madt_generic_distributor 945 { 946 ACPI_SUBTABLE_HEADER Header; 947 UINT16 Reserved; /* Reserved - must be zero */ 948 UINT32 GicId; 949 UINT64 BaseAddress; 950 UINT32 GlobalIrqBase; 951 UINT32 Reserved2; /* Reserved - must be zero */ 952 953 } ACPI_MADT_GENERIC_DISTRIBUTOR; 954 955 956 /* 957 * Common flags fields for MADT subtables 958 */ 959 960 /* MADT Local APIC flags (LapicFlags) and GIC flags */ 961 962 #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 963 964 /* MADT MPS INTI flags (IntiFlags) */ 965 966 #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */ 967 #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */ 968 969 /* Values for MPS INTI flags */ 970 971 #define ACPI_MADT_POLARITY_CONFORMS 0 972 #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1 973 #define ACPI_MADT_POLARITY_RESERVED 2 974 #define ACPI_MADT_POLARITY_ACTIVE_LOW 3 975 976 #define ACPI_MADT_TRIGGER_CONFORMS (0) 977 #define ACPI_MADT_TRIGGER_EDGE (1<<2) 978 #define ACPI_MADT_TRIGGER_RESERVED (2<<2) 979 #define ACPI_MADT_TRIGGER_LEVEL (3<<2) 980 981 982 /******************************************************************************* 983 * 984 * MSCT - Maximum System Characteristics Table (ACPI 4.0) 985 * Version 1 986 * 987 ******************************************************************************/ 988 989 typedef struct acpi_table_msct 990 { 991 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 992 UINT32 ProximityOffset; /* Location of proximity info struct(s) */ 993 UINT32 MaxProximityDomains;/* Max number of proximity domains */ 994 UINT32 MaxClockDomains; /* Max number of clock domains */ 995 UINT64 MaxAddress; /* Max physical address in system */ 996 997 } ACPI_TABLE_MSCT; 998 999 1000 /* Subtable - Maximum Proximity Domain Information. Version 1 */ 1001 1002 typedef struct acpi_msct_proximity 1003 { 1004 UINT8 Revision; 1005 UINT8 Length; 1006 UINT32 RangeStart; /* Start of domain range */ 1007 UINT32 RangeEnd; /* End of domain range */ 1008 UINT32 ProcessorCapacity; 1009 UINT64 MemoryCapacity; /* In bytes */ 1010 1011 } ACPI_MSCT_PROXIMITY; 1012 1013 1014 /******************************************************************************* 1015 * 1016 * SBST - Smart Battery Specification Table 1017 * Version 1 1018 * 1019 ******************************************************************************/ 1020 1021 typedef struct acpi_table_sbst 1022 { 1023 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1024 UINT32 WarningLevel; 1025 UINT32 LowLevel; 1026 UINT32 CriticalLevel; 1027 1028 } ACPI_TABLE_SBST; 1029 1030 1031 /******************************************************************************* 1032 * 1033 * SLIT - System Locality Distance Information Table 1034 * Version 1 1035 * 1036 ******************************************************************************/ 1037 1038 typedef struct acpi_table_slit 1039 { 1040 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1041 UINT64 LocalityCount; 1042 UINT8 Entry[1]; /* Real size = localities^2 */ 1043 1044 } ACPI_TABLE_SLIT; 1045 1046 1047 /******************************************************************************* 1048 * 1049 * SRAT - System Resource Affinity Table 1050 * Version 3 1051 * 1052 ******************************************************************************/ 1053 1054 typedef struct acpi_table_srat 1055 { 1056 ACPI_TABLE_HEADER Header; /* Common ACPI table header */ 1057 UINT32 TableRevision; /* Must be value '1' */ 1058 UINT64 Reserved; /* Reserved, must be zero */ 1059 1060 } ACPI_TABLE_SRAT; 1061 1062 /* Values for subtable type in ACPI_SUBTABLE_HEADER */ 1063 1064 enum AcpiSratType 1065 { 1066 ACPI_SRAT_TYPE_CPU_AFFINITY = 0, 1067 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1, 1068 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2, 1069 ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */ 1070 }; 1071 1072 /* 1073 * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER 1074 */ 1075 1076 /* 0: Processor Local APIC/SAPIC Affinity */ 1077 1078 typedef struct acpi_srat_cpu_affinity 1079 { 1080 ACPI_SUBTABLE_HEADER Header; 1081 UINT8 ProximityDomainLo; 1082 UINT8 ApicId; 1083 UINT32 Flags; 1084 UINT8 LocalSapicEid; 1085 UINT8 ProximityDomainHi[3]; 1086 UINT32 Reserved; /* Reserved, must be zero */ 1087 1088 } ACPI_SRAT_CPU_AFFINITY; 1089 1090 /* Flags */ 1091 1092 #define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */ 1093 1094 1095 /* 1: Memory Affinity */ 1096 1097 typedef struct acpi_srat_mem_affinity 1098 { 1099 ACPI_SUBTABLE_HEADER Header; 1100 UINT32 ProximityDomain; 1101 UINT16 Reserved; /* Reserved, must be zero */ 1102 UINT64 BaseAddress; 1103 UINT64 Length; 1104 UINT32 Reserved1; 1105 UINT32 Flags; 1106 UINT64 Reserved2; /* Reserved, must be zero */ 1107 1108 } ACPI_SRAT_MEM_AFFINITY; 1109 1110 /* Flags */ 1111 1112 #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */ 1113 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */ 1114 #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */ 1115 1116 1117 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */ 1118 1119 typedef struct acpi_srat_x2apic_cpu_affinity 1120 { 1121 ACPI_SUBTABLE_HEADER Header; 1122 UINT16 Reserved; /* Reserved, must be zero */ 1123 UINT32 ProximityDomain; 1124 UINT32 ApicId; 1125 UINT32 Flags; 1126 UINT32 ClockDomain; 1127 UINT32 Reserved2; 1128 1129 } ACPI_SRAT_X2APIC_CPU_AFFINITY; 1130 1131 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */ 1132 1133 #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */ 1134 1135 1136 /* Reset to default packing */ 1137 1138 #pragma pack() 1139 1140 #endif /* __ACTBL1_H__ */ 1141