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