Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20131218
acpica-unix2-20130823
PANKOVs restructure
   1 /******************************************************************************
   2  *
   3  * Name: actbl1.h - Additional ACPI table definitions
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2011, 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.


  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 about bitfields: The UINT8 type is used for bitfields in ACPI tables.
  86  * This is the only type that is even remotely portable. Anything else is not
  87  * portable, so do not use any other bitfield types.






  88  */
  89 
  90 
  91 /*******************************************************************************
  92  *
  93  * Common subtable headers
  94  *
  95  ******************************************************************************/
  96 
  97 /* Generic subtable header (used in MADT, SRAT, etc.) */
  98 
  99 typedef struct acpi_subtable_header
 100 {
 101     UINT8                   Type;
 102     UINT8                   Length;
 103 
 104 } ACPI_SUBTABLE_HEADER;
 105 
 106 
 107 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */


 113     UINT8                   Flags;
 114     UINT8                   Reserved;
 115     ACPI_GENERIC_ADDRESS    RegisterRegion;
 116     UINT64                  Value;              /* Value used with Read/Write register */
 117     UINT64                  Mask;               /* Bitmask required for this register instruction */
 118 
 119 } ACPI_WHEA_HEADER;
 120 
 121 
 122 /*******************************************************************************
 123  *
 124  * BERT - Boot Error Record Table (ACPI 4.0)
 125  *        Version 1
 126  *
 127  ******************************************************************************/
 128 
 129 typedef struct acpi_table_bert
 130 {
 131     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 132     UINT32                  RegionLength;       /* Length of the boot error region */
 133     UINT64                  Address;            /* Physical addresss of the error region */
 134 
 135 } ACPI_TABLE_BERT;
 136 
 137 
 138 /* Boot Error Region (not a subtable, pointed to by Address field above) */
 139 
 140 typedef struct acpi_bert_region
 141 {
 142     UINT32                  BlockStatus;        /* Type of error information */
 143     UINT32                  RawDataOffset;      /* Offset to raw error data */
 144     UINT32                  RawDataLength;      /* Length of raw error data */
 145     UINT32                  DataLength;         /* Length of generic error data */
 146     UINT32                  ErrorSeverity;      /* Severity code */
 147 
 148 } ACPI_BERT_REGION;
 149 
 150 /* Values for BlockStatus flags above */
 151 
 152 #define ACPI_BERT_UNCORRECTABLE             (1)
 153 #define ACPI_BERT_CORRECTABLE               (1<<1)


 243     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
 244 
 245 } ACPI_EINJ_ENTRY;
 246 
 247 /* Masks for Flags field above */
 248 
 249 #define ACPI_EINJ_PRESERVE          (1)
 250 
 251 /* Values for Action field above */
 252 
 253 enum AcpiEinjActions
 254 {
 255     ACPI_EINJ_BEGIN_OPERATION       = 0,
 256     ACPI_EINJ_GET_TRIGGER_TABLE     = 1,
 257     ACPI_EINJ_SET_ERROR_TYPE        = 2,
 258     ACPI_EINJ_GET_ERROR_TYPE        = 3,
 259     ACPI_EINJ_END_OPERATION         = 4,
 260     ACPI_EINJ_EXECUTE_OPERATION     = 5,
 261     ACPI_EINJ_CHECK_BUSY_STATUS     = 6,
 262     ACPI_EINJ_GET_COMMAND_STATUS    = 7,
 263     ACPI_EINJ_ACTION_RESERVED       = 8,     /* 8 and greater are reserved */

 264     ACPI_EINJ_TRIGGER_ERROR         = 0xFF   /* Except for this value */
 265 };
 266 
 267 /* Values for Instruction field above */
 268 
 269 enum AcpiEinjInstructions
 270 {
 271     ACPI_EINJ_READ_REGISTER         = 0,
 272     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
 273     ACPI_EINJ_WRITE_REGISTER        = 2,
 274     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
 275     ACPI_EINJ_NOOP                  = 4,
 276     ACPI_EINJ_INSTRUCTION_RESERVED  = 5     /* 5 and greater are reserved */

 277 };
 278 









 279 














 280 /* EINJ Trigger Error Action Table */
 281 
 282 typedef struct acpi_einj_trigger
 283 {
 284     UINT32                  HeaderSize;
 285     UINT32                  Revision;
 286     UINT32                  TableSize;
 287     UINT32                  EntryCount;
 288 
 289 } ACPI_EINJ_TRIGGER;
 290 
 291 /* Command status return values */
 292 
 293 enum AcpiEinjCommandStatus
 294 {
 295     ACPI_EINJ_SUCCESS               = 0,
 296     ACPI_EINJ_FAILURE               = 1,
 297     ACPI_EINJ_INVALID_ACCESS        = 2,
 298     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
 299 };
 300 
 301 
 302 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
 303 
 304 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
 305 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
 306 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
 307 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
 308 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
 309 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
 310 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
 311 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
 312 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
 313 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
 314 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
 315 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)

 316 
 317 
 318 /*******************************************************************************
 319  *
 320  * ERST - Error Record Serialization Table (ACPI 4.0)
 321  *        Version 1
 322  *
 323  ******************************************************************************/
 324 
 325 typedef struct acpi_table_erst
 326 {
 327     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 328     UINT32                  HeaderLength;
 329     UINT32                  Reserved;
 330     UINT32                  Entries;
 331 
 332 } ACPI_TABLE_ERST;
 333 
 334 
 335 /* ERST Serialization Entries (actions) */


 475     UINT8                   StatusFormat;
 476     UINT8                   Reserved;
 477     UINT32                  ControlRegister;
 478     UINT64                  ControlData;
 479     UINT32                  StatusRegister;
 480     UINT32                  AddressRegister;
 481     UINT32                  MiscRegister;
 482 
 483 } ACPI_HEST_IA_ERROR_BANK;
 484 
 485 
 486 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
 487 
 488 typedef struct acpi_hest_aer_common
 489 {
 490     UINT16                  Reserved1;
 491     UINT8                   Flags;
 492     UINT8                   Enabled;
 493     UINT32                  RecordsToPreallocate;
 494     UINT32                  MaxSectionsPerRecord;
 495     UINT32                  Bus;
 496     UINT16                  Device;
 497     UINT16                  Function;
 498     UINT16                  DeviceControl;
 499     UINT16                  Reserved2;
 500     UINT32                  UncorrectableMask;
 501     UINT32                  UncorrectableSeverity;
 502     UINT32                  CorrectableMask;
 503     UINT32                  AdvancedCapabilities;
 504 
 505 } ACPI_HEST_AER_COMMON;
 506 
 507 /* Masks for HEST Flags fields */
 508 
 509 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 510 #define ACPI_HEST_GLOBAL                (1<<1)
 511 







 512 

 513 /* Hardware Error Notification */
 514 
 515 typedef struct acpi_hest_notify
 516 {
 517     UINT8                   Type;
 518     UINT8                   Length;
 519     UINT16                  ConfigWriteEnable;
 520     UINT32                  PollInterval;
 521     UINT32                  Vector;
 522     UINT32                  PollingThresholdValue;
 523     UINT32                  PollingThresholdWindow;
 524     UINT32                  ErrorThresholdValue;
 525     UINT32                  ErrorThresholdWindow;
 526 
 527 } ACPI_HEST_NOTIFY;
 528 
 529 /* Values for Notify Type field above */
 530 
 531 enum AcpiHestNotifyTypes
 532 {
 533     ACPI_HEST_NOTIFY_POLLED     = 0,
 534     ACPI_HEST_NOTIFY_EXTERNAL   = 1,
 535     ACPI_HEST_NOTIFY_LOCAL      = 2,
 536     ACPI_HEST_NOTIFY_SCI        = 3,
 537     ACPI_HEST_NOTIFY_NMI        = 4,
 538     ACPI_HEST_NOTIFY_RESERVED   = 5     /* 5 and greater are reserved */


 539 };
 540 
 541 /* Values for ConfigWriteEnable bitfield above */
 542 
 543 #define ACPI_HEST_TYPE                  (1)
 544 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
 545 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
 546 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
 547 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
 548 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
 549 
 550 
 551 /*
 552  * HEST subtables
 553  */
 554 
 555 /* 0: IA32 Machine Check Exception */
 556 
 557 typedef struct acpi_hest_ia_machine_check
 558 {


 714 
 715 #define ACPI_MADT_DUAL_PIC          0
 716 #define ACPI_MADT_MULTIPLE_APIC     1
 717 
 718 
 719 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
 720 
 721 enum AcpiMadtType
 722 {
 723     ACPI_MADT_TYPE_LOCAL_APIC           = 0,
 724     ACPI_MADT_TYPE_IO_APIC              = 1,
 725     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
 726     ACPI_MADT_TYPE_NMI_SOURCE           = 3,
 727     ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
 728     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
 729     ACPI_MADT_TYPE_IO_SAPIC             = 6,
 730     ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
 731     ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
 732     ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
 733     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
 734     ACPI_MADT_TYPE_RESERVED             = 11    /* 11 and greater are reserved */


 735 };
 736 
 737 
 738 /*
 739  * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
 740  */
 741 
 742 /* 0: Processor Local APIC */
 743 
 744 typedef struct acpi_madt_local_apic
 745 {
 746     ACPI_SUBTABLE_HEADER    Header;
 747     UINT8                   ProcessorId;        /* ACPI processor id */
 748     UINT8                   Id;                 /* Processor's local APIC id */
 749     UINT32                  LapicFlags;
 750 
 751 } ACPI_MADT_LOCAL_APIC;
 752 
 753 
 754 /* 1: IO APIC */


 869     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
 870     UINT32                  LapicFlags;
 871     UINT32                  Uid;                /* ACPI processor UID */
 872 
 873 } ACPI_MADT_LOCAL_X2APIC;
 874 
 875 
 876 /* 10: Local X2APIC NMI (ACPI 4.0) */
 877 
 878 typedef struct acpi_madt_local_x2apic_nmi
 879 {
 880     ACPI_SUBTABLE_HEADER    Header;
 881     UINT16                  IntiFlags;
 882     UINT32                  Uid;                /* ACPI processor UID */
 883     UINT8                   Lint;               /* LINTn to which NMI is connected */
 884     UINT8                   Reserved[3];        /* Reserved - must be zero */
 885 
 886 } ACPI_MADT_LOCAL_X2APIC_NMI;
 887 
 888 































 889 /*
 890  * Common flags fields for MADT subtables
 891  */
 892 
 893 /* MADT Local APIC flags (LapicFlags) */
 894 
 895 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 896 
 897 /* MADT MPS INTI flags (IntiFlags) */
 898 
 899 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
 900 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
 901 
 902 /* Values for MPS INTI flags */
 903 
 904 #define ACPI_MADT_POLARITY_CONFORMS       0
 905 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
 906 #define ACPI_MADT_POLARITY_RESERVED       2
 907 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
 908 
 909 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
 910 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
 911 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
 912 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
 913 


   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.


  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) */


 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)


 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) */


 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 {


 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 */


 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