Home | History | Annotate | Line # | Download | only in include
actbl2.h revision 1.1.1.4
      1 /******************************************************************************
      2  *
      3  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
      4  *
      5  *****************************************************************************/
      6 
      7 /*
      8  * Copyright (C) 2000 - 2013, Intel Corp.
      9  * All rights reserved.
     10  *
     11  * Redistribution and use in source and binary forms, with or without
     12  * modification, are permitted provided that the following conditions
     13  * are met:
     14  * 1. Redistributions of source code must retain the above copyright
     15  *    notice, this list of conditions, and the following disclaimer,
     16  *    without modification.
     17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18  *    substantially similar to the "NO WARRANTY" disclaimer below
     19  *    ("Disclaimer") and any redistribution must be conditioned upon
     20  *    including a substantially similar Disclaimer requirement for further
     21  *    binary redistribution.
     22  * 3. Neither the names of the above-listed copyright holders nor the names
     23  *    of any contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * Alternatively, this software may be distributed under the terms of the
     27  * GNU General Public License ("GPL") version 2 as published by the Free
     28  * Software Foundation.
     29  *
     30  * NO WARRANTY
     31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41  * POSSIBILITY OF SUCH DAMAGES.
     42  */
     43 
     44 #ifndef __ACTBL2_H__
     45 #define __ACTBL2_H__
     46 
     47 
     48 /*******************************************************************************
     49  *
     50  * Additional ACPI Tables (2)
     51  *
     52  * These tables are not consumed directly by the ACPICA subsystem, but are
     53  * included here to support device drivers and the AML disassembler.
     54  *
     55  * The tables in this file are defined by third-party specifications, and are
     56  * not defined directly by the ACPI specification itself.
     57  *
     58  ******************************************************************************/
     59 
     60 
     61 /*
     62  * Values for description table header signatures for tables defined in this
     63  * file. Useful because they make it more difficult to inadvertently type in
     64  * the wrong signature.
     65  */
     66 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
     67 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
     68 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
     69 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
     70 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
     71 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
     72 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
     73 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
     74 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
     75 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
     76 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
     77 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
     78 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
     79 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
     80 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
     81 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
     82 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
     83 #define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
     84 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
     85 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
     86 #define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
     87 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
     88 
     89 #ifdef ACPI_UNDEFINED_TABLES
     90 /*
     91  * These tables have been seen in the field, but no definition has been found
     92  */
     93 #define ACPI_SIG_ATKG           "ATKG"
     94 #define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
     95 #define ACPI_SIG_IEIT           "IEIT"
     96 #endif
     97 
     98 /*
     99  * All tables must be byte-packed to match the ACPI specification, since
    100  * the tables are provided by the system BIOS.
    101  */
    102 #pragma pack(1)
    103 
    104 /*
    105  * Note: C bitfields are not used for this reason:
    106  *
    107  * "Bitfields are great and easy to read, but unfortunately the C language
    108  * does not specify the layout of bitfields in memory, which means they are
    109  * essentially useless for dealing with packed data in on-disk formats or
    110  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
    111  * this decision was a design error in C. Ritchie could have picked an order
    112  * and stuck with it." Norman Ramsey.
    113  * See http://stackoverflow.com/a/1053662/41661
    114  */
    115 
    116 
    117 /*******************************************************************************
    118  *
    119  * ASF - Alert Standard Format table (Signature "ASF!")
    120  *       Revision 0x10
    121  *
    122  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
    123  *
    124  ******************************************************************************/
    125 
    126 typedef struct acpi_table_asf
    127 {
    128     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    129 
    130 } ACPI_TABLE_ASF;
    131 
    132 
    133 /* ASF subtable header */
    134 
    135 typedef struct acpi_asf_header
    136 {
    137     UINT8                   Type;
    138     UINT8                   Reserved;
    139     UINT16                  Length;
    140 
    141 } ACPI_ASF_HEADER;
    142 
    143 
    144 /* Values for Type field above */
    145 
    146 enum AcpiAsfType
    147 {
    148     ACPI_ASF_TYPE_INFO          = 0,
    149     ACPI_ASF_TYPE_ALERT         = 1,
    150     ACPI_ASF_TYPE_CONTROL       = 2,
    151     ACPI_ASF_TYPE_BOOT          = 3,
    152     ACPI_ASF_TYPE_ADDRESS       = 4,
    153     ACPI_ASF_TYPE_RESERVED      = 5
    154 };
    155 
    156 /*
    157  * ASF subtables
    158  */
    159 
    160 /* 0: ASF Information */
    161 
    162 typedef struct acpi_asf_info
    163 {
    164     ACPI_ASF_HEADER         Header;
    165     UINT8                   MinResetValue;
    166     UINT8                   MinPollInterval;
    167     UINT16                  SystemId;
    168     UINT32                  MfgId;
    169     UINT8                   Flags;
    170     UINT8                   Reserved2[3];
    171 
    172 } ACPI_ASF_INFO;
    173 
    174 /* Masks for Flags field above */
    175 
    176 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
    177 
    178 
    179 /* 1: ASF Alerts */
    180 
    181 typedef struct acpi_asf_alert
    182 {
    183     ACPI_ASF_HEADER         Header;
    184     UINT8                   AssertMask;
    185     UINT8                   DeassertMask;
    186     UINT8                   Alerts;
    187     UINT8                   DataLength;
    188 
    189 } ACPI_ASF_ALERT;
    190 
    191 typedef struct acpi_asf_alert_data
    192 {
    193     UINT8                   Address;
    194     UINT8                   Command;
    195     UINT8                   Mask;
    196     UINT8                   Value;
    197     UINT8                   SensorType;
    198     UINT8                   Type;
    199     UINT8                   Offset;
    200     UINT8                   SourceType;
    201     UINT8                   Severity;
    202     UINT8                   SensorNumber;
    203     UINT8                   Entity;
    204     UINT8                   Instance;
    205 
    206 } ACPI_ASF_ALERT_DATA;
    207 
    208 
    209 /* 2: ASF Remote Control */
    210 
    211 typedef struct acpi_asf_remote
    212 {
    213     ACPI_ASF_HEADER         Header;
    214     UINT8                   Controls;
    215     UINT8                   DataLength;
    216     UINT16                  Reserved2;
    217 
    218 } ACPI_ASF_REMOTE;
    219 
    220 typedef struct acpi_asf_control_data
    221 {
    222     UINT8                   Function;
    223     UINT8                   Address;
    224     UINT8                   Command;
    225     UINT8                   Value;
    226 
    227 } ACPI_ASF_CONTROL_DATA;
    228 
    229 
    230 /* 3: ASF RMCP Boot Options */
    231 
    232 typedef struct acpi_asf_rmcp
    233 {
    234     ACPI_ASF_HEADER         Header;
    235     UINT8                   Capabilities[7];
    236     UINT8                   CompletionCode;
    237     UINT32                  EnterpriseId;
    238     UINT8                   Command;
    239     UINT16                  Parameter;
    240     UINT16                  BootOptions;
    241     UINT16                  OemParameters;
    242 
    243 } ACPI_ASF_RMCP;
    244 
    245 
    246 /* 4: ASF Address */
    247 
    248 typedef struct acpi_asf_address
    249 {
    250     ACPI_ASF_HEADER         Header;
    251     UINT8                   EpromAddress;
    252     UINT8                   Devices;
    253 
    254 } ACPI_ASF_ADDRESS;
    255 
    256 
    257 /*******************************************************************************
    258  *
    259  * BOOT - Simple Boot Flag Table
    260  *        Version 1
    261  *
    262  * Conforms to the "Simple Boot Flag Specification", Version 2.1
    263  *
    264  ******************************************************************************/
    265 
    266 typedef struct acpi_table_boot
    267 {
    268     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    269     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
    270     UINT8                   Reserved[3];
    271 
    272 } ACPI_TABLE_BOOT;
    273 
    274 
    275 /*******************************************************************************
    276  *
    277  * CSRT - Core System Resource Table
    278  *        Version 0
    279  *
    280  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
    281  *
    282  ******************************************************************************/
    283 
    284 typedef struct acpi_table_csrt
    285 {
    286     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    287 
    288 } ACPI_TABLE_CSRT;
    289 
    290 
    291 /* Resource Group subtable */
    292 
    293 typedef struct acpi_csrt_group
    294 {
    295     UINT32                  Length;
    296     UINT32                  VendorId;
    297     UINT32                  SubvendorId;
    298     UINT16                  DeviceId;
    299     UINT16                  SubdeviceId;
    300     UINT16                  Revision;
    301     UINT16                  Reserved;
    302     UINT32                  SharedInfoLength;
    303 
    304     /* Shared data immediately follows (Length = SharedInfoLength) */
    305 
    306 } ACPI_CSRT_GROUP;
    307 
    308 /* Shared Info subtable */
    309 
    310 typedef struct acpi_csrt_shared_info
    311 {
    312     UINT16                  MajorVersion;
    313     UINT16                  MinorVersion;
    314     UINT32                  MmioBaseLow;
    315     UINT32                  MmioBaseHigh;
    316     UINT32                  GsiInterrupt;
    317     UINT8                   InterruptPolarity;
    318     UINT8                   InterruptMode;
    319     UINT8                   NumChannels;
    320     UINT8                   DmaAddressWidth;
    321     UINT16                  BaseRequestLine;
    322     UINT16                  NumHandshakeSignals;
    323     UINT32                  MaxBlockSize;
    324 
    325     /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
    326 
    327 } ACPI_CSRT_SHARED_INFO;
    328 
    329 /* Resource Descriptor subtable */
    330 
    331 typedef struct acpi_csrt_descriptor
    332 {
    333     UINT32                  Length;
    334     UINT16                  Type;
    335     UINT16                  Subtype;
    336     UINT32                  Uid;
    337 
    338     /* Resource-specific information immediately follows */
    339 
    340 } ACPI_CSRT_DESCRIPTOR;
    341 
    342 
    343 /* Resource Types */
    344 
    345 #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
    346 #define ACPI_CSRT_TYPE_TIMER        0x0002
    347 #define ACPI_CSRT_TYPE_DMA          0x0003
    348 
    349 /* Resource Subtypes */
    350 
    351 #define ACPI_CSRT_XRUPT_LINE        0x0000
    352 #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
    353 #define ACPI_CSRT_TIMER             0x0000
    354 #define ACPI_CSRT_DMA_CHANNEL       0x0000
    355 #define ACPI_CSRT_DMA_CONTROLLER    0x0001
    356 
    357 
    358 /*******************************************************************************
    359  *
    360  * DBG2 - Debug Port Table 2
    361  *        Version 0 (Both main table and subtables)
    362  *
    363  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
    364  *
    365  ******************************************************************************/
    366 
    367 typedef struct acpi_table_dbg2
    368 {
    369     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    370     UINT32                  InfoOffset;
    371     UINT32                  InfoCount;
    372 
    373 } ACPI_TABLE_DBG2;
    374 
    375 
    376 typedef struct acpi_dbg2_header
    377 {
    378     UINT32                  InfoOffset;
    379     UINT32                  InfoCount;
    380 
    381 } ACPI_DBG2_HEADER;
    382 
    383 
    384 /* Debug Device Information Subtable */
    385 
    386 typedef struct acpi_dbg2_device
    387 {
    388     UINT8                   Revision;
    389     UINT16                  Length;
    390     UINT8                   RegisterCount;      /* Number of BaseAddress registers */
    391     UINT16                  NamepathLength;
    392     UINT16                  NamepathOffset;
    393     UINT16                  OemDataLength;
    394     UINT16                  OemDataOffset;
    395     UINT16                  PortType;
    396     UINT16                  PortSubtype;
    397     UINT16                  Reserved;
    398     UINT16                  BaseAddressOffset;
    399     UINT16                  AddressSizeOffset;
    400     /*
    401      * Data that follows:
    402      *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
    403      *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
    404      *    Namepath    (required) - Null terminated string. Single dot if not supported.
    405      *    OemData     (optional) - Length is OemDataLength.
    406      */
    407 } ACPI_DBG2_DEVICE;
    408 
    409 /* Types for PortType field above */
    410 
    411 #define ACPI_DBG2_SERIAL_PORT       0x8000
    412 #define ACPI_DBG2_1394_PORT         0x8001
    413 #define ACPI_DBG2_USB_PORT          0x8002
    414 #define ACPI_DBG2_NET_PORT          0x8003
    415 
    416 /* Subtypes for PortSubtype field above */
    417 
    418 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
    419 #define ACPI_DBG2_16550_SUBSET      0x0001
    420 
    421 #define ACPI_DBG2_1394_STANDARD     0x0000
    422 
    423 #define ACPI_DBG2_USB_XHCI          0x0000
    424 #define ACPI_DBG2_USB_EHCI          0x0001
    425 
    426 
    427 /*******************************************************************************
    428  *
    429  * DBGP - Debug Port table
    430  *        Version 1
    431  *
    432  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
    433  *
    434  ******************************************************************************/
    435 
    436 typedef struct acpi_table_dbgp
    437 {
    438     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    439     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
    440     UINT8                   Reserved[3];
    441     ACPI_GENERIC_ADDRESS    DebugPort;
    442 
    443 } ACPI_TABLE_DBGP;
    444 
    445 
    446 /*******************************************************************************
    447  *
    448  * DMAR - DMA Remapping table
    449  *        Version 1
    450  *
    451  * Conforms to "Intel Virtualization Technology for Directed I/O",
    452  * Version 1.2, Sept. 2008
    453  *
    454  ******************************************************************************/
    455 
    456 typedef struct acpi_table_dmar
    457 {
    458     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    459     UINT8                   Width;              /* Host Address Width */
    460     UINT8                   Flags;
    461     UINT8                   Reserved[10];
    462 
    463 } ACPI_TABLE_DMAR;
    464 
    465 /* Masks for Flags field above */
    466 
    467 #define ACPI_DMAR_INTR_REMAP        (1)
    468 
    469 
    470 /* DMAR subtable header */
    471 
    472 typedef struct acpi_dmar_header
    473 {
    474     UINT16                  Type;
    475     UINT16                  Length;
    476 
    477 } ACPI_DMAR_HEADER;
    478 
    479 /* Values for subtable type in ACPI_DMAR_HEADER */
    480 
    481 enum AcpiDmarType
    482 {
    483     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
    484     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
    485     ACPI_DMAR_TYPE_ATSR                 = 2,
    486     ACPI_DMAR_HARDWARE_AFFINITY         = 3,
    487     ACPI_DMAR_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
    488 };
    489 
    490 
    491 /* DMAR Device Scope structure */
    492 
    493 typedef struct acpi_dmar_device_scope
    494 {
    495     UINT8                   EntryType;
    496     UINT8                   Length;
    497     UINT16                  Reserved;
    498     UINT8                   EnumerationId;
    499     UINT8                   Bus;
    500 
    501 } ACPI_DMAR_DEVICE_SCOPE;
    502 
    503 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
    504 
    505 enum AcpiDmarScopeType
    506 {
    507     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
    508     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
    509     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
    510     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
    511     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
    512     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 5     /* 5 and greater are reserved */
    513 };
    514 
    515 typedef struct acpi_dmar_pci_path
    516 {
    517     UINT8                   Device;
    518     UINT8                   Function;
    519 
    520 } ACPI_DMAR_PCI_PATH;
    521 
    522 
    523 /*
    524  * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
    525  */
    526 
    527 /* 0: Hardware Unit Definition */
    528 
    529 typedef struct acpi_dmar_hardware_unit
    530 {
    531     ACPI_DMAR_HEADER        Header;
    532     UINT8                   Flags;
    533     UINT8                   Reserved;
    534     UINT16                  Segment;
    535     UINT64                  Address;            /* Register Base Address */
    536 
    537 } ACPI_DMAR_HARDWARE_UNIT;
    538 
    539 /* Masks for Flags field above */
    540 
    541 #define ACPI_DMAR_INCLUDE_ALL       (1)
    542 
    543 
    544 /* 1: Reserved Memory Defininition */
    545 
    546 typedef struct acpi_dmar_reserved_memory
    547 {
    548     ACPI_DMAR_HEADER        Header;
    549     UINT16                  Reserved;
    550     UINT16                  Segment;
    551     UINT64                  BaseAddress;        /* 4K aligned base address */
    552     UINT64                  EndAddress;         /* 4K aligned limit address */
    553 
    554 } ACPI_DMAR_RESERVED_MEMORY;
    555 
    556 /* Masks for Flags field above */
    557 
    558 #define ACPI_DMAR_ALLOW_ALL         (1)
    559 
    560 
    561 /* 2: Root Port ATS Capability Reporting Structure */
    562 
    563 typedef struct acpi_dmar_atsr
    564 {
    565     ACPI_DMAR_HEADER        Header;
    566     UINT8                   Flags;
    567     UINT8                   Reserved;
    568     UINT16                  Segment;
    569 
    570 } ACPI_DMAR_ATSR;
    571 
    572 /* Masks for Flags field above */
    573 
    574 #define ACPI_DMAR_ALL_PORTS         (1)
    575 
    576 
    577 /* 3: Remapping Hardware Static Affinity Structure */
    578 
    579 typedef struct acpi_dmar_rhsa
    580 {
    581     ACPI_DMAR_HEADER        Header;
    582     UINT32                  Reserved;
    583     UINT64                  BaseAddress;
    584     UINT32                  ProximityDomain;
    585 
    586 } ACPI_DMAR_RHSA;
    587 
    588 
    589 /*******************************************************************************
    590  *
    591  * HPET - High Precision Event Timer table
    592  *        Version 1
    593  *
    594  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
    595  * Version 1.0a, October 2004
    596  *
    597  ******************************************************************************/
    598 
    599 typedef struct acpi_table_hpet
    600 {
    601     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    602     UINT32                  Id;                 /* Hardware ID of event timer block */
    603     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
    604     UINT8                   Sequence;           /* HPET sequence number */
    605     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
    606     UINT8                   Flags;
    607 
    608 } ACPI_TABLE_HPET;
    609 
    610 /* Masks for Flags field above */
    611 
    612 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
    613 
    614 /* Values for Page Protect flags */
    615 
    616 enum AcpiHpetPageProtect
    617 {
    618     ACPI_HPET_NO_PAGE_PROTECT       = 0,
    619     ACPI_HPET_PAGE_PROTECT4         = 1,
    620     ACPI_HPET_PAGE_PROTECT64        = 2
    621 };
    622 
    623 
    624 /*******************************************************************************
    625  *
    626  * IBFT - Boot Firmware Table
    627  *        Version 1
    628  *
    629  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
    630  * Specification", Version 1.01, March 1, 2007
    631  *
    632  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
    633  * Therefore, it is not currently supported by the disassembler.
    634  *
    635  ******************************************************************************/
    636 
    637 typedef struct acpi_table_ibft
    638 {
    639     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    640     UINT8                   Reserved[12];
    641 
    642 } ACPI_TABLE_IBFT;
    643 
    644 
    645 /* IBFT common subtable header */
    646 
    647 typedef struct acpi_ibft_header
    648 {
    649     UINT8                   Type;
    650     UINT8                   Version;
    651     UINT16                  Length;
    652     UINT8                   Index;
    653     UINT8                   Flags;
    654 
    655 } ACPI_IBFT_HEADER;
    656 
    657 /* Values for Type field above */
    658 
    659 enum AcpiIbftType
    660 {
    661     ACPI_IBFT_TYPE_NOT_USED         = 0,
    662     ACPI_IBFT_TYPE_CONTROL          = 1,
    663     ACPI_IBFT_TYPE_INITIATOR        = 2,
    664     ACPI_IBFT_TYPE_NIC              = 3,
    665     ACPI_IBFT_TYPE_TARGET           = 4,
    666     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
    667     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
    668 };
    669 
    670 
    671 /* IBFT subtables */
    672 
    673 typedef struct acpi_ibft_control
    674 {
    675     ACPI_IBFT_HEADER        Header;
    676     UINT16                  Extensions;
    677     UINT16                  InitiatorOffset;
    678     UINT16                  Nic0Offset;
    679     UINT16                  Target0Offset;
    680     UINT16                  Nic1Offset;
    681     UINT16                  Target1Offset;
    682 
    683 } ACPI_IBFT_CONTROL;
    684 
    685 typedef struct acpi_ibft_initiator
    686 {
    687     ACPI_IBFT_HEADER        Header;
    688     UINT8                   SnsServer[16];
    689     UINT8                   SlpServer[16];
    690     UINT8                   PrimaryServer[16];
    691     UINT8                   SecondaryServer[16];
    692     UINT16                  NameLength;
    693     UINT16                  NameOffset;
    694 
    695 } ACPI_IBFT_INITIATOR;
    696 
    697 typedef struct acpi_ibft_nic
    698 {
    699     ACPI_IBFT_HEADER        Header;
    700     UINT8                   IpAddress[16];
    701     UINT8                   SubnetMaskPrefix;
    702     UINT8                   Origin;
    703     UINT8                   Gateway[16];
    704     UINT8                   PrimaryDns[16];
    705     UINT8                   SecondaryDns[16];
    706     UINT8                   Dhcp[16];
    707     UINT16                  Vlan;
    708     UINT8                   MacAddress[6];
    709     UINT16                  PciAddress;
    710     UINT16                  NameLength;
    711     UINT16                  NameOffset;
    712 
    713 } ACPI_IBFT_NIC;
    714 
    715 typedef struct acpi_ibft_target
    716 {
    717     ACPI_IBFT_HEADER        Header;
    718     UINT8                   TargetIpAddress[16];
    719     UINT16                  TargetIpSocket;
    720     UINT8                   TargetBootLun[8];
    721     UINT8                   ChapType;
    722     UINT8                   NicAssociation;
    723     UINT16                  TargetNameLength;
    724     UINT16                  TargetNameOffset;
    725     UINT16                  ChapNameLength;
    726     UINT16                  ChapNameOffset;
    727     UINT16                  ChapSecretLength;
    728     UINT16                  ChapSecretOffset;
    729     UINT16                  ReverseChapNameLength;
    730     UINT16                  ReverseChapNameOffset;
    731     UINT16                  ReverseChapSecretLength;
    732     UINT16                  ReverseChapSecretOffset;
    733 
    734 } ACPI_IBFT_TARGET;
    735 
    736 
    737 /*******************************************************************************
    738  *
    739  * IVRS - I/O Virtualization Reporting Structure
    740  *        Version 1
    741  *
    742  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
    743  * Revision 1.26, February 2009.
    744  *
    745  ******************************************************************************/
    746 
    747 typedef struct acpi_table_ivrs
    748 {
    749     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    750     UINT32                  Info;               /* Common virtualization info */
    751     UINT64                  Reserved;
    752 
    753 } ACPI_TABLE_IVRS;
    754 
    755 /* Values for Info field above */
    756 
    757 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
    758 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
    759 #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
    760 
    761 
    762 /* IVRS subtable header */
    763 
    764 typedef struct acpi_ivrs_header
    765 {
    766     UINT8                   Type;               /* Subtable type */
    767     UINT8                   Flags;
    768     UINT16                  Length;             /* Subtable length */
    769     UINT16                  DeviceId;           /* ID of IOMMU */
    770 
    771 } ACPI_IVRS_HEADER;
    772 
    773 /* Values for subtable Type above */
    774 
    775 enum AcpiIvrsType
    776 {
    777     ACPI_IVRS_TYPE_HARDWARE         = 0x10,
    778     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
    779     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
    780     ACPI_IVRS_TYPE_MEMORY3          = 0x22
    781 };
    782 
    783 /* Masks for Flags field above for IVHD subtable */
    784 
    785 #define ACPI_IVHD_TT_ENABLE         (1)
    786 #define ACPI_IVHD_PASS_PW           (1<<1)
    787 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
    788 #define ACPI_IVHD_ISOC              (1<<3)
    789 #define ACPI_IVHD_IOTLB             (1<<4)
    790 
    791 /* Masks for Flags field above for IVMD subtable */
    792 
    793 #define ACPI_IVMD_UNITY             (1)
    794 #define ACPI_IVMD_READ              (1<<1)
    795 #define ACPI_IVMD_WRITE             (1<<2)
    796 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
    797 
    798 
    799 /*
    800  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
    801  */
    802 
    803 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
    804 
    805 typedef struct acpi_ivrs_hardware
    806 {
    807     ACPI_IVRS_HEADER        Header;
    808     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
    809     UINT64                  BaseAddress;        /* IOMMU control registers */
    810     UINT16                  PciSegmentGroup;
    811     UINT16                  Info;               /* MSI number and unit ID */
    812     UINT32                  Reserved;
    813 
    814 } ACPI_IVRS_HARDWARE;
    815 
    816 /* Masks for Info field above */
    817 
    818 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
    819 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
    820 
    821 
    822 /*
    823  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
    824  * Upper two bits of the Type field are the (encoded) length of the structure.
    825  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
    826  * are reserved for future use but not defined.
    827  */
    828 typedef struct acpi_ivrs_de_header
    829 {
    830     UINT8                   Type;
    831     UINT16                  Id;
    832     UINT8                   DataSetting;
    833 
    834 } ACPI_IVRS_DE_HEADER;
    835 
    836 /* Length of device entry is in the top two bits of Type field above */
    837 
    838 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
    839 
    840 /* Values for device entry Type field above */
    841 
    842 enum AcpiIvrsDeviceEntryType
    843 {
    844     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
    845 
    846     ACPI_IVRS_TYPE_PAD4             = 0,
    847     ACPI_IVRS_TYPE_ALL              = 1,
    848     ACPI_IVRS_TYPE_SELECT           = 2,
    849     ACPI_IVRS_TYPE_START            = 3,
    850     ACPI_IVRS_TYPE_END              = 4,
    851 
    852     /* 8-byte device entries */
    853 
    854     ACPI_IVRS_TYPE_PAD8             = 64,
    855     ACPI_IVRS_TYPE_NOT_USED         = 65,
    856     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
    857     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
    858     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
    859     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
    860     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
    861 };
    862 
    863 /* Values for Data field above */
    864 
    865 #define ACPI_IVHD_INIT_PASS         (1)
    866 #define ACPI_IVHD_EINT_PASS         (1<<1)
    867 #define ACPI_IVHD_NMI_PASS          (1<<2)
    868 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
    869 #define ACPI_IVHD_LINT0_PASS        (1<<6)
    870 #define ACPI_IVHD_LINT1_PASS        (1<<7)
    871 
    872 
    873 /* Types 0-4: 4-byte device entry */
    874 
    875 typedef struct acpi_ivrs_device4
    876 {
    877     ACPI_IVRS_DE_HEADER     Header;
    878 
    879 } ACPI_IVRS_DEVICE4;
    880 
    881 /* Types 66-67: 8-byte device entry */
    882 
    883 typedef struct acpi_ivrs_device8a
    884 {
    885     ACPI_IVRS_DE_HEADER     Header;
    886     UINT8                   Reserved1;
    887     UINT16                  UsedId;
    888     UINT8                   Reserved2;
    889 
    890 } ACPI_IVRS_DEVICE8A;
    891 
    892 /* Types 70-71: 8-byte device entry */
    893 
    894 typedef struct acpi_ivrs_device8b
    895 {
    896     ACPI_IVRS_DE_HEADER     Header;
    897     UINT32                  ExtendedData;
    898 
    899 } ACPI_IVRS_DEVICE8B;
    900 
    901 /* Values for ExtendedData above */
    902 
    903 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
    904 
    905 /* Type 72: 8-byte device entry */
    906 
    907 typedef struct acpi_ivrs_device8c
    908 {
    909     ACPI_IVRS_DE_HEADER     Header;
    910     UINT8                   Handle;
    911     UINT16                  UsedId;
    912     UINT8                   Variety;
    913 
    914 } ACPI_IVRS_DEVICE8C;
    915 
    916 /* Values for Variety field above */
    917 
    918 #define ACPI_IVHD_IOAPIC            1
    919 #define ACPI_IVHD_HPET              2
    920 
    921 
    922 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
    923 
    924 typedef struct acpi_ivrs_memory
    925 {
    926     ACPI_IVRS_HEADER        Header;
    927     UINT16                  AuxData;
    928     UINT64                  Reserved;
    929     UINT64                  StartAddress;
    930     UINT64                  MemoryLength;
    931 
    932 } ACPI_IVRS_MEMORY;
    933 
    934 
    935 /*******************************************************************************
    936  *
    937  * MCFG - PCI Memory Mapped Configuration table and sub-table
    938  *        Version 1
    939  *
    940  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
    941  *
    942  ******************************************************************************/
    943 
    944 typedef struct acpi_table_mcfg
    945 {
    946     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    947     UINT8                   Reserved[8];
    948 
    949 } ACPI_TABLE_MCFG;
    950 
    951 
    952 /* Subtable */
    953 
    954 typedef struct acpi_mcfg_allocation
    955 {
    956     UINT64                  Address;            /* Base address, processor-relative */
    957     UINT16                  PciSegment;         /* PCI segment group number */
    958     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
    959     UINT8                   EndBusNumber;       /* Final PCI Bus number */
    960     UINT32                  Reserved;
    961 
    962 } ACPI_MCFG_ALLOCATION;
    963 
    964 
    965 /*******************************************************************************
    966  *
    967  * MCHI - Management Controller Host Interface Table
    968  *        Version 1
    969  *
    970  * Conforms to "Management Component Transport Protocol (MCTP) Host
    971  * Interface Specification", Revision 1.0.0a, October 13, 2009
    972  *
    973  ******************************************************************************/
    974 
    975 typedef struct acpi_table_mchi
    976 {
    977     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
    978     UINT8                   InterfaceType;
    979     UINT8                   Protocol;
    980     UINT64                  ProtocolData;
    981     UINT8                   InterruptType;
    982     UINT8                   Gpe;
    983     UINT8                   PciDeviceFlag;
    984     UINT32                  GlobalInterrupt;
    985     ACPI_GENERIC_ADDRESS    ControlRegister;
    986     UINT8                   PciSegment;
    987     UINT8                   PciBus;
    988     UINT8                   PciDevice;
    989     UINT8                   PciFunction;
    990 
    991 } ACPI_TABLE_MCHI;
    992 
    993 
    994 /*******************************************************************************
    995  *
    996  * MTMR - MID Timer Table
    997  *        Version 1
    998  *
    999  * Conforms to "Simple Firmware Interface Specification",
   1000  * Draft 0.8.2, Oct 19, 2010
   1001  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
   1002  *
   1003  ******************************************************************************/
   1004 
   1005 typedef struct acpi_table_mtmr
   1006 {
   1007     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1008 
   1009 } ACPI_TABLE_MTMR;
   1010 
   1011 /* MTMR entry */
   1012 
   1013 typedef struct acpi_mtmr_entry
   1014 {
   1015     ACPI_GENERIC_ADDRESS    PhysicalAddress;
   1016     UINT32                  Frequency;
   1017     UINT32                  Irq;
   1018 
   1019 } ACPI_MTMR_ENTRY;
   1020 
   1021 
   1022 /*******************************************************************************
   1023  *
   1024  * SLIC - Software Licensing Description Table
   1025  *        Version 1
   1026  *
   1027  * Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
   1028  * Copyright 2006
   1029  *
   1030  ******************************************************************************/
   1031 
   1032 /* Basic SLIC table is only the common ACPI header */
   1033 
   1034 typedef struct acpi_table_slic
   1035 {
   1036     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1037 
   1038 } ACPI_TABLE_SLIC;
   1039 
   1040 
   1041 /* Common SLIC subtable header */
   1042 
   1043 typedef struct acpi_slic_header
   1044 {
   1045     UINT32                  Type;
   1046     UINT32                  Length;
   1047 
   1048 } ACPI_SLIC_HEADER;
   1049 
   1050 /* Values for Type field above */
   1051 
   1052 enum AcpiSlicType
   1053 {
   1054     ACPI_SLIC_TYPE_PUBLIC_KEY           = 0,
   1055     ACPI_SLIC_TYPE_WINDOWS_MARKER       = 1,
   1056     ACPI_SLIC_TYPE_RESERVED             = 2    /* 2 and greater are reserved */
   1057 };
   1058 
   1059 
   1060 /*
   1061  * SLIC Sub-tables, correspond to Type in ACPI_SLIC_HEADER
   1062  */
   1063 
   1064 /* 0: Public Key Structure */
   1065 
   1066 typedef struct acpi_slic_key
   1067 {
   1068     ACPI_SLIC_HEADER        Header;
   1069     UINT8                   KeyType;
   1070     UINT8                   Version;
   1071     UINT16                  Reserved;
   1072     UINT32                  Algorithm;
   1073     char                    Magic[4];
   1074     UINT32                  BitLength;
   1075     UINT32                  Exponent;
   1076     UINT8                   Modulus[128];
   1077 
   1078 } ACPI_SLIC_KEY;
   1079 
   1080 
   1081 /* 1: Windows Marker Structure */
   1082 
   1083 typedef struct acpi_slic_marker
   1084 {
   1085     ACPI_SLIC_HEADER        Header;
   1086     UINT32                  Version;
   1087     char                    OemId[ACPI_OEM_ID_SIZE];            /* ASCII OEM identification */
   1088     char                    OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
   1089     char                    WindowsFlag[8];
   1090     UINT32                  SlicVersion;
   1091     UINT8                   Reserved[16];
   1092     UINT8                   Signature[128];
   1093 
   1094 } ACPI_SLIC_MARKER;
   1095 
   1096 
   1097 /*******************************************************************************
   1098  *
   1099  * SPCR - Serial Port Console Redirection table
   1100  *        Version 1
   1101  *
   1102  * Conforms to "Serial Port Console Redirection Table",
   1103  * Version 1.00, January 11, 2002
   1104  *
   1105  ******************************************************************************/
   1106 
   1107 typedef struct acpi_table_spcr
   1108 {
   1109     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1110     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
   1111     UINT8                   Reserved[3];
   1112     ACPI_GENERIC_ADDRESS    SerialPort;
   1113     UINT8                   InterruptType;
   1114     UINT8                   PcInterrupt;
   1115     UINT32                  Interrupt;
   1116     UINT8                   BaudRate;
   1117     UINT8                   Parity;
   1118     UINT8                   StopBits;
   1119     UINT8                   FlowControl;
   1120     UINT8                   TerminalType;
   1121     UINT8                   Reserved1;
   1122     UINT16                  PciDeviceId;
   1123     UINT16                  PciVendorId;
   1124     UINT8                   PciBus;
   1125     UINT8                   PciDevice;
   1126     UINT8                   PciFunction;
   1127     UINT32                  PciFlags;
   1128     UINT8                   PciSegment;
   1129     UINT32                  Reserved2;
   1130 
   1131 } ACPI_TABLE_SPCR;
   1132 
   1133 /* Masks for PciFlags field above */
   1134 
   1135 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
   1136 
   1137 
   1138 /*******************************************************************************
   1139  *
   1140  * SPMI - Server Platform Management Interface table
   1141  *        Version 5
   1142  *
   1143  * Conforms to "Intelligent Platform Management Interface Specification
   1144  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
   1145  * June 12, 2009 markup.
   1146  *
   1147  ******************************************************************************/
   1148 
   1149 typedef struct acpi_table_spmi
   1150 {
   1151     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1152     UINT8                   InterfaceType;
   1153     UINT8                   Reserved;           /* Must be 1 */
   1154     UINT16                  SpecRevision;       /* Version of IPMI */
   1155     UINT8                   InterruptType;
   1156     UINT8                   GpeNumber;          /* GPE assigned */
   1157     UINT8                   Reserved1;
   1158     UINT8                   PciDeviceFlag;
   1159     UINT32                  Interrupt;
   1160     ACPI_GENERIC_ADDRESS    IpmiRegister;
   1161     UINT8                   PciSegment;
   1162     UINT8                   PciBus;
   1163     UINT8                   PciDevice;
   1164     UINT8                   PciFunction;
   1165     UINT8                   Reserved2;
   1166 
   1167 } ACPI_TABLE_SPMI;
   1168 
   1169 /* Values for InterfaceType above */
   1170 
   1171 enum AcpiSpmiInterfaceTypes
   1172 {
   1173     ACPI_SPMI_NOT_USED              = 0,
   1174     ACPI_SPMI_KEYBOARD              = 1,
   1175     ACPI_SPMI_SMI                   = 2,
   1176     ACPI_SPMI_BLOCK_TRANSFER        = 3,
   1177     ACPI_SPMI_SMBUS                 = 4,
   1178     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
   1179 };
   1180 
   1181 
   1182 /*******************************************************************************
   1183  *
   1184  * TCPA - Trusted Computing Platform Alliance table
   1185  *        Version 1
   1186  *
   1187  * Conforms to "TCG PC Specific Implementation Specification",
   1188  * Version 1.1, August 18, 2003
   1189  *
   1190  ******************************************************************************/
   1191 
   1192 typedef struct acpi_table_tcpa
   1193 {
   1194     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1195     UINT16                  Reserved;
   1196     UINT32                  MaxLogLength;       /* Maximum length for the event log area */
   1197     UINT64                  LogAddress;         /* Address of the event log area */
   1198 
   1199 } ACPI_TABLE_TCPA;
   1200 
   1201 
   1202 /*******************************************************************************
   1203  *
   1204  * UEFI - UEFI Boot optimization Table
   1205  *        Version 1
   1206  *
   1207  * Conforms to "Unified Extensible Firmware Interface Specification",
   1208  * Version 2.3, May 8, 2009
   1209  *
   1210  ******************************************************************************/
   1211 
   1212 typedef struct acpi_table_uefi
   1213 {
   1214     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1215     UINT8                   Identifier[16];     /* UUID identifier */
   1216     UINT16                  DataOffset;         /* Offset of remaining data in table */
   1217 
   1218 } ACPI_TABLE_UEFI;
   1219 
   1220 
   1221 /*******************************************************************************
   1222  *
   1223  * VRTC - Virtual Real Time Clock Table
   1224  *        Version 1
   1225  *
   1226  * Conforms to "Simple Firmware Interface Specification",
   1227  * Draft 0.8.2, Oct 19, 2010
   1228  * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
   1229  *
   1230  ******************************************************************************/
   1231 
   1232 typedef struct acpi_table_vrtc
   1233 {
   1234     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1235 
   1236 } ACPI_TABLE_VRTC;
   1237 
   1238 /* VRTC entry */
   1239 
   1240 typedef struct acpi_vrtc_entry
   1241 {
   1242     ACPI_GENERIC_ADDRESS    PhysicalAddress;
   1243     UINT32                  Irq;
   1244 
   1245 } ACPI_VRTC_ENTRY;
   1246 
   1247 
   1248 /*******************************************************************************
   1249  *
   1250  * WAET - Windows ACPI Emulated devices Table
   1251  *        Version 1
   1252  *
   1253  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
   1254  *
   1255  ******************************************************************************/
   1256 
   1257 typedef struct acpi_table_waet
   1258 {
   1259     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1260     UINT32                  Flags;
   1261 
   1262 } ACPI_TABLE_WAET;
   1263 
   1264 /* Masks for Flags field above */
   1265 
   1266 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
   1267 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
   1268 
   1269 
   1270 /*******************************************************************************
   1271  *
   1272  * WDAT - Watchdog Action Table
   1273  *        Version 1
   1274  *
   1275  * Conforms to "Hardware Watchdog Timers Design Specification",
   1276  * Copyright 2006 Microsoft Corporation.
   1277  *
   1278  ******************************************************************************/
   1279 
   1280 typedef struct acpi_table_wdat
   1281 {
   1282     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1283     UINT32                  HeaderLength;       /* Watchdog Header Length */
   1284     UINT16                  PciSegment;         /* PCI Segment number */
   1285     UINT8                   PciBus;             /* PCI Bus number */
   1286     UINT8                   PciDevice;          /* PCI Device number */
   1287     UINT8                   PciFunction;        /* PCI Function number */
   1288     UINT8                   Reserved[3];
   1289     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
   1290     UINT32                  MaxCount;           /* Maximum counter value supported */
   1291     UINT32                  MinCount;           /* Minimum counter value */
   1292     UINT8                   Flags;
   1293     UINT8                   Reserved2[3];
   1294     UINT32                  Entries;            /* Number of watchdog entries that follow */
   1295 
   1296 } ACPI_TABLE_WDAT;
   1297 
   1298 /* Masks for Flags field above */
   1299 
   1300 #define ACPI_WDAT_ENABLED           (1)
   1301 #define ACPI_WDAT_STOPPED           0x80
   1302 
   1303 
   1304 /* WDAT Instruction Entries (actions) */
   1305 
   1306 typedef struct acpi_wdat_entry
   1307 {
   1308     UINT8                   Action;
   1309     UINT8                   Instruction;
   1310     UINT16                  Reserved;
   1311     ACPI_GENERIC_ADDRESS    RegisterRegion;
   1312     UINT32                  Value;              /* Value used with Read/Write register */
   1313     UINT32                  Mask;               /* Bitmask required for this register instruction */
   1314 
   1315 } ACPI_WDAT_ENTRY;
   1316 
   1317 /* Values for Action field above */
   1318 
   1319 enum AcpiWdatActions
   1320 {
   1321     ACPI_WDAT_RESET                 = 1,
   1322     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
   1323     ACPI_WDAT_GET_COUNTDOWN         = 5,
   1324     ACPI_WDAT_SET_COUNTDOWN         = 6,
   1325     ACPI_WDAT_GET_RUNNING_STATE     = 8,
   1326     ACPI_WDAT_SET_RUNNING_STATE     = 9,
   1327     ACPI_WDAT_GET_STOPPED_STATE     = 10,
   1328     ACPI_WDAT_SET_STOPPED_STATE     = 11,
   1329     ACPI_WDAT_GET_REBOOT            = 16,
   1330     ACPI_WDAT_SET_REBOOT            = 17,
   1331     ACPI_WDAT_GET_SHUTDOWN          = 18,
   1332     ACPI_WDAT_SET_SHUTDOWN          = 19,
   1333     ACPI_WDAT_GET_STATUS            = 32,
   1334     ACPI_WDAT_SET_STATUS            = 33,
   1335     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
   1336 };
   1337 
   1338 /* Values for Instruction field above */
   1339 
   1340 enum AcpiWdatInstructions
   1341 {
   1342     ACPI_WDAT_READ_VALUE            = 0,
   1343     ACPI_WDAT_READ_COUNTDOWN        = 1,
   1344     ACPI_WDAT_WRITE_VALUE           = 2,
   1345     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
   1346     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
   1347     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
   1348 };
   1349 
   1350 
   1351 /*******************************************************************************
   1352  *
   1353  * WDDT - Watchdog Descriptor Table
   1354  *        Version 1
   1355  *
   1356  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
   1357  * Version 001, September 2002
   1358  *
   1359  ******************************************************************************/
   1360 
   1361 typedef struct acpi_table_wddt
   1362 {
   1363     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1364     UINT16                  SpecVersion;
   1365     UINT16                  TableVersion;
   1366     UINT16                  PciVendorId;
   1367     ACPI_GENERIC_ADDRESS    Address;
   1368     UINT16                  MaxCount;           /* Maximum counter value supported */
   1369     UINT16                  MinCount;           /* Minimum counter value supported */
   1370     UINT16                  Period;
   1371     UINT16                  Status;
   1372     UINT16                  Capability;
   1373 
   1374 } ACPI_TABLE_WDDT;
   1375 
   1376 /* Flags for Status field above */
   1377 
   1378 #define ACPI_WDDT_AVAILABLE     (1)
   1379 #define ACPI_WDDT_ACTIVE        (1<<1)
   1380 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
   1381 #define ACPI_WDDT_USER_RESET    (1<<11)
   1382 #define ACPI_WDDT_WDT_RESET     (1<<12)
   1383 #define ACPI_WDDT_POWER_FAIL    (1<<13)
   1384 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
   1385 
   1386 /* Flags for Capability field above */
   1387 
   1388 #define ACPI_WDDT_AUTO_RESET    (1)
   1389 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
   1390 
   1391 
   1392 /*******************************************************************************
   1393  *
   1394  * WDRT - Watchdog Resource Table
   1395  *        Version 1
   1396  *
   1397  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
   1398  * Version 1.01, August 28, 2006
   1399  *
   1400  ******************************************************************************/
   1401 
   1402 typedef struct acpi_table_wdrt
   1403 {
   1404     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
   1405     ACPI_GENERIC_ADDRESS    ControlRegister;
   1406     ACPI_GENERIC_ADDRESS    CountRegister;
   1407     UINT16                  PciDeviceId;
   1408     UINT16                  PciVendorId;
   1409     UINT8                   PciBus;             /* PCI Bus number */
   1410     UINT8                   PciDevice;          /* PCI Device number */
   1411     UINT8                   PciFunction;        /* PCI Function number */
   1412     UINT8                   PciSegment;         /* PCI Segment number */
   1413     UINT16                  MaxCount;           /* Maximum counter value supported */
   1414     UINT8                   Units;
   1415 
   1416 } ACPI_TABLE_WDRT;
   1417 
   1418 
   1419 /* Reset to default packing */
   1420 
   1421 #pragma pack()
   1422 
   1423 #endif /* __ACTBL2_H__ */
   1424