Home | History | Annotate | Line # | Download | only in include
actbl1.h revision 1.11
      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.10  christos  * 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.11  christos #define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
     71   1.1    jruoho #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
     72   1.1    jruoho #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
     73   1.1    jruoho #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
     74  1.11  christos #define ACPI_SIG_PDTT           "PDTT"      /* Processor Debug Trigger Table */
     75  1.11  christos #define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
     76   1.1    jruoho #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
     77   1.1    jruoho #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
     78   1.1    jruoho #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
     79   1.7  christos #define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
     80   1.1    jruoho 
     81   1.1    jruoho 
     82   1.1    jruoho /*
     83   1.1    jruoho  * All tables must be byte-packed to match the ACPI specification, since
     84   1.1    jruoho  * the tables are provided by the system BIOS.
     85   1.1    jruoho  */
     86   1.1    jruoho #pragma pack(1)
     87   1.1    jruoho 
     88   1.1    jruoho /*
     89   1.4  christos  * Note: C bitfields are not used for this reason:
     90   1.4  christos  *
     91   1.4  christos  * "Bitfields are great and easy to read, but unfortunately the C language
     92   1.4  christos  * does not specify the layout of bitfields in memory, which means they are
     93   1.4  christos  * essentially useless for dealing with packed data in on-disk formats or
     94   1.4  christos  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
     95   1.4  christos  * this decision was a design error in C. Ritchie could have picked an order
     96   1.4  christos  * and stuck with it." Norman Ramsey.
     97   1.4  christos  * See http://stackoverflow.com/a/1053662/41661
     98   1.1    jruoho  */
     99   1.1    jruoho 
    100   1.1    jruoho 
    101   1.1    jruoho /*******************************************************************************
    102   1.1    jruoho  *
    103   1.1    jruoho  * Common subtable headers
    104   1.1    jruoho  *
    105   1.1    jruoho  ******************************************************************************/
    106   1.1    jruoho 
    107   1.1    jruoho /* Generic subtable header (used in MADT, SRAT, etc.) */
    108   1.1    jruoho 
    109   1.1    jruoho typedef struct acpi_subtable_header
    110   1.1    jruoho {
    111   1.1    jruoho     UINT8                   Type;
    112   1.1    jruoho     UINT8                   Length;
    113   1.1    jruoho 
    114   1.1    jruoho } ACPI_SUBTABLE_HEADER;
    115   1.1    jruoho 
    116   1.1    jruoho 
    117   1.1    jruoho /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
    118   1.1    jruoho 
    119   1.1    jruoho typedef struct acpi_whea_header
    120   1.1    jruoho {
    121   1.1    jruoho     UINT8                   Action;
    122   1.1    jruoho     UINT8                   Instruction;
    123   1.1    jruoho     UINT8                   Flags;
    124   1.1    jruoho     UINT8                   Reserved;
    125   1.1    jruoho     ACPI_GENERIC_ADDRESS    RegisterRegion;
    126   1.1    jruoho     UINT64                  Value;              /* Value used with Read/Write register */
    127   1.1    jruoho     UINT64                  Mask;               /* Bitmask required for this register instruction */
    128   1.1    jruoho 
    129   1.1    jruoho } ACPI_WHEA_HEADER;
    130   1.1    jruoho 
    131   1.1    jruoho 
    132   1.1    jruoho /*******************************************************************************
    133   1.1    jruoho  *
    134   1.1    jruoho  * BERT - Boot Error Record Table (ACPI 4.0)
    135   1.1    jruoho  *        Version 1
    136   1.1    jruoho  *
    137   1.1    jruoho  ******************************************************************************/
    138   1.1    jruoho 
    139   1.1    jruoho typedef struct acpi_table_bert
    140   1.1    jruoho {
    141   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    142   1.1    jruoho     UINT32                  RegionLength;       /* Length of the boot error region */
    143   1.4  christos     UINT64                  Address;            /* Physical address of the error region */
    144   1.1    jruoho 
    145   1.1    jruoho } ACPI_TABLE_BERT;
    146   1.1    jruoho 
    147   1.1    jruoho 
    148   1.1    jruoho /* Boot Error Region (not a subtable, pointed to by Address field above) */
    149   1.1    jruoho 
    150   1.1    jruoho typedef struct acpi_bert_region
    151   1.1    jruoho {
    152   1.1    jruoho     UINT32                  BlockStatus;        /* Type of error information */
    153   1.1    jruoho     UINT32                  RawDataOffset;      /* Offset to raw error data */
    154   1.1    jruoho     UINT32                  RawDataLength;      /* Length of raw error data */
    155   1.1    jruoho     UINT32                  DataLength;         /* Length of generic error data */
    156   1.1    jruoho     UINT32                  ErrorSeverity;      /* Severity code */
    157   1.1    jruoho 
    158   1.1    jruoho } ACPI_BERT_REGION;
    159   1.1    jruoho 
    160   1.1    jruoho /* Values for BlockStatus flags above */
    161   1.1    jruoho 
    162   1.1    jruoho #define ACPI_BERT_UNCORRECTABLE             (1)
    163   1.1    jruoho #define ACPI_BERT_CORRECTABLE               (1<<1)
    164   1.1    jruoho #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
    165   1.1    jruoho #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
    166   1.1    jruoho #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
    167   1.1    jruoho 
    168   1.1    jruoho /* Values for ErrorSeverity above */
    169   1.1    jruoho 
    170   1.1    jruoho enum AcpiBertErrorSeverity
    171   1.1    jruoho {
    172   1.1    jruoho     ACPI_BERT_ERROR_CORRECTABLE     = 0,
    173   1.1    jruoho     ACPI_BERT_ERROR_FATAL           = 1,
    174   1.1    jruoho     ACPI_BERT_ERROR_CORRECTED       = 2,
    175   1.1    jruoho     ACPI_BERT_ERROR_NONE            = 3,
    176   1.1    jruoho     ACPI_BERT_ERROR_RESERVED        = 4     /* 4 and greater are reserved */
    177   1.1    jruoho };
    178   1.1    jruoho 
    179   1.1    jruoho /*
    180   1.1    jruoho  * Note: The generic error data that follows the ErrorSeverity field above
    181   1.1    jruoho  * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
    182   1.1    jruoho  */
    183   1.1    jruoho 
    184   1.1    jruoho 
    185   1.1    jruoho /*******************************************************************************
    186   1.1    jruoho  *
    187   1.1    jruoho  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
    188   1.1    jruoho  *        Version 1
    189   1.1    jruoho  *
    190   1.1    jruoho  ******************************************************************************/
    191   1.1    jruoho 
    192   1.1    jruoho typedef struct acpi_table_cpep
    193   1.1    jruoho {
    194   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    195   1.1    jruoho     UINT64                  Reserved;
    196   1.1    jruoho 
    197   1.1    jruoho } ACPI_TABLE_CPEP;
    198   1.1    jruoho 
    199   1.1    jruoho 
    200   1.1    jruoho /* Subtable */
    201   1.1    jruoho 
    202   1.1    jruoho typedef struct acpi_cpep_polling
    203   1.1    jruoho {
    204   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
    205   1.1    jruoho     UINT8                   Id;                 /* Processor ID */
    206   1.1    jruoho     UINT8                   Eid;                /* Processor EID */
    207   1.1    jruoho     UINT32                  Interval;           /* Polling interval (msec) */
    208   1.1    jruoho 
    209   1.1    jruoho } ACPI_CPEP_POLLING;
    210   1.1    jruoho 
    211   1.1    jruoho 
    212   1.1    jruoho /*******************************************************************************
    213   1.1    jruoho  *
    214   1.1    jruoho  * ECDT - Embedded Controller Boot Resources Table
    215   1.1    jruoho  *        Version 1
    216   1.1    jruoho  *
    217   1.1    jruoho  ******************************************************************************/
    218   1.1    jruoho 
    219   1.1    jruoho typedef struct acpi_table_ecdt
    220   1.1    jruoho {
    221   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    222   1.1    jruoho     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
    223   1.1    jruoho     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
    224   1.1    jruoho     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
    225   1.1    jruoho     UINT8                   Gpe;                /* The GPE for the EC */
    226   1.1    jruoho     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
    227   1.1    jruoho 
    228   1.1    jruoho } ACPI_TABLE_ECDT;
    229   1.1    jruoho 
    230   1.1    jruoho 
    231   1.1    jruoho /*******************************************************************************
    232   1.1    jruoho  *
    233   1.1    jruoho  * EINJ - Error Injection Table (ACPI 4.0)
    234   1.1    jruoho  *        Version 1
    235   1.1    jruoho  *
    236   1.1    jruoho  ******************************************************************************/
    237   1.1    jruoho 
    238   1.1    jruoho typedef struct acpi_table_einj
    239   1.1    jruoho {
    240   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    241   1.1    jruoho     UINT32                  HeaderLength;
    242   1.1    jruoho     UINT8                   Flags;
    243   1.1    jruoho     UINT8                   Reserved[3];
    244   1.1    jruoho     UINT32                  Entries;
    245   1.1    jruoho 
    246   1.1    jruoho } ACPI_TABLE_EINJ;
    247   1.1    jruoho 
    248   1.1    jruoho 
    249   1.1    jruoho /* EINJ Injection Instruction Entries (actions) */
    250   1.1    jruoho 
    251   1.1    jruoho typedef struct acpi_einj_entry
    252   1.1    jruoho {
    253   1.1    jruoho     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
    254   1.1    jruoho 
    255   1.1    jruoho } ACPI_EINJ_ENTRY;
    256   1.1    jruoho 
    257   1.1    jruoho /* Masks for Flags field above */
    258   1.1    jruoho 
    259   1.1    jruoho #define ACPI_EINJ_PRESERVE          (1)
    260   1.1    jruoho 
    261   1.1    jruoho /* Values for Action field above */
    262   1.1    jruoho 
    263   1.1    jruoho enum AcpiEinjActions
    264   1.1    jruoho {
    265   1.4  christos     ACPI_EINJ_BEGIN_OPERATION               = 0,
    266   1.4  christos     ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
    267   1.4  christos     ACPI_EINJ_SET_ERROR_TYPE                = 2,
    268   1.4  christos     ACPI_EINJ_GET_ERROR_TYPE                = 3,
    269   1.4  christos     ACPI_EINJ_END_OPERATION                 = 4,
    270   1.4  christos     ACPI_EINJ_EXECUTE_OPERATION             = 5,
    271   1.4  christos     ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
    272   1.4  christos     ACPI_EINJ_GET_COMMAND_STATUS            = 7,
    273   1.4  christos     ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
    274   1.9  christos     ACPI_EINJ_GET_EXECUTE_TIMINGS           = 9,
    275   1.9  christos     ACPI_EINJ_ACTION_RESERVED               = 10,    /* 10 and greater are reserved */
    276   1.4  christos     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
    277   1.1    jruoho };
    278   1.1    jruoho 
    279   1.1    jruoho /* Values for Instruction field above */
    280   1.1    jruoho 
    281   1.1    jruoho enum AcpiEinjInstructions
    282   1.1    jruoho {
    283   1.1    jruoho     ACPI_EINJ_READ_REGISTER         = 0,
    284   1.1    jruoho     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
    285   1.1    jruoho     ACPI_EINJ_WRITE_REGISTER        = 2,
    286   1.1    jruoho     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
    287   1.1    jruoho     ACPI_EINJ_NOOP                  = 4,
    288   1.4  christos     ACPI_EINJ_FLUSH_CACHELINE       = 5,
    289   1.4  christos     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
    290   1.1    jruoho };
    291   1.1    jruoho 
    292   1.4  christos typedef struct acpi_einj_error_type_with_addr
    293   1.4  christos {
    294   1.4  christos     UINT32                  ErrorType;
    295   1.4  christos     UINT32                  VendorStructOffset;
    296   1.4  christos     UINT32                  Flags;
    297   1.4  christos     UINT32                  ApicId;
    298   1.4  christos     UINT64                  Address;
    299   1.4  christos     UINT64                  Range;
    300   1.4  christos     UINT32                  PcieId;
    301   1.4  christos 
    302   1.4  christos } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
    303   1.4  christos 
    304   1.4  christos typedef struct acpi_einj_vendor
    305   1.4  christos {
    306   1.4  christos     UINT32                  Length;
    307   1.4  christos     UINT32                  PcieId;
    308   1.4  christos     UINT16                  VendorId;
    309   1.4  christos     UINT16                  DeviceId;
    310   1.4  christos     UINT8                   RevisionId;
    311   1.4  christos     UINT8                   Reserved[3];
    312   1.4  christos 
    313   1.4  christos } ACPI_EINJ_VENDOR;
    314   1.4  christos 
    315   1.1    jruoho 
    316   1.1    jruoho /* EINJ Trigger Error Action Table */
    317   1.1    jruoho 
    318   1.1    jruoho typedef struct acpi_einj_trigger
    319   1.1    jruoho {
    320   1.1    jruoho     UINT32                  HeaderSize;
    321   1.1    jruoho     UINT32                  Revision;
    322   1.1    jruoho     UINT32                  TableSize;
    323   1.1    jruoho     UINT32                  EntryCount;
    324   1.1    jruoho 
    325   1.1    jruoho } ACPI_EINJ_TRIGGER;
    326   1.1    jruoho 
    327   1.1    jruoho /* Command status return values */
    328   1.1    jruoho 
    329   1.1    jruoho enum AcpiEinjCommandStatus
    330   1.1    jruoho {
    331   1.1    jruoho     ACPI_EINJ_SUCCESS               = 0,
    332   1.1    jruoho     ACPI_EINJ_FAILURE               = 1,
    333   1.1    jruoho     ACPI_EINJ_INVALID_ACCESS        = 2,
    334   1.1    jruoho     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
    335   1.1    jruoho };
    336   1.1    jruoho 
    337   1.1    jruoho 
    338   1.1    jruoho /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
    339   1.1    jruoho 
    340   1.1    jruoho #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
    341   1.1    jruoho #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
    342   1.1    jruoho #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
    343   1.1    jruoho #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
    344   1.1    jruoho #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
    345   1.1    jruoho #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
    346   1.1    jruoho #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
    347   1.1    jruoho #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
    348   1.1    jruoho #define ACPI_EINJ_PCIX_FATAL                (1<<8)
    349   1.1    jruoho #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
    350   1.1    jruoho #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
    351   1.1    jruoho #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
    352   1.4  christos #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
    353   1.1    jruoho 
    354   1.1    jruoho 
    355   1.1    jruoho /*******************************************************************************
    356   1.1    jruoho  *
    357   1.1    jruoho  * ERST - Error Record Serialization Table (ACPI 4.0)
    358   1.1    jruoho  *        Version 1
    359   1.1    jruoho  *
    360   1.1    jruoho  ******************************************************************************/
    361   1.1    jruoho 
    362   1.1    jruoho typedef struct acpi_table_erst
    363   1.1    jruoho {
    364   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    365   1.1    jruoho     UINT32                  HeaderLength;
    366   1.1    jruoho     UINT32                  Reserved;
    367   1.1    jruoho     UINT32                  Entries;
    368   1.1    jruoho 
    369   1.1    jruoho } ACPI_TABLE_ERST;
    370   1.1    jruoho 
    371   1.1    jruoho 
    372   1.1    jruoho /* ERST Serialization Entries (actions) */
    373   1.1    jruoho 
    374   1.1    jruoho typedef struct acpi_erst_entry
    375   1.1    jruoho {
    376   1.1    jruoho     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
    377   1.1    jruoho 
    378   1.1    jruoho } ACPI_ERST_ENTRY;
    379   1.1    jruoho 
    380   1.1    jruoho /* Masks for Flags field above */
    381   1.1    jruoho 
    382   1.1    jruoho #define ACPI_ERST_PRESERVE          (1)
    383   1.1    jruoho 
    384   1.1    jruoho /* Values for Action field above */
    385   1.1    jruoho 
    386   1.1    jruoho enum AcpiErstActions
    387   1.1    jruoho {
    388   1.1    jruoho     ACPI_ERST_BEGIN_WRITE           = 0,
    389   1.1    jruoho     ACPI_ERST_BEGIN_READ            = 1,
    390   1.1    jruoho     ACPI_ERST_BEGIN_CLEAR           = 2,
    391   1.1    jruoho     ACPI_ERST_END                   = 3,
    392   1.1    jruoho     ACPI_ERST_SET_RECORD_OFFSET     = 4,
    393   1.1    jruoho     ACPI_ERST_EXECUTE_OPERATION     = 5,
    394   1.1    jruoho     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
    395   1.1    jruoho     ACPI_ERST_GET_COMMAND_STATUS    = 7,
    396   1.1    jruoho     ACPI_ERST_GET_RECORD_ID         = 8,
    397   1.1    jruoho     ACPI_ERST_SET_RECORD_ID         = 9,
    398   1.1    jruoho     ACPI_ERST_GET_RECORD_COUNT      = 10,
    399   1.1    jruoho     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
    400   1.1    jruoho     ACPI_ERST_NOT_USED              = 12,
    401   1.1    jruoho     ACPI_ERST_GET_ERROR_RANGE       = 13,
    402   1.1    jruoho     ACPI_ERST_GET_ERROR_LENGTH      = 14,
    403   1.1    jruoho     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
    404   1.9  christos     ACPI_ERST_EXECUTE_TIMINGS       = 16,
    405   1.9  christos     ACPI_ERST_ACTION_RESERVED       = 17    /* 17 and greater are reserved */
    406   1.1    jruoho };
    407   1.1    jruoho 
    408   1.1    jruoho /* Values for Instruction field above */
    409   1.1    jruoho 
    410   1.1    jruoho enum AcpiErstInstructions
    411   1.1    jruoho {
    412   1.1    jruoho     ACPI_ERST_READ_REGISTER         = 0,
    413   1.1    jruoho     ACPI_ERST_READ_REGISTER_VALUE   = 1,
    414   1.1    jruoho     ACPI_ERST_WRITE_REGISTER        = 2,
    415   1.1    jruoho     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
    416   1.1    jruoho     ACPI_ERST_NOOP                  = 4,
    417   1.1    jruoho     ACPI_ERST_LOAD_VAR1             = 5,
    418   1.1    jruoho     ACPI_ERST_LOAD_VAR2             = 6,
    419   1.1    jruoho     ACPI_ERST_STORE_VAR1            = 7,
    420   1.1    jruoho     ACPI_ERST_ADD                   = 8,
    421   1.1    jruoho     ACPI_ERST_SUBTRACT              = 9,
    422   1.1    jruoho     ACPI_ERST_ADD_VALUE             = 10,
    423   1.1    jruoho     ACPI_ERST_SUBTRACT_VALUE        = 11,
    424   1.1    jruoho     ACPI_ERST_STALL                 = 12,
    425   1.1    jruoho     ACPI_ERST_STALL_WHILE_TRUE      = 13,
    426   1.1    jruoho     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
    427   1.1    jruoho     ACPI_ERST_GOTO                  = 15,
    428   1.1    jruoho     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
    429   1.1    jruoho     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
    430   1.1    jruoho     ACPI_ERST_MOVE_DATA             = 18,
    431   1.1    jruoho     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
    432   1.1    jruoho };
    433   1.1    jruoho 
    434   1.1    jruoho /* Command status return values */
    435   1.1    jruoho 
    436   1.1    jruoho enum AcpiErstCommandStatus
    437   1.1    jruoho {
    438   1.1    jruoho     ACPI_ERST_SUCESS                = 0,
    439   1.1    jruoho     ACPI_ERST_NO_SPACE              = 1,
    440   1.1    jruoho     ACPI_ERST_NOT_AVAILABLE         = 2,
    441   1.1    jruoho     ACPI_ERST_FAILURE               = 3,
    442   1.1    jruoho     ACPI_ERST_RECORD_EMPTY          = 4,
    443   1.1    jruoho     ACPI_ERST_NOT_FOUND             = 5,
    444   1.1    jruoho     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
    445   1.1    jruoho };
    446   1.1    jruoho 
    447   1.1    jruoho 
    448   1.1    jruoho /* Error Record Serialization Information */
    449   1.1    jruoho 
    450   1.1    jruoho typedef struct acpi_erst_info
    451   1.1    jruoho {
    452   1.1    jruoho     UINT16                  Signature;          /* Should be "ER" */
    453   1.1    jruoho     UINT8                   Data[48];
    454   1.1    jruoho 
    455   1.1    jruoho } ACPI_ERST_INFO;
    456   1.1    jruoho 
    457   1.1    jruoho 
    458   1.1    jruoho /*******************************************************************************
    459   1.1    jruoho  *
    460   1.1    jruoho  * HEST - Hardware Error Source Table (ACPI 4.0)
    461   1.1    jruoho  *        Version 1
    462   1.1    jruoho  *
    463   1.1    jruoho  ******************************************************************************/
    464   1.1    jruoho 
    465   1.1    jruoho typedef struct acpi_table_hest
    466   1.1    jruoho {
    467   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    468   1.1    jruoho     UINT32                  ErrorSourceCount;
    469   1.1    jruoho 
    470   1.1    jruoho } ACPI_TABLE_HEST;
    471   1.1    jruoho 
    472   1.1    jruoho 
    473   1.1    jruoho /* HEST subtable header */
    474   1.1    jruoho 
    475   1.1    jruoho typedef struct acpi_hest_header
    476   1.1    jruoho {
    477   1.1    jruoho     UINT16                  Type;
    478   1.1    jruoho     UINT16                  SourceId;
    479   1.1    jruoho 
    480   1.1    jruoho } ACPI_HEST_HEADER;
    481   1.1    jruoho 
    482   1.1    jruoho 
    483   1.1    jruoho /* Values for Type field above for subtables */
    484   1.1    jruoho 
    485   1.1    jruoho enum AcpiHestTypes
    486   1.1    jruoho {
    487   1.1    jruoho     ACPI_HEST_TYPE_IA32_CHECK           = 0,
    488   1.1    jruoho     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
    489   1.1    jruoho     ACPI_HEST_TYPE_IA32_NMI             = 2,
    490   1.1    jruoho     ACPI_HEST_TYPE_NOT_USED3            = 3,
    491   1.1    jruoho     ACPI_HEST_TYPE_NOT_USED4            = 4,
    492   1.1    jruoho     ACPI_HEST_TYPE_NOT_USED5            = 5,
    493   1.1    jruoho     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
    494   1.1    jruoho     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
    495   1.1    jruoho     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
    496   1.1    jruoho     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
    497   1.9  christos     ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
    498  1.11  christos     ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
    499  1.11  christos     ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
    500   1.1    jruoho };
    501   1.1    jruoho 
    502   1.1    jruoho 
    503   1.1    jruoho /*
    504   1.1    jruoho  * HEST substructures contained in subtables
    505   1.1    jruoho  */
    506   1.1    jruoho 
    507   1.1    jruoho /*
    508   1.1    jruoho  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
    509   1.1    jruoho  * ACPI_HEST_IA_CORRECTED structures.
    510   1.1    jruoho  */
    511   1.1    jruoho typedef struct acpi_hest_ia_error_bank
    512   1.1    jruoho {
    513   1.1    jruoho     UINT8                   BankNumber;
    514   1.1    jruoho     UINT8                   ClearStatusOnInit;
    515   1.1    jruoho     UINT8                   StatusFormat;
    516   1.1    jruoho     UINT8                   Reserved;
    517   1.1    jruoho     UINT32                  ControlRegister;
    518   1.1    jruoho     UINT64                  ControlData;
    519   1.1    jruoho     UINT32                  StatusRegister;
    520   1.1    jruoho     UINT32                  AddressRegister;
    521   1.1    jruoho     UINT32                  MiscRegister;
    522   1.1    jruoho 
    523   1.1    jruoho } ACPI_HEST_IA_ERROR_BANK;
    524   1.1    jruoho 
    525   1.1    jruoho 
    526   1.1    jruoho /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
    527   1.1    jruoho 
    528   1.1    jruoho typedef struct acpi_hest_aer_common
    529   1.1    jruoho {
    530   1.1    jruoho     UINT16                  Reserved1;
    531   1.1    jruoho     UINT8                   Flags;
    532   1.1    jruoho     UINT8                   Enabled;
    533   1.1    jruoho     UINT32                  RecordsToPreallocate;
    534   1.1    jruoho     UINT32                  MaxSectionsPerRecord;
    535   1.4  christos     UINT32                  Bus;                    /* Bus and Segment numbers */
    536   1.1    jruoho     UINT16                  Device;
    537   1.1    jruoho     UINT16                  Function;
    538   1.1    jruoho     UINT16                  DeviceControl;
    539   1.1    jruoho     UINT16                  Reserved2;
    540   1.1    jruoho     UINT32                  UncorrectableMask;
    541   1.1    jruoho     UINT32                  UncorrectableSeverity;
    542   1.1    jruoho     UINT32                  CorrectableMask;
    543   1.1    jruoho     UINT32                  AdvancedCapabilities;
    544   1.1    jruoho 
    545   1.1    jruoho } ACPI_HEST_AER_COMMON;
    546   1.1    jruoho 
    547   1.1    jruoho /* Masks for HEST Flags fields */
    548   1.1    jruoho 
    549   1.1    jruoho #define ACPI_HEST_FIRMWARE_FIRST        (1)
    550   1.1    jruoho #define ACPI_HEST_GLOBAL                (1<<1)
    551  1.11  christos #define ACPI_HEST_GHES_ASSIST           (1<<2)
    552   1.1    jruoho 
    553   1.4  christos /*
    554   1.4  christos  * Macros to access the bus/segment numbers in Bus field above:
    555   1.4  christos  *  Bus number is encoded in bits 7:0
    556   1.4  christos  *  Segment number is encoded in bits 23:8
    557   1.4  christos  */
    558   1.4  christos #define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
    559   1.4  christos #define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
    560   1.4  christos 
    561   1.1    jruoho 
    562   1.1    jruoho /* Hardware Error Notification */
    563   1.1    jruoho 
    564   1.1    jruoho typedef struct acpi_hest_notify
    565   1.1    jruoho {
    566   1.1    jruoho     UINT8                   Type;
    567   1.1    jruoho     UINT8                   Length;
    568   1.1    jruoho     UINT16                  ConfigWriteEnable;
    569   1.1    jruoho     UINT32                  PollInterval;
    570   1.1    jruoho     UINT32                  Vector;
    571   1.1    jruoho     UINT32                  PollingThresholdValue;
    572   1.1    jruoho     UINT32                  PollingThresholdWindow;
    573   1.1    jruoho     UINT32                  ErrorThresholdValue;
    574   1.1    jruoho     UINT32                  ErrorThresholdWindow;
    575   1.1    jruoho 
    576   1.1    jruoho } ACPI_HEST_NOTIFY;
    577   1.1    jruoho 
    578   1.1    jruoho /* Values for Notify Type field above */
    579   1.1    jruoho 
    580   1.1    jruoho enum AcpiHestNotifyTypes
    581   1.1    jruoho {
    582  1.11  christos     ACPI_HEST_NOTIFY_POLLED             = 0,
    583  1.11  christos     ACPI_HEST_NOTIFY_EXTERNAL           = 1,
    584  1.11  christos     ACPI_HEST_NOTIFY_LOCAL              = 2,
    585  1.11  christos     ACPI_HEST_NOTIFY_SCI                = 3,
    586  1.11  christos     ACPI_HEST_NOTIFY_NMI                = 4,
    587  1.11  christos     ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
    588  1.11  christos     ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
    589  1.11  christos     ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
    590  1.11  christos     ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
    591  1.11  christos     ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
    592  1.11  christos     ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
    593  1.11  christos     ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
    594  1.11  christos     ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
    595   1.1    jruoho };
    596   1.1    jruoho 
    597   1.1    jruoho /* Values for ConfigWriteEnable bitfield above */
    598   1.1    jruoho 
    599   1.1    jruoho #define ACPI_HEST_TYPE                  (1)
    600   1.1    jruoho #define ACPI_HEST_POLL_INTERVAL         (1<<1)
    601   1.1    jruoho #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
    602   1.1    jruoho #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
    603   1.1    jruoho #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
    604   1.1    jruoho #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
    605   1.1    jruoho 
    606   1.1    jruoho 
    607   1.1    jruoho /*
    608   1.1    jruoho  * HEST subtables
    609   1.1    jruoho  */
    610   1.1    jruoho 
    611   1.1    jruoho /* 0: IA32 Machine Check Exception */
    612   1.1    jruoho 
    613   1.1    jruoho typedef struct acpi_hest_ia_machine_check
    614   1.1    jruoho {
    615   1.1    jruoho     ACPI_HEST_HEADER        Header;
    616   1.1    jruoho     UINT16                  Reserved1;
    617  1.11  christos     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
    618   1.1    jruoho     UINT8                   Enabled;
    619   1.1    jruoho     UINT32                  RecordsToPreallocate;
    620   1.1    jruoho     UINT32                  MaxSectionsPerRecord;
    621   1.1    jruoho     UINT64                  GlobalCapabilityData;
    622   1.1    jruoho     UINT64                  GlobalControlData;
    623   1.1    jruoho     UINT8                   NumHardwareBanks;
    624   1.1    jruoho     UINT8                   Reserved3[7];
    625   1.1    jruoho 
    626   1.1    jruoho } ACPI_HEST_IA_MACHINE_CHECK;
    627   1.1    jruoho 
    628   1.1    jruoho 
    629   1.1    jruoho /* 1: IA32 Corrected Machine Check */
    630   1.1    jruoho 
    631   1.1    jruoho typedef struct acpi_hest_ia_corrected
    632   1.1    jruoho {
    633   1.1    jruoho     ACPI_HEST_HEADER        Header;
    634   1.1    jruoho     UINT16                  Reserved1;
    635  1.11  christos     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
    636   1.1    jruoho     UINT8                   Enabled;
    637   1.1    jruoho     UINT32                  RecordsToPreallocate;
    638   1.1    jruoho     UINT32                  MaxSectionsPerRecord;
    639   1.1    jruoho     ACPI_HEST_NOTIFY        Notify;
    640   1.1    jruoho     UINT8                   NumHardwareBanks;
    641   1.1    jruoho     UINT8                   Reserved2[3];
    642   1.1    jruoho 
    643   1.1    jruoho } ACPI_HEST_IA_CORRECTED;
    644   1.1    jruoho 
    645   1.1    jruoho 
    646   1.1    jruoho /* 2: IA32 Non-Maskable Interrupt */
    647   1.1    jruoho 
    648   1.1    jruoho typedef struct acpi_hest_ia_nmi
    649   1.1    jruoho {
    650   1.1    jruoho     ACPI_HEST_HEADER        Header;
    651   1.1    jruoho     UINT32                  Reserved;
    652   1.1    jruoho     UINT32                  RecordsToPreallocate;
    653   1.1    jruoho     UINT32                  MaxSectionsPerRecord;
    654   1.1    jruoho     UINT32                  MaxRawDataLength;
    655   1.1    jruoho 
    656   1.1    jruoho } ACPI_HEST_IA_NMI;
    657   1.1    jruoho 
    658   1.1    jruoho 
    659   1.1    jruoho /* 3,4,5: Not used */
    660   1.1    jruoho 
    661   1.1    jruoho /* 6: PCI Express Root Port AER */
    662   1.1    jruoho 
    663   1.1    jruoho typedef struct acpi_hest_aer_root
    664   1.1    jruoho {
    665   1.1    jruoho     ACPI_HEST_HEADER        Header;
    666   1.1    jruoho     ACPI_HEST_AER_COMMON    Aer;
    667   1.1    jruoho     UINT32                  RootErrorCommand;
    668   1.1    jruoho 
    669   1.1    jruoho } ACPI_HEST_AER_ROOT;
    670   1.1    jruoho 
    671   1.1    jruoho 
    672   1.1    jruoho /* 7: PCI Express AER (AER Endpoint) */
    673   1.1    jruoho 
    674   1.1    jruoho typedef struct acpi_hest_aer
    675   1.1    jruoho {
    676   1.1    jruoho     ACPI_HEST_HEADER        Header;
    677   1.1    jruoho     ACPI_HEST_AER_COMMON    Aer;
    678   1.1    jruoho 
    679   1.1    jruoho } ACPI_HEST_AER;
    680   1.1    jruoho 
    681   1.1    jruoho 
    682   1.1    jruoho /* 8: PCI Express/PCI-X Bridge AER */
    683   1.1    jruoho 
    684   1.1    jruoho typedef struct acpi_hest_aer_bridge
    685   1.1    jruoho {
    686   1.1    jruoho     ACPI_HEST_HEADER        Header;
    687   1.1    jruoho     ACPI_HEST_AER_COMMON    Aer;
    688   1.1    jruoho     UINT32                  UncorrectableMask2;
    689   1.1    jruoho     UINT32                  UncorrectableSeverity2;
    690   1.1    jruoho     UINT32                  AdvancedCapabilities2;
    691   1.1    jruoho 
    692   1.1    jruoho } ACPI_HEST_AER_BRIDGE;
    693   1.1    jruoho 
    694   1.1    jruoho 
    695   1.1    jruoho /* 9: Generic Hardware Error Source */
    696   1.1    jruoho 
    697   1.1    jruoho typedef struct acpi_hest_generic
    698   1.1    jruoho {
    699   1.1    jruoho     ACPI_HEST_HEADER        Header;
    700   1.1    jruoho     UINT16                  RelatedSourceId;
    701   1.1    jruoho     UINT8                   Reserved;
    702   1.1    jruoho     UINT8                   Enabled;
    703   1.1    jruoho     UINT32                  RecordsToPreallocate;
    704   1.1    jruoho     UINT32                  MaxSectionsPerRecord;
    705   1.1    jruoho     UINT32                  MaxRawDataLength;
    706   1.1    jruoho     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
    707   1.1    jruoho     ACPI_HEST_NOTIFY        Notify;
    708   1.1    jruoho     UINT32                  ErrorBlockLength;
    709   1.1    jruoho 
    710   1.1    jruoho } ACPI_HEST_GENERIC;
    711   1.1    jruoho 
    712   1.1    jruoho 
    713   1.9  christos /* 10: Generic Hardware Error Source, version 2 */
    714   1.9  christos 
    715   1.9  christos typedef struct acpi_hest_generic_v2
    716   1.9  christos {
    717   1.9  christos     ACPI_HEST_HEADER        Header;
    718   1.9  christos     UINT16                  RelatedSourceId;
    719   1.9  christos     UINT8                   Reserved;
    720   1.9  christos     UINT8                   Enabled;
    721   1.9  christos     UINT32                  RecordsToPreallocate;
    722   1.9  christos     UINT32                  MaxSectionsPerRecord;
    723   1.9  christos     UINT32                  MaxRawDataLength;
    724   1.9  christos     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
    725   1.9  christos     ACPI_HEST_NOTIFY        Notify;
    726   1.9  christos     UINT32                  ErrorBlockLength;
    727   1.9  christos     ACPI_GENERIC_ADDRESS    ReadAckRegister;
    728   1.9  christos     UINT64                  ReadAckPreserve;
    729   1.9  christos     UINT64                  ReadAckWrite;
    730   1.9  christos 
    731   1.9  christos } ACPI_HEST_GENERIC_V2;
    732   1.9  christos 
    733   1.9  christos 
    734   1.1    jruoho /* Generic Error Status block */
    735   1.1    jruoho 
    736   1.1    jruoho typedef struct acpi_hest_generic_status
    737   1.1    jruoho {
    738   1.1    jruoho     UINT32                  BlockStatus;
    739   1.1    jruoho     UINT32                  RawDataOffset;
    740   1.1    jruoho     UINT32                  RawDataLength;
    741   1.1    jruoho     UINT32                  DataLength;
    742   1.1    jruoho     UINT32                  ErrorSeverity;
    743   1.1    jruoho 
    744   1.1    jruoho } ACPI_HEST_GENERIC_STATUS;
    745   1.1    jruoho 
    746   1.1    jruoho /* Values for BlockStatus flags above */
    747   1.1    jruoho 
    748   1.1    jruoho #define ACPI_HEST_UNCORRECTABLE             (1)
    749   1.1    jruoho #define ACPI_HEST_CORRECTABLE               (1<<1)
    750   1.1    jruoho #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
    751   1.1    jruoho #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
    752   1.1    jruoho #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
    753   1.1    jruoho 
    754   1.1    jruoho 
    755   1.1    jruoho /* Generic Error Data entry */
    756   1.1    jruoho 
    757   1.1    jruoho typedef struct acpi_hest_generic_data
    758   1.1    jruoho {
    759   1.1    jruoho     UINT8                   SectionType[16];
    760   1.1    jruoho     UINT32                  ErrorSeverity;
    761   1.1    jruoho     UINT16                  Revision;
    762   1.1    jruoho     UINT8                   ValidationBits;
    763   1.1    jruoho     UINT8                   Flags;
    764   1.1    jruoho     UINT32                  ErrorDataLength;
    765   1.1    jruoho     UINT8                   FruId[16];
    766   1.1    jruoho     UINT8                   FruText[20];
    767   1.1    jruoho 
    768   1.1    jruoho } ACPI_HEST_GENERIC_DATA;
    769   1.1    jruoho 
    770   1.9  christos /* Extension for revision 0x0300 */
    771   1.9  christos 
    772   1.9  christos typedef struct acpi_hest_generic_data_v300
    773   1.9  christos {
    774   1.9  christos     UINT8                   SectionType[16];
    775   1.9  christos     UINT32                  ErrorSeverity;
    776   1.9  christos     UINT16                  Revision;
    777   1.9  christos     UINT8                   ValidationBits;
    778   1.9  christos     UINT8                   Flags;
    779   1.9  christos     UINT32                  ErrorDataLength;
    780   1.9  christos     UINT8                   FruId[16];
    781   1.9  christos     UINT8                   FruText[20];
    782   1.9  christos     UINT64                  TimeStamp;
    783   1.9  christos 
    784   1.9  christos } ACPI_HEST_GENERIC_DATA_V300;
    785   1.9  christos 
    786   1.9  christos /* Values for ErrorSeverity above */
    787   1.9  christos 
    788   1.9  christos #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
    789   1.9  christos #define ACPI_HEST_GEN_ERROR_FATAL           1
    790   1.9  christos #define ACPI_HEST_GEN_ERROR_CORRECTED       2
    791   1.9  christos #define ACPI_HEST_GEN_ERROR_NONE            3
    792   1.9  christos 
    793   1.9  christos /* Flags for ValidationBits above */
    794   1.9  christos 
    795   1.9  christos #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
    796   1.9  christos #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
    797   1.9  christos #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
    798   1.9  christos 
    799   1.1    jruoho 
    800  1.11  christos /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
    801  1.11  christos 
    802  1.11  christos typedef struct acpi_hest_ia_deferred_check
    803  1.11  christos {
    804  1.11  christos     ACPI_HEST_HEADER        Header;
    805  1.11  christos     UINT16                  Reserved1;
    806  1.11  christos     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
    807  1.11  christos     UINT8                   Enabled;
    808  1.11  christos     UINT32                  RecordsToPreallocate;
    809  1.11  christos     UINT32                  MaxSectionsPerRecord;
    810  1.11  christos     ACPI_HEST_NOTIFY        Notify;
    811  1.11  christos     UINT8                   NumHardwareBanks;
    812  1.11  christos     UINT8                   Reserved2[3];
    813  1.11  christos 
    814  1.11  christos } ACPI_HEST_IA_DEFERRED_CHECK;
    815  1.11  christos 
    816  1.11  christos 
    817  1.11  christos /*******************************************************************************
    818  1.11  christos  *
    819  1.11  christos  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
    820  1.11  christos  *        Version 1
    821  1.11  christos  *
    822  1.11  christos  ******************************************************************************/
    823  1.11  christos 
    824  1.11  christos typedef struct acpi_table_hmat
    825  1.11  christos {
    826  1.11  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    827  1.11  christos     UINT32                  Reserved;
    828  1.11  christos 
    829  1.11  christos } ACPI_TABLE_HMAT;
    830  1.11  christos 
    831  1.11  christos 
    832  1.11  christos /* Values for HMAT structure types */
    833  1.11  christos 
    834  1.11  christos enum AcpiHmatType
    835  1.11  christos {
    836  1.11  christos     ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subystem address range */
    837  1.11  christos     ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
    838  1.11  christos     ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
    839  1.11  christos     ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
    840  1.11  christos };
    841  1.11  christos 
    842  1.11  christos typedef struct acpi_hmat_structure
    843  1.11  christos {
    844  1.11  christos     UINT16                  Type;
    845  1.11  christos     UINT16                  Reserved;
    846  1.11  christos     UINT32                  Length;
    847  1.11  christos 
    848  1.11  christos } ACPI_HMAT_STRUCTURE;
    849  1.11  christos 
    850  1.11  christos 
    851  1.11  christos /*
    852  1.11  christos  * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
    853  1.11  christos  */
    854  1.11  christos 
    855  1.11  christos /* 0: Memory subystem address range */
    856  1.11  christos 
    857  1.11  christos typedef struct acpi_hmat_address_range
    858  1.11  christos {
    859  1.11  christos     ACPI_HMAT_STRUCTURE     Header;
    860  1.11  christos     UINT16                  Flags;
    861  1.11  christos     UINT16                  Reserved1;
    862  1.11  christos     UINT32                  ProcessorPD;            /* Processor proximity domain */
    863  1.11  christos     UINT32                  MemoryPD;               /* Memory proximity domain */
    864  1.11  christos     UINT32                  Reserved2;
    865  1.11  christos     UINT64                  PhysicalAddressBase;    /* Physical address range base */
    866  1.11  christos     UINT64                  PhysicalAddressLength;  /* Physical address range length */
    867  1.11  christos 
    868  1.11  christos } ACPI_HMAT_ADDRESS_RANGE;
    869  1.11  christos 
    870  1.11  christos /* Masks for Flags field above */
    871  1.11  christos 
    872  1.11  christos #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)     /* 1: ProcessorPD field is valid */
    873  1.11  christos #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)  /* 1: MemoryPD field is valid */
    874  1.11  christos #define ACPI_HMAT_RESERVATION_HINT      (1<<2)  /* 1: Reservation hint */
    875  1.11  christos 
    876  1.11  christos 
    877  1.11  christos /* 1: System locality latency and bandwidth information */
    878  1.11  christos 
    879  1.11  christos typedef struct acpi_hmat_locality
    880  1.11  christos {
    881  1.11  christos     ACPI_HMAT_STRUCTURE     Header;
    882  1.11  christos     UINT8                   Flags;
    883  1.11  christos     UINT8                   DataType;
    884  1.11  christos     UINT16                  Reserved1;
    885  1.11  christos     UINT32                  NumberOfInitiatorPDs;
    886  1.11  christos     UINT32                  NumberOfTargetPDs;
    887  1.11  christos     UINT32                  Reserved2;
    888  1.11  christos     UINT64                  EntryBaseUnit;
    889  1.11  christos 
    890  1.11  christos } ACPI_HMAT_LOCALITY;
    891  1.11  christos 
    892  1.11  christos /* Masks for Flags field above */
    893  1.11  christos 
    894  1.11  christos #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
    895  1.11  christos 
    896  1.11  christos /* Values for Memory Hierarchy flag */
    897  1.11  christos 
    898  1.11  christos #define ACPI_HMAT_MEMORY            0
    899  1.11  christos #define ACPI_HMAT_LAST_LEVEL_CACHE  1
    900  1.11  christos #define ACPI_HMAT_1ST_LEVEL_CACHE   2
    901  1.11  christos #define ACPI_HMAT_2ND_LEVEL_CACHE   3
    902  1.11  christos #define ACPI_HMAT_3RD_LEVEL_CACHE   4
    903  1.11  christos 
    904  1.11  christos /* Values for DataType field above */
    905  1.11  christos 
    906  1.11  christos #define ACPI_HMAT_ACCESS_LATENCY    0
    907  1.11  christos #define ACPI_HMAT_READ_LATENCY      1
    908  1.11  christos #define ACPI_HMAT_WRITE_LATENCY     2
    909  1.11  christos #define ACPI_HMAT_ACCESS_BANDWIDTH  3
    910  1.11  christos #define ACPI_HMAT_READ_BANDWIDTH    4
    911  1.11  christos #define ACPI_HMAT_WRITE_BANDWIDTH   5
    912  1.11  christos 
    913  1.11  christos 
    914  1.11  christos /* 2: Memory side cache information */
    915  1.11  christos 
    916  1.11  christos typedef struct acpi_hmat_cache
    917  1.11  christos {
    918  1.11  christos     ACPI_HMAT_STRUCTURE     Header;
    919  1.11  christos     UINT32                  MemoryPD;
    920  1.11  christos     UINT32                  Reserved1;
    921  1.11  christos     UINT64                  CacheSize;
    922  1.11  christos     UINT32                  CacheAttributes;
    923  1.11  christos     UINT16                  Reserved2;
    924  1.11  christos     UINT16                  NumberOfSMBIOSHandles;
    925  1.11  christos 
    926  1.11  christos } ACPI_HMAT_CACHE;
    927  1.11  christos 
    928  1.11  christos /* Masks for CacheAttributes field above */
    929  1.11  christos 
    930  1.11  christos #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
    931  1.11  christos #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
    932  1.11  christos #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
    933  1.11  christos #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
    934  1.11  christos #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
    935  1.11  christos 
    936  1.11  christos /* Values for cache associativity flag */
    937  1.11  christos 
    938  1.11  christos #define ACPI_HMAT_CA_NONE                     (0)
    939  1.11  christos #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
    940  1.11  christos #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
    941  1.11  christos 
    942  1.11  christos /* Values for write policy flag */
    943  1.11  christos 
    944  1.11  christos #define ACPI_HMAT_CP_NONE   (0)
    945  1.11  christos #define ACPI_HMAT_CP_WB     (1)
    946  1.11  christos #define ACPI_HMAT_CP_WT     (2)
    947  1.11  christos 
    948  1.11  christos 
    949   1.1    jruoho /*******************************************************************************
    950   1.1    jruoho  *
    951   1.1    jruoho  * MADT - Multiple APIC Description Table
    952   1.1    jruoho  *        Version 3
    953   1.1    jruoho  *
    954   1.1    jruoho  ******************************************************************************/
    955   1.1    jruoho 
    956   1.1    jruoho typedef struct acpi_table_madt
    957   1.1    jruoho {
    958   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    959   1.1    jruoho     UINT32                  Address;            /* Physical address of local APIC */
    960   1.1    jruoho     UINT32                  Flags;
    961   1.1    jruoho 
    962   1.1    jruoho } ACPI_TABLE_MADT;
    963   1.1    jruoho 
    964   1.1    jruoho /* Masks for Flags field above */
    965   1.1    jruoho 
    966   1.1    jruoho #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
    967   1.1    jruoho 
    968   1.1    jruoho /* Values for PCATCompat flag */
    969   1.1    jruoho 
    970  1.11  christos #define ACPI_MADT_DUAL_PIC          1
    971  1.11  christos #define ACPI_MADT_MULTIPLE_APIC     0
    972   1.1    jruoho 
    973   1.1    jruoho 
    974   1.1    jruoho /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
    975   1.1    jruoho 
    976   1.1    jruoho enum AcpiMadtType
    977   1.1    jruoho {
    978   1.5  christos     ACPI_MADT_TYPE_LOCAL_APIC               = 0,
    979   1.5  christos     ACPI_MADT_TYPE_IO_APIC                  = 1,
    980   1.5  christos     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
    981   1.5  christos     ACPI_MADT_TYPE_NMI_SOURCE               = 3,
    982   1.5  christos     ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
    983   1.5  christos     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
    984   1.5  christos     ACPI_MADT_TYPE_IO_SAPIC                 = 6,
    985   1.5  christos     ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
    986   1.5  christos     ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
    987   1.5  christos     ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
    988   1.5  christos     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
    989   1.5  christos     ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
    990   1.5  christos     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
    991   1.5  christos     ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
    992   1.5  christos     ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
    993   1.7  christos     ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
    994   1.7  christos     ACPI_MADT_TYPE_RESERVED                 = 16    /* 16 and greater are reserved */
    995   1.1    jruoho };
    996   1.1    jruoho 
    997   1.1    jruoho 
    998   1.1    jruoho /*
    999   1.5  christos  * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
   1000   1.1    jruoho  */
   1001   1.1    jruoho 
   1002   1.1    jruoho /* 0: Processor Local APIC */
   1003   1.1    jruoho 
   1004   1.1    jruoho typedef struct acpi_madt_local_apic
   1005   1.1    jruoho {
   1006   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1007   1.1    jruoho     UINT8                   ProcessorId;        /* ACPI processor id */
   1008   1.1    jruoho     UINT8                   Id;                 /* Processor's local APIC id */
   1009   1.1    jruoho     UINT32                  LapicFlags;
   1010   1.1    jruoho 
   1011   1.1    jruoho } ACPI_MADT_LOCAL_APIC;
   1012   1.1    jruoho 
   1013   1.1    jruoho 
   1014   1.1    jruoho /* 1: IO APIC */
   1015   1.1    jruoho 
   1016   1.1    jruoho typedef struct acpi_madt_io_apic
   1017   1.1    jruoho {
   1018   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1019   1.1    jruoho     UINT8                   Id;                 /* I/O APIC ID */
   1020   1.1    jruoho     UINT8                   Reserved;           /* Reserved - must be zero */
   1021   1.1    jruoho     UINT32                  Address;            /* APIC physical address */
   1022   1.1    jruoho     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
   1023   1.1    jruoho 
   1024   1.1    jruoho } ACPI_MADT_IO_APIC;
   1025   1.1    jruoho 
   1026   1.1    jruoho 
   1027   1.1    jruoho /* 2: Interrupt Override */
   1028   1.1    jruoho 
   1029   1.1    jruoho typedef struct acpi_madt_interrupt_override
   1030   1.1    jruoho {
   1031   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1032   1.1    jruoho     UINT8                   Bus;                /* 0 - ISA */
   1033   1.1    jruoho     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
   1034   1.1    jruoho     UINT32                  GlobalIrq;          /* Global system interrupt */
   1035   1.1    jruoho     UINT16                  IntiFlags;
   1036   1.1    jruoho 
   1037   1.1    jruoho } ACPI_MADT_INTERRUPT_OVERRIDE;
   1038   1.1    jruoho 
   1039   1.1    jruoho 
   1040   1.1    jruoho /* 3: NMI Source */
   1041   1.1    jruoho 
   1042   1.1    jruoho typedef struct acpi_madt_nmi_source
   1043   1.1    jruoho {
   1044   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1045   1.1    jruoho     UINT16                  IntiFlags;
   1046   1.1    jruoho     UINT32                  GlobalIrq;          /* Global system interrupt */
   1047   1.1    jruoho 
   1048   1.1    jruoho } ACPI_MADT_NMI_SOURCE;
   1049   1.1    jruoho 
   1050   1.1    jruoho 
   1051   1.1    jruoho /* 4: Local APIC NMI */
   1052   1.1    jruoho 
   1053   1.1    jruoho typedef struct acpi_madt_local_apic_nmi
   1054   1.1    jruoho {
   1055   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1056   1.1    jruoho     UINT8                   ProcessorId;        /* ACPI processor id */
   1057   1.1    jruoho     UINT16                  IntiFlags;
   1058   1.1    jruoho     UINT8                   Lint;               /* LINTn to which NMI is connected */
   1059   1.1    jruoho 
   1060   1.1    jruoho } ACPI_MADT_LOCAL_APIC_NMI;
   1061   1.1    jruoho 
   1062   1.1    jruoho 
   1063   1.1    jruoho /* 5: Address Override */
   1064   1.1    jruoho 
   1065   1.1    jruoho typedef struct acpi_madt_local_apic_override
   1066   1.1    jruoho {
   1067   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1068   1.1    jruoho     UINT16                  Reserved;           /* Reserved, must be zero */
   1069   1.1    jruoho     UINT64                  Address;            /* APIC physical address */
   1070   1.1    jruoho 
   1071   1.1    jruoho } ACPI_MADT_LOCAL_APIC_OVERRIDE;
   1072   1.1    jruoho 
   1073   1.1    jruoho 
   1074   1.1    jruoho /* 6: I/O Sapic */
   1075   1.1    jruoho 
   1076   1.1    jruoho typedef struct acpi_madt_io_sapic
   1077   1.1    jruoho {
   1078   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1079   1.1    jruoho     UINT8                   Id;                 /* I/O SAPIC ID */
   1080   1.1    jruoho     UINT8                   Reserved;           /* Reserved, must be zero */
   1081   1.1    jruoho     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
   1082   1.1    jruoho     UINT64                  Address;            /* SAPIC physical address */
   1083   1.1    jruoho 
   1084   1.1    jruoho } ACPI_MADT_IO_SAPIC;
   1085   1.1    jruoho 
   1086   1.1    jruoho 
   1087   1.1    jruoho /* 7: Local Sapic */
   1088   1.1    jruoho 
   1089   1.1    jruoho typedef struct acpi_madt_local_sapic
   1090   1.1    jruoho {
   1091   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1092   1.1    jruoho     UINT8                   ProcessorId;        /* ACPI processor id */
   1093   1.1    jruoho     UINT8                   Id;                 /* SAPIC ID */
   1094   1.1    jruoho     UINT8                   Eid;                /* SAPIC EID */
   1095   1.1    jruoho     UINT8                   Reserved[3];        /* Reserved, must be zero */
   1096   1.1    jruoho     UINT32                  LapicFlags;
   1097   1.1    jruoho     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
   1098   1.1    jruoho     char                    UidString[1];       /* String UID  - ACPI 3.0 */
   1099   1.1    jruoho 
   1100   1.1    jruoho } ACPI_MADT_LOCAL_SAPIC;
   1101   1.1    jruoho 
   1102   1.1    jruoho 
   1103   1.1    jruoho /* 8: Platform Interrupt Source */
   1104   1.1    jruoho 
   1105   1.1    jruoho typedef struct acpi_madt_interrupt_source
   1106   1.1    jruoho {
   1107   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1108   1.1    jruoho     UINT16                  IntiFlags;
   1109   1.1    jruoho     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
   1110   1.1    jruoho     UINT8                   Id;                 /* Processor ID */
   1111   1.1    jruoho     UINT8                   Eid;                /* Processor EID */
   1112   1.1    jruoho     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
   1113   1.1    jruoho     UINT32                  GlobalIrq;          /* Global system interrupt */
   1114   1.1    jruoho     UINT32                  Flags;              /* Interrupt Source Flags */
   1115   1.1    jruoho 
   1116   1.1    jruoho } ACPI_MADT_INTERRUPT_SOURCE;
   1117   1.1    jruoho 
   1118   1.1    jruoho /* Masks for Flags field above */
   1119   1.1    jruoho 
   1120   1.1    jruoho #define ACPI_MADT_CPEI_OVERRIDE     (1)
   1121   1.1    jruoho 
   1122   1.1    jruoho 
   1123   1.1    jruoho /* 9: Processor Local X2APIC (ACPI 4.0) */
   1124   1.1    jruoho 
   1125   1.1    jruoho typedef struct acpi_madt_local_x2apic
   1126   1.1    jruoho {
   1127   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1128   1.1    jruoho     UINT16                  Reserved;           /* Reserved - must be zero */
   1129   1.1    jruoho     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
   1130   1.1    jruoho     UINT32                  LapicFlags;
   1131   1.1    jruoho     UINT32                  Uid;                /* ACPI processor UID */
   1132   1.1    jruoho 
   1133   1.1    jruoho } ACPI_MADT_LOCAL_X2APIC;
   1134   1.1    jruoho 
   1135   1.1    jruoho 
   1136   1.1    jruoho /* 10: Local X2APIC NMI (ACPI 4.0) */
   1137   1.1    jruoho 
   1138   1.1    jruoho typedef struct acpi_madt_local_x2apic_nmi
   1139   1.1    jruoho {
   1140   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1141   1.1    jruoho     UINT16                  IntiFlags;
   1142   1.1    jruoho     UINT32                  Uid;                /* ACPI processor UID */
   1143   1.1    jruoho     UINT8                   Lint;               /* LINTn to which NMI is connected */
   1144   1.1    jruoho     UINT8                   Reserved[3];        /* Reserved - must be zero */
   1145   1.1    jruoho 
   1146   1.1    jruoho } ACPI_MADT_LOCAL_X2APIC_NMI;
   1147   1.1    jruoho 
   1148   1.1    jruoho 
   1149   1.7  christos /* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
   1150   1.4  christos 
   1151   1.4  christos typedef struct acpi_madt_generic_interrupt
   1152   1.4  christos {
   1153   1.4  christos     ACPI_SUBTABLE_HEADER    Header;
   1154   1.4  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1155   1.5  christos     UINT32                  CpuInterfaceNumber;
   1156   1.4  christos     UINT32                  Uid;
   1157   1.4  christos     UINT32                  Flags;
   1158   1.4  christos     UINT32                  ParkingVersion;
   1159   1.4  christos     UINT32                  PerformanceInterrupt;
   1160   1.4  christos     UINT64                  ParkedAddress;
   1161   1.4  christos     UINT64                  BaseAddress;
   1162   1.5  christos     UINT64                  GicvBaseAddress;
   1163   1.5  christos     UINT64                  GichBaseAddress;
   1164   1.5  christos     UINT32                  VgicInterrupt;
   1165   1.5  christos     UINT64                  GicrBaseAddress;
   1166   1.5  christos     UINT64                  ArmMpidr;
   1167   1.7  christos     UINT8                   EfficiencyClass;
   1168   1.7  christos     UINT8                   Reserved2[3];
   1169   1.4  christos 
   1170   1.4  christos } ACPI_MADT_GENERIC_INTERRUPT;
   1171   1.4  christos 
   1172   1.5  christos /* Masks for Flags field above */
   1173   1.5  christos 
   1174   1.5  christos /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
   1175   1.5  christos #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
   1176   1.5  christos #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
   1177   1.5  christos 
   1178   1.4  christos 
   1179   1.7  christos /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
   1180   1.4  christos 
   1181   1.4  christos typedef struct acpi_madt_generic_distributor
   1182   1.4  christos {
   1183   1.4  christos     ACPI_SUBTABLE_HEADER    Header;
   1184   1.4  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1185   1.4  christos     UINT32                  GicId;
   1186   1.4  christos     UINT64                  BaseAddress;
   1187   1.4  christos     UINT32                  GlobalIrqBase;
   1188   1.7  christos     UINT8                   Version;
   1189   1.7  christos     UINT8                   Reserved2[3];       /* Reserved - must be zero */
   1190   1.4  christos 
   1191   1.4  christos } ACPI_MADT_GENERIC_DISTRIBUTOR;
   1192   1.4  christos 
   1193   1.7  christos /* Values for Version field above */
   1194   1.7  christos 
   1195   1.7  christos enum AcpiMadtGicVersion
   1196   1.7  christos {
   1197   1.7  christos     ACPI_MADT_GIC_VERSION_NONE          = 0,
   1198   1.7  christos     ACPI_MADT_GIC_VERSION_V1            = 1,
   1199   1.7  christos     ACPI_MADT_GIC_VERSION_V2            = 2,
   1200   1.7  christos     ACPI_MADT_GIC_VERSION_V3            = 3,
   1201   1.7  christos     ACPI_MADT_GIC_VERSION_V4            = 4,
   1202   1.7  christos     ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
   1203   1.7  christos };
   1204   1.7  christos 
   1205   1.4  christos 
   1206   1.5  christos /* 13: Generic MSI Frame (ACPI 5.1) */
   1207   1.5  christos 
   1208   1.5  christos typedef struct acpi_madt_generic_msi_frame
   1209   1.5  christos {
   1210   1.5  christos     ACPI_SUBTABLE_HEADER    Header;
   1211   1.5  christos     UINT16                  Reserved;           /* Reserved - must be zero */
   1212   1.5  christos     UINT32                  MsiFrameId;
   1213   1.5  christos     UINT64                  BaseAddress;
   1214   1.5  christos     UINT32                  Flags;
   1215   1.5  christos     UINT16                  SpiCount;
   1216   1.5  christos     UINT16                  SpiBase;
   1217   1.5  christos 
   1218   1.5  christos } ACPI_MADT_GENERIC_MSI_FRAME;
   1219   1.5  christos 
   1220   1.5  christos /* Masks for Flags field above */
   1221   1.5  christos 
   1222   1.5  christos #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
   1223   1.5  christos 
   1224   1.5  christos 
   1225   1.5  christos /* 14: Generic Redistributor (ACPI 5.1) */
   1226   1.5  christos 
   1227   1.5  christos typedef struct acpi_madt_generic_redistributor
   1228   1.5  christos {
   1229   1.5  christos     ACPI_SUBTABLE_HEADER    Header;
   1230   1.5  christos     UINT16                  Reserved;           /* reserved - must be zero */
   1231   1.5  christos     UINT64                  BaseAddress;
   1232   1.5  christos     UINT32                  Length;
   1233   1.5  christos 
   1234   1.5  christos } ACPI_MADT_GENERIC_REDISTRIBUTOR;
   1235   1.5  christos 
   1236   1.5  christos 
   1237   1.7  christos /* 15: Generic Translator (ACPI 6.0) */
   1238   1.7  christos 
   1239   1.7  christos typedef struct acpi_madt_generic_translator
   1240   1.7  christos {
   1241   1.7  christos     ACPI_SUBTABLE_HEADER    Header;
   1242   1.7  christos     UINT16                  Reserved;           /* reserved - must be zero */
   1243   1.7  christos     UINT32                  TranslationId;
   1244   1.7  christos     UINT64                  BaseAddress;
   1245   1.7  christos     UINT32                  Reserved2;
   1246   1.7  christos 
   1247   1.7  christos } ACPI_MADT_GENERIC_TRANSLATOR;
   1248   1.7  christos 
   1249   1.7  christos 
   1250   1.1    jruoho /*
   1251   1.1    jruoho  * Common flags fields for MADT subtables
   1252   1.1    jruoho  */
   1253   1.1    jruoho 
   1254   1.5  christos /* MADT Local APIC flags */
   1255   1.1    jruoho 
   1256   1.1    jruoho #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
   1257   1.1    jruoho 
   1258   1.1    jruoho /* MADT MPS INTI flags (IntiFlags) */
   1259   1.1    jruoho 
   1260   1.1    jruoho #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
   1261   1.1    jruoho #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
   1262   1.1    jruoho 
   1263   1.1    jruoho /* Values for MPS INTI flags */
   1264   1.1    jruoho 
   1265   1.1    jruoho #define ACPI_MADT_POLARITY_CONFORMS       0
   1266   1.1    jruoho #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
   1267   1.1    jruoho #define ACPI_MADT_POLARITY_RESERVED       2
   1268   1.1    jruoho #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
   1269   1.1    jruoho 
   1270   1.1    jruoho #define ACPI_MADT_TRIGGER_CONFORMS        (0)
   1271   1.1    jruoho #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
   1272   1.1    jruoho #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
   1273   1.1    jruoho #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
   1274   1.1    jruoho 
   1275   1.1    jruoho 
   1276   1.1    jruoho /*******************************************************************************
   1277   1.1    jruoho  *
   1278   1.1    jruoho  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
   1279   1.1    jruoho  *        Version 1
   1280   1.1    jruoho  *
   1281   1.1    jruoho  ******************************************************************************/
   1282   1.1    jruoho 
   1283   1.1    jruoho typedef struct acpi_table_msct
   1284   1.1    jruoho {
   1285   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1286   1.1    jruoho     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
   1287   1.1    jruoho     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
   1288   1.1    jruoho     UINT32                  MaxClockDomains;    /* Max number of clock domains */
   1289   1.1    jruoho     UINT64                  MaxAddress;         /* Max physical address in system */
   1290   1.1    jruoho 
   1291   1.1    jruoho } ACPI_TABLE_MSCT;
   1292   1.1    jruoho 
   1293   1.1    jruoho 
   1294   1.1    jruoho /* Subtable - Maximum Proximity Domain Information. Version 1 */
   1295   1.1    jruoho 
   1296   1.1    jruoho typedef struct acpi_msct_proximity
   1297   1.1    jruoho {
   1298   1.1    jruoho     UINT8                   Revision;
   1299   1.1    jruoho     UINT8                   Length;
   1300   1.1    jruoho     UINT32                  RangeStart;         /* Start of domain range */
   1301   1.1    jruoho     UINT32                  RangeEnd;           /* End of domain range */
   1302   1.1    jruoho     UINT32                  ProcessorCapacity;
   1303   1.1    jruoho     UINT64                  MemoryCapacity;     /* In bytes */
   1304   1.1    jruoho 
   1305   1.1    jruoho } ACPI_MSCT_PROXIMITY;
   1306   1.1    jruoho 
   1307   1.1    jruoho 
   1308   1.1    jruoho /*******************************************************************************
   1309   1.1    jruoho  *
   1310   1.9  christos  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
   1311   1.7  christos  *        Version 1
   1312   1.7  christos  *
   1313   1.7  christos  ******************************************************************************/
   1314   1.7  christos 
   1315   1.7  christos typedef struct acpi_table_nfit
   1316   1.7  christos {
   1317   1.7  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1318   1.7  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1319   1.7  christos 
   1320   1.7  christos } ACPI_TABLE_NFIT;
   1321   1.7  christos 
   1322   1.7  christos /* Subtable header for NFIT */
   1323   1.7  christos 
   1324   1.7  christos typedef struct acpi_nfit_header
   1325   1.7  christos {
   1326   1.7  christos     UINT16                   Type;
   1327   1.7  christos     UINT16                   Length;
   1328   1.7  christos 
   1329   1.7  christos } ACPI_NFIT_HEADER;
   1330   1.7  christos 
   1331   1.7  christos 
   1332   1.7  christos /* Values for subtable type in ACPI_NFIT_HEADER */
   1333   1.7  christos 
   1334   1.7  christos enum AcpiNfitType
   1335   1.7  christos {
   1336   1.7  christos     ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
   1337   1.7  christos     ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
   1338   1.7  christos     ACPI_NFIT_TYPE_INTERLEAVE           = 2,
   1339   1.7  christos     ACPI_NFIT_TYPE_SMBIOS               = 3,
   1340   1.7  christos     ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
   1341   1.7  christos     ACPI_NFIT_TYPE_DATA_REGION          = 5,
   1342   1.7  christos     ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
   1343   1.7  christos     ACPI_NFIT_TYPE_RESERVED             = 7     /* 7 and greater are reserved */
   1344   1.7  christos };
   1345   1.7  christos 
   1346   1.7  christos /*
   1347   1.7  christos  * NFIT Subtables
   1348   1.7  christos  */
   1349   1.7  christos 
   1350   1.7  christos /* 0: System Physical Address Range Structure */
   1351   1.7  christos 
   1352   1.7  christos typedef struct acpi_nfit_system_address
   1353   1.7  christos {
   1354   1.7  christos     ACPI_NFIT_HEADER        Header;
   1355   1.7  christos     UINT16                  RangeIndex;
   1356   1.7  christos     UINT16                  Flags;
   1357   1.7  christos     UINT32                  Reserved;           /* Reseved, must be zero */
   1358   1.7  christos     UINT32                  ProximityDomain;
   1359   1.7  christos     UINT8                   RangeGuid[16];
   1360   1.7  christos     UINT64                  Address;
   1361   1.7  christos     UINT64                  Length;
   1362   1.7  christos     UINT64                  MemoryMapping;
   1363   1.7  christos 
   1364   1.7  christos } ACPI_NFIT_SYSTEM_ADDRESS;
   1365   1.7  christos 
   1366   1.7  christos /* Flags */
   1367   1.7  christos 
   1368   1.7  christos #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
   1369   1.7  christos #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
   1370   1.7  christos 
   1371   1.7  christos /* Range Type GUIDs appear in the include/acuuid.h file */
   1372   1.7  christos 
   1373   1.7  christos 
   1374   1.7  christos /* 1: Memory Device to System Address Range Map Structure */
   1375   1.7  christos 
   1376   1.7  christos typedef struct acpi_nfit_memory_map
   1377   1.7  christos {
   1378   1.7  christos     ACPI_NFIT_HEADER        Header;
   1379   1.7  christos     UINT32                  DeviceHandle;
   1380   1.7  christos     UINT16                  PhysicalId;
   1381   1.7  christos     UINT16                  RegionId;
   1382   1.7  christos     UINT16                  RangeIndex;
   1383   1.7  christos     UINT16                  RegionIndex;
   1384   1.7  christos     UINT64                  RegionSize;
   1385   1.7  christos     UINT64                  RegionOffset;
   1386   1.7  christos     UINT64                  Address;
   1387   1.7  christos     UINT16                  InterleaveIndex;
   1388   1.7  christos     UINT16                  InterleaveWays;
   1389   1.7  christos     UINT16                  Flags;
   1390   1.7  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1391   1.7  christos 
   1392   1.7  christos } ACPI_NFIT_MEMORY_MAP;
   1393   1.7  christos 
   1394   1.7  christos /* Flags */
   1395   1.7  christos 
   1396   1.7  christos #define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
   1397   1.7  christos #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
   1398   1.7  christos #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
   1399   1.8  christos #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
   1400   1.7  christos #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
   1401   1.7  christos #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
   1402   1.9  christos #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
   1403   1.7  christos 
   1404   1.7  christos 
   1405   1.7  christos /* 2: Interleave Structure */
   1406   1.7  christos 
   1407   1.7  christos typedef struct acpi_nfit_interleave
   1408   1.7  christos {
   1409   1.7  christos     ACPI_NFIT_HEADER        Header;
   1410   1.7  christos     UINT16                  InterleaveIndex;
   1411   1.7  christos     UINT16                  Reserved;           /* Reserved, must be zero */
   1412   1.7  christos     UINT32                  LineCount;
   1413   1.7  christos     UINT32                  LineSize;
   1414   1.7  christos     UINT32                  LineOffset[1];      /* Variable length */
   1415   1.7  christos 
   1416   1.7  christos } ACPI_NFIT_INTERLEAVE;
   1417   1.7  christos 
   1418   1.7  christos 
   1419   1.7  christos /* 3: SMBIOS Management Information Structure */
   1420   1.7  christos 
   1421   1.7  christos typedef struct acpi_nfit_smbios
   1422   1.7  christos {
   1423   1.7  christos     ACPI_NFIT_HEADER        Header;
   1424   1.7  christos     UINT32                  Reserved;           /* Reserved, must be zero */
   1425   1.7  christos     UINT8                   Data[1];            /* Variable length */
   1426   1.7  christos 
   1427   1.7  christos } ACPI_NFIT_SMBIOS;
   1428   1.7  christos 
   1429   1.7  christos 
   1430   1.7  christos /* 4: NVDIMM Control Region Structure */
   1431   1.7  christos 
   1432   1.7  christos typedef struct acpi_nfit_control_region
   1433   1.7  christos {
   1434   1.7  christos     ACPI_NFIT_HEADER        Header;
   1435   1.7  christos     UINT16                  RegionIndex;
   1436   1.7  christos     UINT16                  VendorId;
   1437   1.7  christos     UINT16                  DeviceId;
   1438   1.7  christos     UINT16                  RevisionId;
   1439   1.7  christos     UINT16                  SubsystemVendorId;
   1440   1.7  christos     UINT16                  SubsystemDeviceId;
   1441   1.7  christos     UINT16                  SubsystemRevisionId;
   1442   1.9  christos     UINT8                   ValidFields;
   1443   1.9  christos     UINT8                   ManufacturingLocation;
   1444   1.9  christos     UINT16                  ManufacturingDate;
   1445   1.9  christos     UINT8                   Reserved[2];        /* Reserved, must be zero */
   1446   1.7  christos     UINT32                  SerialNumber;
   1447   1.7  christos     UINT16                  Code;
   1448   1.7  christos     UINT16                  Windows;
   1449   1.7  christos     UINT64                  WindowSize;
   1450   1.7  christos     UINT64                  CommandOffset;
   1451   1.7  christos     UINT64                  CommandSize;
   1452   1.7  christos     UINT64                  StatusOffset;
   1453   1.7  christos     UINT64                  StatusSize;
   1454   1.7  christos     UINT16                  Flags;
   1455   1.7  christos     UINT8                   Reserved1[6];       /* Reserved, must be zero */
   1456   1.7  christos 
   1457   1.7  christos } ACPI_NFIT_CONTROL_REGION;
   1458   1.7  christos 
   1459   1.7  christos /* Flags */
   1460   1.7  christos 
   1461   1.9  christos #define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
   1462   1.9  christos 
   1463   1.9  christos /* ValidFields bits */
   1464   1.9  christos 
   1465   1.9  christos #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
   1466   1.7  christos 
   1467   1.7  christos 
   1468   1.7  christos /* 5: NVDIMM Block Data Window Region Structure */
   1469   1.7  christos 
   1470   1.7  christos typedef struct acpi_nfit_data_region
   1471   1.7  christos {
   1472   1.7  christos     ACPI_NFIT_HEADER        Header;
   1473   1.7  christos     UINT16                  RegionIndex;
   1474   1.7  christos     UINT16                  Windows;
   1475   1.7  christos     UINT64                  Offset;
   1476   1.7  christos     UINT64                  Size;
   1477   1.7  christos     UINT64                  Capacity;
   1478   1.7  christos     UINT64                  StartAddress;
   1479   1.7  christos 
   1480   1.7  christos } ACPI_NFIT_DATA_REGION;
   1481   1.7  christos 
   1482   1.7  christos 
   1483   1.7  christos /* 6: Flush Hint Address Structure */
   1484   1.7  christos 
   1485   1.7  christos typedef struct acpi_nfit_flush_address
   1486   1.7  christos {
   1487   1.7  christos     ACPI_NFIT_HEADER        Header;
   1488   1.7  christos     UINT32                  DeviceHandle;
   1489   1.7  christos     UINT16                  HintCount;
   1490   1.7  christos     UINT8                   Reserved[6];        /* Reserved, must be zero */
   1491   1.7  christos     UINT64                  HintAddress[1];     /* Variable length */
   1492   1.7  christos 
   1493   1.7  christos } ACPI_NFIT_FLUSH_ADDRESS;
   1494   1.7  christos 
   1495   1.7  christos 
   1496   1.7  christos /*******************************************************************************
   1497   1.7  christos  *
   1498  1.11  christos  * PDTT - Processor Debug Trigger Table (ACPI 6.2)
   1499  1.11  christos  *        Version 0
   1500  1.11  christos  *
   1501  1.11  christos  ******************************************************************************/
   1502  1.11  christos 
   1503  1.11  christos typedef struct acpi_table_pdtt
   1504  1.11  christos {
   1505  1.11  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1506  1.11  christos     UINT8                   TriggerCount;
   1507  1.11  christos     UINT8                   Reserved[3];
   1508  1.11  christos     UINT32                  ArrayOffset;
   1509  1.11  christos 
   1510  1.11  christos } ACPI_TABLE_PDTT;
   1511  1.11  christos 
   1512  1.11  christos 
   1513  1.11  christos /*
   1514  1.11  christos  * PDTT Communication Channel Identifier Structure.
   1515  1.11  christos  * The number of these structures is defined by TriggerCount above,
   1516  1.11  christos  * starting at ArrayOffset.
   1517  1.11  christos  */
   1518  1.11  christos typedef struct acpi_pdtt_channel
   1519  1.11  christos {
   1520  1.11  christos     UINT16                  SubChannelId;
   1521  1.11  christos 
   1522  1.11  christos } ACPI_PDTT_CHANNEL;
   1523  1.11  christos 
   1524  1.11  christos 
   1525  1.11  christos /* Mask and Flags for above */
   1526  1.11  christos 
   1527  1.11  christos #define ACPI_PDTT_SUBCHANNEL_ID_MASK        0x00FF
   1528  1.11  christos #define ACPI_PDTT_RUNTIME_TRIGGER           (1<<8)
   1529  1.11  christos #define ACPI_PPTT_WAIT_COMPLETION           (1<<9)
   1530  1.11  christos 
   1531  1.11  christos 
   1532  1.11  christos /*******************************************************************************
   1533  1.11  christos  *
   1534  1.11  christos  * PPTT - Processor Properties Topology Table (ACPI 6.2)
   1535  1.11  christos  *        Version 1
   1536  1.11  christos  *
   1537  1.11  christos  ******************************************************************************/
   1538  1.11  christos 
   1539  1.11  christos typedef struct acpi_table_pptt
   1540  1.11  christos {
   1541  1.11  christos     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1542  1.11  christos 
   1543  1.11  christos } ACPI_TABLE_PPTT;
   1544  1.11  christos 
   1545  1.11  christos /* Values for Type field above */
   1546  1.11  christos 
   1547  1.11  christos enum AcpiPpttType
   1548  1.11  christos {
   1549  1.11  christos     ACPI_PPTT_TYPE_PROCESSOR            = 0,
   1550  1.11  christos     ACPI_PPTT_TYPE_CACHE                = 1,
   1551  1.11  christos     ACPI_PPTT_TYPE_ID                   = 2,
   1552  1.11  christos     ACPI_PPTT_TYPE_RESERVED             = 3
   1553  1.11  christos };
   1554  1.11  christos 
   1555  1.11  christos 
   1556  1.11  christos /* 0: Processor Hierarchy Node Structure */
   1557  1.11  christos 
   1558  1.11  christos typedef struct acpi_pptt_processor
   1559  1.11  christos {
   1560  1.11  christos     ACPI_SUBTABLE_HEADER    Header;
   1561  1.11  christos     UINT16                  Reserved;
   1562  1.11  christos     UINT32                  Flags;
   1563  1.11  christos     UINT32                  Parent;
   1564  1.11  christos     UINT32                  AcpiProcessorId;
   1565  1.11  christos     UINT32                  NumberOfPrivResources;
   1566  1.11  christos 
   1567  1.11  christos } ACPI_PPTT_PROCESSOR;
   1568  1.11  christos 
   1569  1.11  christos /* Flags */
   1570  1.11  christos 
   1571  1.11  christos #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)     /* Physical package */
   1572  1.11  christos #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (2)     /* ACPI Processor ID valid */
   1573  1.11  christos 
   1574  1.11  christos 
   1575  1.11  christos /* 1: Cache Type Structure */
   1576  1.11  christos 
   1577  1.11  christos typedef struct acpi_pptt_cache
   1578  1.11  christos {
   1579  1.11  christos     ACPI_SUBTABLE_HEADER    Header;
   1580  1.11  christos     UINT16                  Reserved;
   1581  1.11  christos     UINT32                  Flags;
   1582  1.11  christos     UINT32                  NextLevelOfCache;
   1583  1.11  christos     UINT32                  Size;
   1584  1.11  christos     UINT32                  NumberOfSets;
   1585  1.11  christos     UINT8                   Associativity;
   1586  1.11  christos     UINT8                   Attributes;
   1587  1.11  christos     UINT16                  LineSize;
   1588  1.11  christos 
   1589  1.11  christos } ACPI_PPTT_CACHE;
   1590  1.11  christos 
   1591  1.11  christos /* Flags */
   1592  1.11  christos 
   1593  1.11  christos #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
   1594  1.11  christos #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
   1595  1.11  christos #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
   1596  1.11  christos #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
   1597  1.11  christos #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
   1598  1.11  christos #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
   1599  1.11  christos #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
   1600  1.11  christos 
   1601  1.11  christos /* Masks for Attributes */
   1602  1.11  christos 
   1603  1.11  christos #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
   1604  1.11  christos #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
   1605  1.11  christos #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
   1606  1.11  christos 
   1607  1.11  christos 
   1608  1.11  christos /* 2: ID Structure */
   1609  1.11  christos 
   1610  1.11  christos typedef struct acpi_pptt_id
   1611  1.11  christos {
   1612  1.11  christos     ACPI_SUBTABLE_HEADER    Header;
   1613  1.11  christos     UINT16                  Reserved;
   1614  1.11  christos     UINT32                  VendorId;
   1615  1.11  christos     UINT64                  Level1Id;
   1616  1.11  christos     UINT64                  Level2Id;
   1617  1.11  christos     UINT16                  MajorRev;
   1618  1.11  christos     UINT16                  MinorRev;
   1619  1.11  christos     UINT16                  SpinRev;
   1620  1.11  christos 
   1621  1.11  christos } ACPI_PPTT_ID;
   1622  1.11  christos 
   1623  1.11  christos 
   1624  1.11  christos /*******************************************************************************
   1625  1.11  christos  *
   1626   1.1    jruoho  * SBST - Smart Battery Specification Table
   1627   1.1    jruoho  *        Version 1
   1628   1.1    jruoho  *
   1629   1.1    jruoho  ******************************************************************************/
   1630   1.1    jruoho 
   1631   1.1    jruoho typedef struct acpi_table_sbst
   1632   1.1    jruoho {
   1633   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1634   1.1    jruoho     UINT32                  WarningLevel;
   1635   1.1    jruoho     UINT32                  LowLevel;
   1636   1.1    jruoho     UINT32                  CriticalLevel;
   1637   1.1    jruoho 
   1638   1.1    jruoho } ACPI_TABLE_SBST;
   1639   1.1    jruoho 
   1640   1.1    jruoho 
   1641   1.1    jruoho /*******************************************************************************
   1642   1.1    jruoho  *
   1643   1.1    jruoho  * SLIT - System Locality Distance Information Table
   1644   1.1    jruoho  *        Version 1
   1645   1.1    jruoho  *
   1646   1.1    jruoho  ******************************************************************************/
   1647   1.1    jruoho 
   1648   1.1    jruoho typedef struct acpi_table_slit
   1649   1.1    jruoho {
   1650   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1651   1.1    jruoho     UINT64                  LocalityCount;
   1652   1.1    jruoho     UINT8                   Entry[1];           /* Real size = localities^2 */
   1653   1.1    jruoho 
   1654   1.1    jruoho } ACPI_TABLE_SLIT;
   1655   1.1    jruoho 
   1656   1.1    jruoho 
   1657   1.1    jruoho /*******************************************************************************
   1658   1.1    jruoho  *
   1659   1.1    jruoho  * SRAT - System Resource Affinity Table
   1660   1.1    jruoho  *        Version 3
   1661   1.1    jruoho  *
   1662   1.1    jruoho  ******************************************************************************/
   1663   1.1    jruoho 
   1664   1.1    jruoho typedef struct acpi_table_srat
   1665   1.1    jruoho {
   1666   1.1    jruoho     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1667   1.1    jruoho     UINT32                  TableRevision;      /* Must be value '1' */
   1668   1.1    jruoho     UINT64                  Reserved;           /* Reserved, must be zero */
   1669   1.1    jruoho 
   1670   1.1    jruoho } ACPI_TABLE_SRAT;
   1671   1.1    jruoho 
   1672   1.1    jruoho /* Values for subtable type in ACPI_SUBTABLE_HEADER */
   1673   1.1    jruoho 
   1674   1.1    jruoho enum AcpiSratType
   1675   1.1    jruoho {
   1676   1.1    jruoho     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
   1677   1.1    jruoho     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
   1678   1.1    jruoho     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
   1679   1.5  christos     ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
   1680  1.11  christos     ACPI_SRAT_TYPE_GIC_ITS_AFFINITY     = 4,    /* ACPI 6.2 */
   1681  1.11  christos     ACPI_SRAT_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
   1682   1.1    jruoho };
   1683   1.1    jruoho 
   1684   1.1    jruoho /*
   1685   1.5  christos  * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
   1686   1.1    jruoho  */
   1687   1.1    jruoho 
   1688   1.1    jruoho /* 0: Processor Local APIC/SAPIC Affinity */
   1689   1.1    jruoho 
   1690   1.1    jruoho typedef struct acpi_srat_cpu_affinity
   1691   1.1    jruoho {
   1692   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1693   1.1    jruoho     UINT8                   ProximityDomainLo;
   1694   1.1    jruoho     UINT8                   ApicId;
   1695   1.1    jruoho     UINT32                  Flags;
   1696   1.1    jruoho     UINT8                   LocalSapicEid;
   1697   1.1    jruoho     UINT8                   ProximityDomainHi[3];
   1698   1.2    jruoho     UINT32                  ClockDomain;
   1699   1.1    jruoho 
   1700   1.1    jruoho } ACPI_SRAT_CPU_AFFINITY;
   1701   1.1    jruoho 
   1702   1.1    jruoho /* Flags */
   1703   1.1    jruoho 
   1704   1.1    jruoho #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
   1705   1.1    jruoho 
   1706   1.1    jruoho 
   1707   1.1    jruoho /* 1: Memory Affinity */
   1708   1.1    jruoho 
   1709   1.1    jruoho typedef struct acpi_srat_mem_affinity
   1710   1.1    jruoho {
   1711   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1712   1.1    jruoho     UINT32                  ProximityDomain;
   1713   1.1    jruoho     UINT16                  Reserved;           /* Reserved, must be zero */
   1714   1.1    jruoho     UINT64                  BaseAddress;
   1715   1.1    jruoho     UINT64                  Length;
   1716   1.1    jruoho     UINT32                  Reserved1;
   1717   1.1    jruoho     UINT32                  Flags;
   1718   1.1    jruoho     UINT64                  Reserved2;          /* Reserved, must be zero */
   1719   1.1    jruoho 
   1720   1.1    jruoho } ACPI_SRAT_MEM_AFFINITY;
   1721   1.1    jruoho 
   1722   1.1    jruoho /* Flags */
   1723   1.1    jruoho 
   1724   1.1    jruoho #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
   1725   1.1    jruoho #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
   1726   1.1    jruoho #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
   1727   1.1    jruoho 
   1728   1.1    jruoho 
   1729   1.1    jruoho /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
   1730   1.1    jruoho 
   1731   1.1    jruoho typedef struct acpi_srat_x2apic_cpu_affinity
   1732   1.1    jruoho {
   1733   1.1    jruoho     ACPI_SUBTABLE_HEADER    Header;
   1734   1.1    jruoho     UINT16                  Reserved;           /* Reserved, must be zero */
   1735   1.1    jruoho     UINT32                  ProximityDomain;
   1736   1.1    jruoho     UINT32                  ApicId;
   1737   1.1    jruoho     UINT32                  Flags;
   1738   1.1    jruoho     UINT32                  ClockDomain;
   1739   1.1    jruoho     UINT32                  Reserved2;
   1740   1.1    jruoho 
   1741   1.1    jruoho } ACPI_SRAT_X2APIC_CPU_AFFINITY;
   1742   1.1    jruoho 
   1743   1.1    jruoho /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
   1744   1.1    jruoho 
   1745   1.1    jruoho #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
   1746   1.1    jruoho 
   1747   1.1    jruoho 
   1748   1.5  christos /* 3: GICC Affinity (ACPI 5.1) */
   1749   1.5  christos 
   1750   1.5  christos typedef struct acpi_srat_gicc_affinity
   1751   1.5  christos {
   1752   1.5  christos     ACPI_SUBTABLE_HEADER    Header;
   1753   1.5  christos     UINT32                  ProximityDomain;
   1754   1.5  christos     UINT32                  AcpiProcessorUid;
   1755   1.5  christos     UINT32                  Flags;
   1756   1.5  christos     UINT32                  ClockDomain;
   1757   1.5  christos 
   1758   1.5  christos } ACPI_SRAT_GICC_AFFINITY;
   1759   1.5  christos 
   1760   1.5  christos /* Flags for ACPI_SRAT_GICC_AFFINITY */
   1761   1.5  christos 
   1762   1.5  christos #define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
   1763   1.5  christos 
   1764   1.7  christos 
   1765  1.11  christos /* 4: GCC ITS Affinity (ACPI 6.2) */
   1766  1.11  christos 
   1767  1.11  christos typedef struct acpi_srat_gic_its_affinity
   1768  1.11  christos {
   1769  1.11  christos     ACPI_SUBTABLE_HEADER    Header;
   1770  1.11  christos     UINT32                  ProximityDomain;
   1771  1.11  christos     UINT16                  Reserved;
   1772  1.11  christos     UINT32                  ItsId;
   1773  1.11  christos 
   1774  1.11  christos } ACPI_SRAT_GIC_ITS_AFFINITY;
   1775  1.11  christos 
   1776  1.11  christos 
   1777   1.1    jruoho /* Reset to default packing */
   1778   1.1    jruoho 
   1779   1.1    jruoho #pragma pack()
   1780   1.1    jruoho 
   1781   1.1    jruoho #endif /* __ACTBL1_H__ */
   1782