1 /******************************************************************************
   2  *
   3  * Name: actbl1.h - Additional ACPI table definitions
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2013, 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_RESERVED             = 13    /* 13 and greater are reserved */
 779 };
 780 
 781 
 782 /*
 783  * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
 784  */
 785 
 786 /* 0: Processor Local APIC */
 787 
 788 typedef struct acpi_madt_local_apic
 789 {
 790     ACPI_SUBTABLE_HEADER    Header;
 791     UINT8                   ProcessorId;        /* ACPI processor id */
 792     UINT8                   Id;                 /* Processor's local APIC id */
 793     UINT32                  LapicFlags;
 794 
 795 } ACPI_MADT_LOCAL_APIC;
 796 
 797 
 798 /* 1: IO APIC */
 799 
 800 typedef struct acpi_madt_io_apic
 801 {
 802     ACPI_SUBTABLE_HEADER    Header;
 803     UINT8                   Id;                 /* I/O APIC ID */
 804     UINT8                   Reserved;           /* Reserved - must be zero */
 805     UINT32                  Address;            /* APIC physical address */
 806     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
 807 
 808 } ACPI_MADT_IO_APIC;
 809 
 810 
 811 /* 2: Interrupt Override */
 812 
 813 typedef struct acpi_madt_interrupt_override
 814 {
 815     ACPI_SUBTABLE_HEADER    Header;
 816     UINT8                   Bus;                /* 0 - ISA */
 817     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
 818     UINT32                  GlobalIrq;          /* Global system interrupt */
 819     UINT16                  IntiFlags;
 820 
 821 } ACPI_MADT_INTERRUPT_OVERRIDE;
 822 
 823 
 824 /* 3: NMI Source */
 825 
 826 typedef struct acpi_madt_nmi_source
 827 {
 828     ACPI_SUBTABLE_HEADER    Header;
 829     UINT16                  IntiFlags;
 830     UINT32                  GlobalIrq;          /* Global system interrupt */
 831 
 832 } ACPI_MADT_NMI_SOURCE;
 833 
 834 
 835 /* 4: Local APIC NMI */
 836 
 837 typedef struct acpi_madt_local_apic_nmi
 838 {
 839     ACPI_SUBTABLE_HEADER    Header;
 840     UINT8                   ProcessorId;        /* ACPI processor id */
 841     UINT16                  IntiFlags;
 842     UINT8                   Lint;               /* LINTn to which NMI is connected */
 843 
 844 } ACPI_MADT_LOCAL_APIC_NMI;
 845 
 846 
 847 /* 5: Address Override */
 848 
 849 typedef struct acpi_madt_local_apic_override
 850 {
 851     ACPI_SUBTABLE_HEADER    Header;
 852     UINT16                  Reserved;           /* Reserved, must be zero */
 853     UINT64                  Address;            /* APIC physical address */
 854 
 855 } ACPI_MADT_LOCAL_APIC_OVERRIDE;
 856 
 857 
 858 /* 6: I/O Sapic */
 859 
 860 typedef struct acpi_madt_io_sapic
 861 {
 862     ACPI_SUBTABLE_HEADER    Header;
 863     UINT8                   Id;                 /* I/O SAPIC ID */
 864     UINT8                   Reserved;           /* Reserved, must be zero */
 865     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
 866     UINT64                  Address;            /* SAPIC physical address */
 867 
 868 } ACPI_MADT_IO_SAPIC;
 869 
 870 
 871 /* 7: Local Sapic */
 872 
 873 typedef struct acpi_madt_local_sapic
 874 {
 875     ACPI_SUBTABLE_HEADER    Header;
 876     UINT8                   ProcessorId;        /* ACPI processor id */
 877     UINT8                   Id;                 /* SAPIC ID */
 878     UINT8                   Eid;                /* SAPIC EID */
 879     UINT8                   Reserved[3];        /* Reserved, must be zero */
 880     UINT32                  LapicFlags;
 881     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
 882     char                    UidString[1];       /* String UID  - ACPI 3.0 */
 883 
 884 } ACPI_MADT_LOCAL_SAPIC;
 885 
 886 
 887 /* 8: Platform Interrupt Source */
 888 
 889 typedef struct acpi_madt_interrupt_source
 890 {
 891     ACPI_SUBTABLE_HEADER    Header;
 892     UINT16                  IntiFlags;
 893     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
 894     UINT8                   Id;                 /* Processor ID */
 895     UINT8                   Eid;                /* Processor EID */
 896     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
 897     UINT32                  GlobalIrq;          /* Global system interrupt */
 898     UINT32                  Flags;              /* Interrupt Source Flags */
 899 
 900 } ACPI_MADT_INTERRUPT_SOURCE;
 901 
 902 /* Masks for Flags field above */
 903 
 904 #define ACPI_MADT_CPEI_OVERRIDE     (1)
 905 
 906 
 907 /* 9: Processor Local X2APIC (ACPI 4.0) */
 908 
 909 typedef struct acpi_madt_local_x2apic
 910 {
 911     ACPI_SUBTABLE_HEADER    Header;
 912     UINT16                  Reserved;           /* Reserved - must be zero */
 913     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
 914     UINT32                  LapicFlags;
 915     UINT32                  Uid;                /* ACPI processor UID */
 916 
 917 } ACPI_MADT_LOCAL_X2APIC;
 918 
 919 
 920 /* 10: Local X2APIC NMI (ACPI 4.0) */
 921 
 922 typedef struct acpi_madt_local_x2apic_nmi
 923 {
 924     ACPI_SUBTABLE_HEADER    Header;
 925     UINT16                  IntiFlags;
 926     UINT32                  Uid;                /* ACPI processor UID */
 927     UINT8                   Lint;               /* LINTn to which NMI is connected */
 928     UINT8                   Reserved[3];        /* Reserved - must be zero */
 929 
 930 } ACPI_MADT_LOCAL_X2APIC_NMI;
 931 
 932 
 933 /* 11: Generic Interrupt (ACPI 5.0) */
 934 
 935 typedef struct acpi_madt_generic_interrupt
 936 {
 937     ACPI_SUBTABLE_HEADER    Header;
 938     UINT16                  Reserved;           /* Reserved - must be zero */
 939     UINT32                  GicId;
 940     UINT32                  Uid;
 941     UINT32                  Flags;
 942     UINT32                  ParkingVersion;
 943     UINT32                  PerformanceInterrupt;
 944     UINT64                  ParkedAddress;
 945     UINT64                  BaseAddress;
 946 
 947 } ACPI_MADT_GENERIC_INTERRUPT;
 948 
 949 
 950 /* 12: Generic Distributor (ACPI 5.0) */
 951 
 952 typedef struct acpi_madt_generic_distributor
 953 {
 954     ACPI_SUBTABLE_HEADER    Header;
 955     UINT16                  Reserved;           /* Reserved - must be zero */
 956     UINT32                  GicId;
 957     UINT64                  BaseAddress;
 958     UINT32                  GlobalIrqBase;
 959     UINT32                  Reserved2;          /* Reserved - must be zero */
 960 
 961 } ACPI_MADT_GENERIC_DISTRIBUTOR;
 962 
 963 
 964 /*
 965  * Common flags fields for MADT subtables
 966  */
 967 
 968 /* MADT Local APIC flags (LapicFlags) and GIC flags */
 969 
 970 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 971 
 972 /* MADT MPS INTI flags (IntiFlags) */
 973 
 974 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
 975 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
 976 
 977 /* Values for MPS INTI flags */
 978 
 979 #define ACPI_MADT_POLARITY_CONFORMS       0
 980 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
 981 #define ACPI_MADT_POLARITY_RESERVED       2
 982 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
 983 
 984 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
 985 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
 986 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
 987 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
 988 
 989 
 990 /*******************************************************************************
 991  *
 992  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
 993  *        Version 1
 994  *
 995  ******************************************************************************/
 996 
 997 typedef struct acpi_table_msct
 998 {
 999     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1000     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
1001     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
1002     UINT32                  MaxClockDomains;    /* Max number of clock domains */
1003     UINT64                  MaxAddress;         /* Max physical address in system */
1004 
1005 } ACPI_TABLE_MSCT;
1006 
1007 
1008 /* Subtable - Maximum Proximity Domain Information. Version 1 */
1009 
1010 typedef struct acpi_msct_proximity
1011 {
1012     UINT8                   Revision;
1013     UINT8                   Length;
1014     UINT32                  RangeStart;         /* Start of domain range */
1015     UINT32                  RangeEnd;           /* End of domain range */
1016     UINT32                  ProcessorCapacity;
1017     UINT64                  MemoryCapacity;     /* In bytes */
1018 
1019 } ACPI_MSCT_PROXIMITY;
1020 
1021 
1022 /*******************************************************************************
1023  *
1024  * SBST - Smart Battery Specification Table
1025  *        Version 1
1026  *
1027  ******************************************************************************/
1028 
1029 typedef struct acpi_table_sbst
1030 {
1031     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1032     UINT32                  WarningLevel;
1033     UINT32                  LowLevel;
1034     UINT32                  CriticalLevel;
1035 
1036 } ACPI_TABLE_SBST;
1037 
1038 
1039 /*******************************************************************************
1040  *
1041  * SLIT - System Locality Distance Information Table
1042  *        Version 1
1043  *
1044  ******************************************************************************/
1045 
1046 typedef struct acpi_table_slit
1047 {
1048     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1049     UINT64                  LocalityCount;
1050     UINT8                   Entry[1];           /* Real size = localities^2 */
1051 
1052 } ACPI_TABLE_SLIT;
1053 
1054 
1055 /*******************************************************************************
1056  *
1057  * SRAT - System Resource Affinity Table
1058  *        Version 3
1059  *
1060  ******************************************************************************/
1061 
1062 typedef struct acpi_table_srat
1063 {
1064     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1065     UINT32                  TableRevision;      /* Must be value '1' */
1066     UINT64                  Reserved;           /* Reserved, must be zero */
1067 
1068 } ACPI_TABLE_SRAT;
1069 
1070 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1071 
1072 enum AcpiSratType
1073 {
1074     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1075     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1076     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1077     ACPI_SRAT_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
1078 };
1079 
1080 /*
1081  * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
1082  */
1083 
1084 /* 0: Processor Local APIC/SAPIC Affinity */
1085 
1086 typedef struct acpi_srat_cpu_affinity
1087 {
1088     ACPI_SUBTABLE_HEADER    Header;
1089     UINT8                   ProximityDomainLo;
1090     UINT8                   ApicId;
1091     UINT32                  Flags;
1092     UINT8                   LocalSapicEid;
1093     UINT8                   ProximityDomainHi[3];
1094     UINT32                  Reserved;           /* Reserved, must be zero */
1095 
1096 } ACPI_SRAT_CPU_AFFINITY;
1097 
1098 /* Flags */
1099 
1100 #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
1101 
1102 
1103 /* 1: Memory Affinity */
1104 
1105 typedef struct acpi_srat_mem_affinity
1106 {
1107     ACPI_SUBTABLE_HEADER    Header;
1108     UINT32                  ProximityDomain;
1109     UINT16                  Reserved;           /* Reserved, must be zero */
1110     UINT64                  BaseAddress;
1111     UINT64                  Length;
1112     UINT32                  Reserved1;
1113     UINT32                  Flags;
1114     UINT64                  Reserved2;          /* Reserved, must be zero */
1115 
1116 } ACPI_SRAT_MEM_AFFINITY;
1117 
1118 /* Flags */
1119 
1120 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1121 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1122 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1123 
1124 
1125 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1126 
1127 typedef struct acpi_srat_x2apic_cpu_affinity
1128 {
1129     ACPI_SUBTABLE_HEADER    Header;
1130     UINT16                  Reserved;           /* Reserved, must be zero */
1131     UINT32                  ProximityDomain;
1132     UINT32                  ApicId;
1133     UINT32                  Flags;
1134     UINT32                  ClockDomain;
1135     UINT32                  Reserved2;
1136 
1137 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1138 
1139 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1140 
1141 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1142 
1143 
1144 /* Reset to default packing */
1145 
1146 #pragma pack()
1147 
1148 #endif /* __ACTBL1_H__ */