xref: /haiku/src/add-ons/kernel/bus_managers/acpi/acpica/include/actbl2.h (revision f2df0cfe93a902842f6f4629ff614f5b3f9bf687)
1 /******************************************************************************
2  *
3  * Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
16  * 2.1. This is your license from Intel Corp. under its intellectual property
17  * rights. You may have additional license terms from the party that provided
18  * you this software, covering your right to use that party's intellectual
19  * property rights.
20  *
21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22  * copy of the source code appearing in this file ("Covered Code") an
23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24  * base code distributed originally by Intel ("Original Intel Code") to copy,
25  * make derivatives, distribute, use and display any portion of the Covered
26  * Code in any form, with the right to sublicense such rights; and
27  *
28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29  * license (with the right to sublicense), under only those claims of Intel
30  * patents that are infringed by the Original Intel Code, to make, use, sell,
31  * offer to sell, and import the Covered Code and derivative works thereof
32  * solely to the minimum extent necessary to exercise the above copyright
33  * license, and in no event shall the patent license extend to any additions
34  * to or modifications of the Original Intel Code. No other license or right
35  * is granted directly or by implication, estoppel or otherwise;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43  * Redistribution of source code of any substantial portion of the Covered
44  * Code or modification with rights to further distribute source must include
45  * the above Copyright Notice, the above License, this list of Conditions,
46  * and the following Disclaimer and Export Compliance provision. In addition,
47  * Licensee must cause all Covered Code to which Licensee contributes to
48  * contain a file documenting the changes Licensee made to create that Covered
49  * Code and the date of any change. Licensee must include in that file the
50  * documentation of any changes made by any predecessor Licensee. Licensee
51  * must include a prominent statement that the modification is derived,
52  * directly or indirectly, from Original Intel Code.
53  *
54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55  * Redistribution of source code of any substantial portion of the Covered
56  * Code or modification without rights to further distribute source must
57  * include the following Disclaimer and Export Compliance provision in the
58  * documentation and/or other materials provided with distribution. In
59  * addition, Licensee may not authorize further sublicense of source of any
60  * portion of the Covered Code, and must include terms to the effect that the
61  * license from Licensee to its licensee is limited to the intellectual
62  * property embodied in the software Licensee provides to its licensee, and
63  * not to intellectual property embodied in modifications its licensee may
64  * make.
65  *
66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67  * substantial portion of the Covered Code or modification must reproduce the
68  * above Copyright Notice, and the following Disclaimer and Export Compliance
69  * provision in the documentation and/or other materials provided with the
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76  * Intel shall be used in advertising or otherwise to promote the sale, use or
77  * other dealings in products derived from or relating to the Covered Code
78  * without prior written authorization from Intel.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88  * PARTICULAR PURPOSE.
89  *
90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97  * LIMITED REMEDY.
98  *
99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100  * software or system incorporating such software without first obtaining any
101  * required license or other approval from the U. S. Department of Commerce or
102  * any other agency or department of the United States Government. In the
103  * event Licensee exports any such software from the United States or
104  * re-exports any such software from a foreign destination, Licensee shall
105  * ensure that the distribution and export/re-export of the software is in
106  * compliance with all laws, regulations, orders, or other restrictions of the
107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108  * any of its subsidiaries will export/re-export any technical data, process,
109  * software, or service, directly or indirectly, to any country for which the
110  * United States government or any agency thereof requires an export license,
111  * other governmental approval, or letter of assurance, without first obtaining
112  * such license, approval or letter.
113  *
114  *****************************************************************************/
115 
116 #ifndef __ACTBL2_H__
117 #define __ACTBL2_H__
118 
119 
120 /*******************************************************************************
121  *
122  * Additional ACPI Tables (2)
123  *
124  * These tables are not consumed directly by the ACPICA subsystem, but are
125  * included here to support device drivers and the AML disassembler.
126  *
127  * Generally, the tables in this file are defined by third-party specifications,
128  * and are not defined directly by the ACPI specification itself.
129  *
130  ******************************************************************************/
131 
132 
133 /*
134  * Values for description table header signatures for tables defined in this
135  * file. Useful because they make it more difficult to inadvertently type in
136  * the wrong signature.
137  */
138 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
139 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
140 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
141 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
142 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
143 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
144 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
145 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
146 #define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
147 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
148 #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
149 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
150 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
151 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
152 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
153 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
154 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
155 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
156 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
157 #define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
158 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
159 #define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
160 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
161 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
162 #define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
163 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
164 
165 #ifdef ACPI_UNDEFINED_TABLES
166 /*
167  * These tables have been seen in the field, but no definition has been found
168  */
169 #define ACPI_SIG_ATKG           "ATKG"
170 #define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
171 #define ACPI_SIG_IEIT           "IEIT"
172 #endif
173 
174 /*
175  * All tables must be byte-packed to match the ACPI specification, since
176  * the tables are provided by the system BIOS.
177  */
178 #pragma pack(1)
179 
180 /*
181  * Note: C bitfields are not used for this reason:
182  *
183  * "Bitfields are great and easy to read, but unfortunately the C language
184  * does not specify the layout of bitfields in memory, which means they are
185  * essentially useless for dealing with packed data in on-disk formats or
186  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
187  * this decision was a design error in C. Ritchie could have picked an order
188  * and stuck with it." Norman Ramsey.
189  * See http://stackoverflow.com/a/1053662/41661
190  */
191 
192 
193 /*******************************************************************************
194  *
195  * ASF - Alert Standard Format table (Signature "ASF!")
196  *       Revision 0x10
197  *
198  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
199  *
200  ******************************************************************************/
201 
202 typedef struct acpi_table_asf
203 {
204     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
205 
206 } ACPI_TABLE_ASF;
207 
208 
209 /* ASF subtable header */
210 
211 typedef struct acpi_asf_header
212 {
213     UINT8                   Type;
214     UINT8                   Reserved;
215     UINT16                  Length;
216 
217 } ACPI_ASF_HEADER;
218 
219 
220 /* Values for Type field above */
221 
222 enum AcpiAsfType
223 {
224     ACPI_ASF_TYPE_INFO          = 0,
225     ACPI_ASF_TYPE_ALERT         = 1,
226     ACPI_ASF_TYPE_CONTROL       = 2,
227     ACPI_ASF_TYPE_BOOT          = 3,
228     ACPI_ASF_TYPE_ADDRESS       = 4,
229     ACPI_ASF_TYPE_RESERVED      = 5
230 };
231 
232 /*
233  * ASF subtables
234  */
235 
236 /* 0: ASF Information */
237 
238 typedef struct acpi_asf_info
239 {
240     ACPI_ASF_HEADER         Header;
241     UINT8                   MinResetValue;
242     UINT8                   MinPollInterval;
243     UINT16                  SystemId;
244     UINT32                  MfgId;
245     UINT8                   Flags;
246     UINT8                   Reserved2[3];
247 
248 } ACPI_ASF_INFO;
249 
250 /* Masks for Flags field above */
251 
252 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
253 
254 
255 /* 1: ASF Alerts */
256 
257 typedef struct acpi_asf_alert
258 {
259     ACPI_ASF_HEADER         Header;
260     UINT8                   AssertMask;
261     UINT8                   DeassertMask;
262     UINT8                   Alerts;
263     UINT8                   DataLength;
264 
265 } ACPI_ASF_ALERT;
266 
267 typedef struct acpi_asf_alert_data
268 {
269     UINT8                   Address;
270     UINT8                   Command;
271     UINT8                   Mask;
272     UINT8                   Value;
273     UINT8                   SensorType;
274     UINT8                   Type;
275     UINT8                   Offset;
276     UINT8                   SourceType;
277     UINT8                   Severity;
278     UINT8                   SensorNumber;
279     UINT8                   Entity;
280     UINT8                   Instance;
281 
282 } ACPI_ASF_ALERT_DATA;
283 
284 
285 /* 2: ASF Remote Control */
286 
287 typedef struct acpi_asf_remote
288 {
289     ACPI_ASF_HEADER         Header;
290     UINT8                   Controls;
291     UINT8                   DataLength;
292     UINT16                  Reserved2;
293 
294 } ACPI_ASF_REMOTE;
295 
296 typedef struct acpi_asf_control_data
297 {
298     UINT8                   Function;
299     UINT8                   Address;
300     UINT8                   Command;
301     UINT8                   Value;
302 
303 } ACPI_ASF_CONTROL_DATA;
304 
305 
306 /* 3: ASF RMCP Boot Options */
307 
308 typedef struct acpi_asf_rmcp
309 {
310     ACPI_ASF_HEADER         Header;
311     UINT8                   Capabilities[7];
312     UINT8                   CompletionCode;
313     UINT32                  EnterpriseId;
314     UINT8                   Command;
315     UINT16                  Parameter;
316     UINT16                  BootOptions;
317     UINT16                  OemParameters;
318 
319 } ACPI_ASF_RMCP;
320 
321 
322 /* 4: ASF Address */
323 
324 typedef struct acpi_asf_address
325 {
326     ACPI_ASF_HEADER         Header;
327     UINT8                   EpromAddress;
328     UINT8                   Devices;
329 
330 } ACPI_ASF_ADDRESS;
331 
332 
333 /*******************************************************************************
334  *
335  * BOOT - Simple Boot Flag Table
336  *        Version 1
337  *
338  * Conforms to the "Simple Boot Flag Specification", Version 2.1
339  *
340  ******************************************************************************/
341 
342 typedef struct acpi_table_boot
343 {
344     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
345     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
346     UINT8                   Reserved[3];
347 
348 } ACPI_TABLE_BOOT;
349 
350 
351 /*******************************************************************************
352  *
353  * CSRT - Core System Resource Table
354  *        Version 0
355  *
356  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
357  *
358  ******************************************************************************/
359 
360 typedef struct acpi_table_csrt
361 {
362     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
363 
364 } ACPI_TABLE_CSRT;
365 
366 
367 /* Resource Group subtable */
368 
369 typedef struct acpi_csrt_group
370 {
371     UINT32                  Length;
372     UINT32                  VendorId;
373     UINT32                  SubvendorId;
374     UINT16                  DeviceId;
375     UINT16                  SubdeviceId;
376     UINT16                  Revision;
377     UINT16                  Reserved;
378     UINT32                  SharedInfoLength;
379 
380     /* Shared data immediately follows (Length = SharedInfoLength) */
381 
382 } ACPI_CSRT_GROUP;
383 
384 /* Shared Info subtable */
385 
386 typedef struct acpi_csrt_shared_info
387 {
388     UINT16                  MajorVersion;
389     UINT16                  MinorVersion;
390     UINT32                  MmioBaseLow;
391     UINT32                  MmioBaseHigh;
392     UINT32                  GsiInterrupt;
393     UINT8                   InterruptPolarity;
394     UINT8                   InterruptMode;
395     UINT8                   NumChannels;
396     UINT8                   DmaAddressWidth;
397     UINT16                  BaseRequestLine;
398     UINT16                  NumHandshakeSignals;
399     UINT32                  MaxBlockSize;
400 
401     /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
402 
403 } ACPI_CSRT_SHARED_INFO;
404 
405 /* Resource Descriptor subtable */
406 
407 typedef struct acpi_csrt_descriptor
408 {
409     UINT32                  Length;
410     UINT16                  Type;
411     UINT16                  Subtype;
412     UINT32                  Uid;
413 
414     /* Resource-specific information immediately follows */
415 
416 } ACPI_CSRT_DESCRIPTOR;
417 
418 
419 /* Resource Types */
420 
421 #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
422 #define ACPI_CSRT_TYPE_TIMER        0x0002
423 #define ACPI_CSRT_TYPE_DMA          0x0003
424 
425 /* Resource Subtypes */
426 
427 #define ACPI_CSRT_XRUPT_LINE        0x0000
428 #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
429 #define ACPI_CSRT_TIMER             0x0000
430 #define ACPI_CSRT_DMA_CHANNEL       0x0000
431 #define ACPI_CSRT_DMA_CONTROLLER    0x0001
432 
433 
434 /*******************************************************************************
435  *
436  * DBG2 - Debug Port Table 2
437  *        Version 0 (Both main table and subtables)
438  *
439  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
440  *
441  ******************************************************************************/
442 
443 typedef struct acpi_table_dbg2
444 {
445     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
446     UINT32                  InfoOffset;
447     UINT32                  InfoCount;
448 
449 } ACPI_TABLE_DBG2;
450 
451 
452 typedef struct acpi_dbg2_header
453 {
454     UINT32                  InfoOffset;
455     UINT32                  InfoCount;
456 
457 } ACPI_DBG2_HEADER;
458 
459 
460 /* Debug Device Information Subtable */
461 
462 typedef struct acpi_dbg2_device
463 {
464     UINT8                   Revision;
465     UINT16                  Length;
466     UINT8                   RegisterCount;      /* Number of BaseAddress registers */
467     UINT16                  NamepathLength;
468     UINT16                  NamepathOffset;
469     UINT16                  OemDataLength;
470     UINT16                  OemDataOffset;
471     UINT16                  PortType;
472     UINT16                  PortSubtype;
473     UINT16                  Reserved;
474     UINT16                  BaseAddressOffset;
475     UINT16                  AddressSizeOffset;
476     /*
477      * Data that follows:
478      *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
479      *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
480      *    Namepath    (required) - Null terminated string. Single dot if not supported.
481      *    OemData     (optional) - Length is OemDataLength.
482      */
483 } ACPI_DBG2_DEVICE;
484 
485 /* Types for PortType field above */
486 
487 #define ACPI_DBG2_SERIAL_PORT       0x8000
488 #define ACPI_DBG2_1394_PORT         0x8001
489 #define ACPI_DBG2_USB_PORT          0x8002
490 #define ACPI_DBG2_NET_PORT          0x8003
491 
492 /* Subtypes for PortSubtype field above */
493 
494 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
495 #define ACPI_DBG2_16550_SUBSET      0x0001
496 
497 #define ACPI_DBG2_1394_STANDARD     0x0000
498 
499 #define ACPI_DBG2_USB_XHCI          0x0000
500 #define ACPI_DBG2_USB_EHCI          0x0001
501 
502 
503 /*******************************************************************************
504  *
505  * DBGP - Debug Port table
506  *        Version 1
507  *
508  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
509  *
510  ******************************************************************************/
511 
512 typedef struct acpi_table_dbgp
513 {
514     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
515     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
516     UINT8                   Reserved[3];
517     ACPI_GENERIC_ADDRESS    DebugPort;
518 
519 } ACPI_TABLE_DBGP;
520 
521 
522 /*******************************************************************************
523  *
524  * DMAR - DMA Remapping table
525  *        Version 1
526  *
527  * Conforms to "Intel Virtualization Technology for Directed I/O",
528  * Version 2.2, Sept. 2013
529  *
530  ******************************************************************************/
531 
532 typedef struct acpi_table_dmar
533 {
534     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
535     UINT8                   Width;              /* Host Address Width */
536     UINT8                   Flags;
537     UINT8                   Reserved[10];
538 
539 } ACPI_TABLE_DMAR;
540 
541 /* Masks for Flags field above */
542 
543 #define ACPI_DMAR_INTR_REMAP        (1)
544 
545 
546 /* DMAR subtable header */
547 
548 typedef struct acpi_dmar_header
549 {
550     UINT16                  Type;
551     UINT16                  Length;
552 
553 } ACPI_DMAR_HEADER;
554 
555 /* Values for subtable type in ACPI_DMAR_HEADER */
556 
557 enum AcpiDmarType
558 {
559     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
560     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
561     ACPI_DMAR_TYPE_ROOT_ATS             = 2,
562     ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
563     ACPI_DMAR_TYPE_NAMESPACE            = 4,
564     ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
565 };
566 
567 
568 /* DMAR Device Scope structure */
569 
570 typedef struct acpi_dmar_device_scope
571 {
572     UINT8                   EntryType;
573     UINT8                   Length;
574     UINT16                  Reserved;
575     UINT8                   EnumerationId;
576     UINT8                   Bus;
577 
578 } ACPI_DMAR_DEVICE_SCOPE;
579 
580 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
581 
582 enum AcpiDmarScopeType
583 {
584     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
585     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
586     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
587     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
588     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
589     ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
590     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
591 };
592 
593 typedef struct acpi_dmar_pci_path
594 {
595     UINT8                   Device;
596     UINT8                   Function;
597 
598 } ACPI_DMAR_PCI_PATH;
599 
600 
601 /*
602  * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
603  */
604 
605 /* 0: Hardware Unit Definition */
606 
607 typedef struct acpi_dmar_hardware_unit
608 {
609     ACPI_DMAR_HEADER        Header;
610     UINT8                   Flags;
611     UINT8                   Reserved;
612     UINT16                  Segment;
613     UINT64                  Address;            /* Register Base Address */
614 
615 } ACPI_DMAR_HARDWARE_UNIT;
616 
617 /* Masks for Flags field above */
618 
619 #define ACPI_DMAR_INCLUDE_ALL       (1)
620 
621 
622 /* 1: Reserved Memory Defininition */
623 
624 typedef struct acpi_dmar_reserved_memory
625 {
626     ACPI_DMAR_HEADER        Header;
627     UINT16                  Reserved;
628     UINT16                  Segment;
629     UINT64                  BaseAddress;        /* 4K aligned base address */
630     UINT64                  EndAddress;         /* 4K aligned limit address */
631 
632 } ACPI_DMAR_RESERVED_MEMORY;
633 
634 /* Masks for Flags field above */
635 
636 #define ACPI_DMAR_ALLOW_ALL         (1)
637 
638 
639 /* 2: Root Port ATS Capability Reporting Structure */
640 
641 typedef struct acpi_dmar_atsr
642 {
643     ACPI_DMAR_HEADER        Header;
644     UINT8                   Flags;
645     UINT8                   Reserved;
646     UINT16                  Segment;
647 
648 } ACPI_DMAR_ATSR;
649 
650 /* Masks for Flags field above */
651 
652 #define ACPI_DMAR_ALL_PORTS         (1)
653 
654 
655 /* 3: Remapping Hardware Static Affinity Structure */
656 
657 typedef struct acpi_dmar_rhsa
658 {
659     ACPI_DMAR_HEADER        Header;
660     UINT32                  Reserved;
661     UINT64                  BaseAddress;
662     UINT32                  ProximityDomain;
663 
664 } ACPI_DMAR_RHSA;
665 
666 
667 /* 4: ACPI Namespace Device Declaration Structure */
668 
669 typedef struct acpi_dmar_andd
670 {
671     ACPI_DMAR_HEADER        Header;
672     UINT8                   Reserved[3];
673     UINT8                   DeviceNumber;
674     char                    DeviceName[1];
675 
676 } ACPI_DMAR_ANDD;
677 
678 
679 /*******************************************************************************
680  *
681  * HPET - High Precision Event Timer table
682  *        Version 1
683  *
684  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
685  * Version 1.0a, October 2004
686  *
687  ******************************************************************************/
688 
689 typedef struct acpi_table_hpet
690 {
691     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
692     UINT32                  Id;                 /* Hardware ID of event timer block */
693     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
694     UINT8                   Sequence;           /* HPET sequence number */
695     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
696     UINT8                   Flags;
697 
698 } ACPI_TABLE_HPET;
699 
700 /* Masks for Flags field above */
701 
702 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
703 
704 /* Values for Page Protect flags */
705 
706 enum AcpiHpetPageProtect
707 {
708     ACPI_HPET_NO_PAGE_PROTECT       = 0,
709     ACPI_HPET_PAGE_PROTECT4         = 1,
710     ACPI_HPET_PAGE_PROTECT64        = 2
711 };
712 
713 
714 /*******************************************************************************
715  *
716  * IBFT - Boot Firmware Table
717  *        Version 1
718  *
719  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
720  * Specification", Version 1.01, March 1, 2007
721  *
722  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
723  * Therefore, it is not currently supported by the disassembler.
724  *
725  ******************************************************************************/
726 
727 typedef struct acpi_table_ibft
728 {
729     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
730     UINT8                   Reserved[12];
731 
732 } ACPI_TABLE_IBFT;
733 
734 
735 /* IBFT common subtable header */
736 
737 typedef struct acpi_ibft_header
738 {
739     UINT8                   Type;
740     UINT8                   Version;
741     UINT16                  Length;
742     UINT8                   Index;
743     UINT8                   Flags;
744 
745 } ACPI_IBFT_HEADER;
746 
747 /* Values for Type field above */
748 
749 enum AcpiIbftType
750 {
751     ACPI_IBFT_TYPE_NOT_USED         = 0,
752     ACPI_IBFT_TYPE_CONTROL          = 1,
753     ACPI_IBFT_TYPE_INITIATOR        = 2,
754     ACPI_IBFT_TYPE_NIC              = 3,
755     ACPI_IBFT_TYPE_TARGET           = 4,
756     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
757     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
758 };
759 
760 
761 /* IBFT subtables */
762 
763 typedef struct acpi_ibft_control
764 {
765     ACPI_IBFT_HEADER        Header;
766     UINT16                  Extensions;
767     UINT16                  InitiatorOffset;
768     UINT16                  Nic0Offset;
769     UINT16                  Target0Offset;
770     UINT16                  Nic1Offset;
771     UINT16                  Target1Offset;
772 
773 } ACPI_IBFT_CONTROL;
774 
775 typedef struct acpi_ibft_initiator
776 {
777     ACPI_IBFT_HEADER        Header;
778     UINT8                   SnsServer[16];
779     UINT8                   SlpServer[16];
780     UINT8                   PrimaryServer[16];
781     UINT8                   SecondaryServer[16];
782     UINT16                  NameLength;
783     UINT16                  NameOffset;
784 
785 } ACPI_IBFT_INITIATOR;
786 
787 typedef struct acpi_ibft_nic
788 {
789     ACPI_IBFT_HEADER        Header;
790     UINT8                   IpAddress[16];
791     UINT8                   SubnetMaskPrefix;
792     UINT8                   Origin;
793     UINT8                   Gateway[16];
794     UINT8                   PrimaryDns[16];
795     UINT8                   SecondaryDns[16];
796     UINT8                   Dhcp[16];
797     UINT16                  Vlan;
798     UINT8                   MacAddress[6];
799     UINT16                  PciAddress;
800     UINT16                  NameLength;
801     UINT16                  NameOffset;
802 
803 } ACPI_IBFT_NIC;
804 
805 typedef struct acpi_ibft_target
806 {
807     ACPI_IBFT_HEADER        Header;
808     UINT8                   TargetIpAddress[16];
809     UINT16                  TargetIpSocket;
810     UINT8                   TargetBootLun[8];
811     UINT8                   ChapType;
812     UINT8                   NicAssociation;
813     UINT16                  TargetNameLength;
814     UINT16                  TargetNameOffset;
815     UINT16                  ChapNameLength;
816     UINT16                  ChapNameOffset;
817     UINT16                  ChapSecretLength;
818     UINT16                  ChapSecretOffset;
819     UINT16                  ReverseChapNameLength;
820     UINT16                  ReverseChapNameOffset;
821     UINT16                  ReverseChapSecretLength;
822     UINT16                  ReverseChapSecretOffset;
823 
824 } ACPI_IBFT_TARGET;
825 
826 
827 /*******************************************************************************
828  *
829  * IORT - IO Remapping Table
830  *
831  * Conforms to "IO Remapping Table System Software on ARM Platforms",
832  * Document number: ARM DEN 0049A, 2015
833  *
834  ******************************************************************************/
835 
836 typedef struct acpi_table_iort
837 {
838     ACPI_TABLE_HEADER       Header;
839     UINT32                  NodeCount;
840     UINT32                  NodeOffset;
841     UINT32                  Reserved;
842 
843 } ACPI_TABLE_IORT;
844 
845 
846 /*
847  * IORT subtables
848  */
849 typedef struct acpi_iort_node
850 {
851     UINT8                   Type;
852     UINT16                  Length;
853     UINT8                   Revision;
854     UINT32                  Reserved;
855     UINT32                  MappingCount;
856     UINT32                  MappingOffset;
857     char                    NodeData[1];
858 
859 } ACPI_IORT_NODE;
860 
861 /* Values for subtable Type above */
862 
863 enum AcpiIortNodeType
864 {
865     ACPI_IORT_NODE_ITS_GROUP            = 0x00,
866     ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
867     ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
868     ACPI_IORT_NODE_SMMU                 = 0x03
869 };
870 
871 
872 typedef struct acpi_iort_id_mapping
873 {
874     UINT32                  InputBase;          /* Lowest value in input range */
875     UINT32                  IdCount;            /* Number of IDs */
876     UINT32                  OutputBase;         /* Lowest value in output range */
877     UINT32                  OutputReference;    /* A reference to the output node */
878     UINT32                  Flags;
879 
880 } ACPI_IORT_ID_MAPPING;
881 
882 /* Masks for Flags field above for IORT subtable */
883 
884 #define ACPI_IORT_ID_SINGLE_MAPPING (1)
885 
886 
887 typedef struct acpi_iort_memory_access
888 {
889     UINT32                  CacheCoherency;
890     UINT8                   Hints;
891     UINT16                  Reserved;
892     UINT8                   MemoryFlags;
893 
894 } ACPI_IORT_MEMORY_ACCESS;
895 
896 /* Values for CacheCoherency field above */
897 
898 #define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
899 #define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
900 
901 /* Masks for Hints field above */
902 
903 #define ACPI_IORT_HT_TRANSIENT          (1)
904 #define ACPI_IORT_HT_WRITE              (1<<1)
905 #define ACPI_IORT_HT_READ               (1<<2)
906 #define ACPI_IORT_HT_OVERRIDE           (1<<3)
907 
908 /* Masks for MemoryFlags field above */
909 
910 #define ACPI_IORT_MF_COHERENCY          (1)
911 #define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
912 
913 
914 /*
915  * IORT node specific subtables
916  */
917 typedef struct acpi_iort_its_group
918 {
919     UINT32                  ItsCount;
920     UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
921 
922 } ACPI_IORT_ITS_GROUP;
923 
924 
925 typedef struct acpi_iort_named_component
926 {
927     UINT32                  NodeFlags;
928     UINT64                  MemoryProperties;       /* Memory access properties */
929     UINT8                   MemoryAddressLimit;     /* Memory address size limit */
930     char                    DeviceName[1];          /* Path of namespace object */
931 
932 } ACPI_IORT_NAMED_COMPONENT;
933 
934 
935 typedef struct acpi_iort_root_complex
936 {
937     UINT64                  MemoryProperties;       /* Memory access properties */
938     UINT32                  AtsAttribute;
939     UINT32                  PciSegmentNumber;
940 
941 } ACPI_IORT_ROOT_COMPLEX;
942 
943 /* Values for AtsAttribute field above */
944 
945 #define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
946 #define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
947 
948 
949 typedef struct acpi_iort_smmu
950 {
951     UINT64                  BaseAddress;            /* SMMU base address */
952     UINT64                  Span;                   /* Length of memory range */
953     UINT32                  Model;
954     UINT32                  Flags;
955     UINT32                  GlobalInterruptOffset;
956     UINT32                  ContextInterruptCount;
957     UINT32                  ContextInterruptOffset;
958     UINT32                  PmuInterruptCount;
959     UINT32                  PmuInterruptOffset;
960     UINT64                  Interrupts[1];          /* Interrupt array */
961 
962 } ACPI_IORT_SMMU;
963 
964 /* Values for Model field above */
965 
966 #define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
967 #define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
968 #define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
969 #define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
970 
971 /* Masks for Flags field above */
972 
973 #define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
974 #define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
975 
976 
977 /*******************************************************************************
978  *
979  * IVRS - I/O Virtualization Reporting Structure
980  *        Version 1
981  *
982  * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
983  * Revision 1.26, February 2009.
984  *
985  ******************************************************************************/
986 
987 typedef struct acpi_table_ivrs
988 {
989     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
990     UINT32                  Info;               /* Common virtualization info */
991     UINT64                  Reserved;
992 
993 } ACPI_TABLE_IVRS;
994 
995 /* Values for Info field above */
996 
997 #define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
998 #define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
999 #define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
1000 
1001 
1002 /* IVRS subtable header */
1003 
1004 typedef struct acpi_ivrs_header
1005 {
1006     UINT8                   Type;               /* Subtable type */
1007     UINT8                   Flags;
1008     UINT16                  Length;             /* Subtable length */
1009     UINT16                  DeviceId;           /* ID of IOMMU */
1010 
1011 } ACPI_IVRS_HEADER;
1012 
1013 /* Values for subtable Type above */
1014 
1015 enum AcpiIvrsType
1016 {
1017     ACPI_IVRS_TYPE_HARDWARE         = 0x10,
1018     ACPI_IVRS_TYPE_MEMORY1          = 0x20,
1019     ACPI_IVRS_TYPE_MEMORY2          = 0x21,
1020     ACPI_IVRS_TYPE_MEMORY3          = 0x22
1021 };
1022 
1023 /* Masks for Flags field above for IVHD subtable */
1024 
1025 #define ACPI_IVHD_TT_ENABLE         (1)
1026 #define ACPI_IVHD_PASS_PW           (1<<1)
1027 #define ACPI_IVHD_RES_PASS_PW       (1<<2)
1028 #define ACPI_IVHD_ISOC              (1<<3)
1029 #define ACPI_IVHD_IOTLB             (1<<4)
1030 
1031 /* Masks for Flags field above for IVMD subtable */
1032 
1033 #define ACPI_IVMD_UNITY             (1)
1034 #define ACPI_IVMD_READ              (1<<1)
1035 #define ACPI_IVMD_WRITE             (1<<2)
1036 #define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
1037 
1038 
1039 /*
1040  * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
1041  */
1042 
1043 /* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
1044 
1045 typedef struct acpi_ivrs_hardware
1046 {
1047     ACPI_IVRS_HEADER        Header;
1048     UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
1049     UINT64                  BaseAddress;        /* IOMMU control registers */
1050     UINT16                  PciSegmentGroup;
1051     UINT16                  Info;               /* MSI number and unit ID */
1052     UINT32                  Reserved;
1053 
1054 } ACPI_IVRS_HARDWARE;
1055 
1056 /* Masks for Info field above */
1057 
1058 #define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
1059 #define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
1060 
1061 
1062 /*
1063  * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
1064  * Upper two bits of the Type field are the (encoded) length of the structure.
1065  * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
1066  * are reserved for future use but not defined.
1067  */
1068 typedef struct acpi_ivrs_de_header
1069 {
1070     UINT8                   Type;
1071     UINT16                  Id;
1072     UINT8                   DataSetting;
1073 
1074 } ACPI_IVRS_DE_HEADER;
1075 
1076 /* Length of device entry is in the top two bits of Type field above */
1077 
1078 #define ACPI_IVHD_ENTRY_LENGTH      0xC0
1079 
1080 /* Values for device entry Type field above */
1081 
1082 enum AcpiIvrsDeviceEntryType
1083 {
1084     /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
1085 
1086     ACPI_IVRS_TYPE_PAD4             = 0,
1087     ACPI_IVRS_TYPE_ALL              = 1,
1088     ACPI_IVRS_TYPE_SELECT           = 2,
1089     ACPI_IVRS_TYPE_START            = 3,
1090     ACPI_IVRS_TYPE_END              = 4,
1091 
1092     /* 8-byte device entries */
1093 
1094     ACPI_IVRS_TYPE_PAD8             = 64,
1095     ACPI_IVRS_TYPE_NOT_USED         = 65,
1096     ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
1097     ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
1098     ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
1099     ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
1100     ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
1101 };
1102 
1103 /* Values for Data field above */
1104 
1105 #define ACPI_IVHD_INIT_PASS         (1)
1106 #define ACPI_IVHD_EINT_PASS         (1<<1)
1107 #define ACPI_IVHD_NMI_PASS          (1<<2)
1108 #define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
1109 #define ACPI_IVHD_LINT0_PASS        (1<<6)
1110 #define ACPI_IVHD_LINT1_PASS        (1<<7)
1111 
1112 
1113 /* Types 0-4: 4-byte device entry */
1114 
1115 typedef struct acpi_ivrs_device4
1116 {
1117     ACPI_IVRS_DE_HEADER     Header;
1118 
1119 } ACPI_IVRS_DEVICE4;
1120 
1121 /* Types 66-67: 8-byte device entry */
1122 
1123 typedef struct acpi_ivrs_device8a
1124 {
1125     ACPI_IVRS_DE_HEADER     Header;
1126     UINT8                   Reserved1;
1127     UINT16                  UsedId;
1128     UINT8                   Reserved2;
1129 
1130 } ACPI_IVRS_DEVICE8A;
1131 
1132 /* Types 70-71: 8-byte device entry */
1133 
1134 typedef struct acpi_ivrs_device8b
1135 {
1136     ACPI_IVRS_DE_HEADER     Header;
1137     UINT32                  ExtendedData;
1138 
1139 } ACPI_IVRS_DEVICE8B;
1140 
1141 /* Values for ExtendedData above */
1142 
1143 #define ACPI_IVHD_ATS_DISABLED      (1<<31)
1144 
1145 /* Type 72: 8-byte device entry */
1146 
1147 typedef struct acpi_ivrs_device8c
1148 {
1149     ACPI_IVRS_DE_HEADER     Header;
1150     UINT8                   Handle;
1151     UINT16                  UsedId;
1152     UINT8                   Variety;
1153 
1154 } ACPI_IVRS_DEVICE8C;
1155 
1156 /* Values for Variety field above */
1157 
1158 #define ACPI_IVHD_IOAPIC            1
1159 #define ACPI_IVHD_HPET              2
1160 
1161 
1162 /* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
1163 
1164 typedef struct acpi_ivrs_memory
1165 {
1166     ACPI_IVRS_HEADER        Header;
1167     UINT16                  AuxData;
1168     UINT64                  Reserved;
1169     UINT64                  StartAddress;
1170     UINT64                  MemoryLength;
1171 
1172 } ACPI_IVRS_MEMORY;
1173 
1174 
1175 /*******************************************************************************
1176  *
1177  * LPIT - Low Power Idle Table
1178  *
1179  * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
1180  *
1181  ******************************************************************************/
1182 
1183 typedef struct acpi_table_lpit
1184 {
1185     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1186 
1187 } ACPI_TABLE_LPIT;
1188 
1189 
1190 /* LPIT subtable header */
1191 
1192 typedef struct acpi_lpit_header
1193 {
1194     UINT32                  Type;               /* Subtable type */
1195     UINT32                  Length;             /* Subtable length */
1196     UINT16                  UniqueId;
1197     UINT16                  Reserved;
1198     UINT32                  Flags;
1199 
1200 } ACPI_LPIT_HEADER;
1201 
1202 /* Values for subtable Type above */
1203 
1204 enum AcpiLpitType
1205 {
1206     ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
1207     ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
1208 };
1209 
1210 /* Masks for Flags field above  */
1211 
1212 #define ACPI_LPIT_STATE_DISABLED    (1)
1213 #define ACPI_LPIT_NO_COUNTER        (1<<1)
1214 
1215 /*
1216  * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
1217  */
1218 
1219 /* 0x00: Native C-state instruction based LPI structure */
1220 
1221 typedef struct acpi_lpit_native
1222 {
1223     ACPI_LPIT_HEADER        Header;
1224     ACPI_GENERIC_ADDRESS    EntryTrigger;
1225     UINT32                  Residency;
1226     UINT32                  Latency;
1227     ACPI_GENERIC_ADDRESS    ResidencyCounter;
1228     UINT64                  CounterFrequency;
1229 
1230 } ACPI_LPIT_NATIVE;
1231 
1232 
1233 /*******************************************************************************
1234  *
1235  * MCFG - PCI Memory Mapped Configuration table and subtable
1236  *        Version 1
1237  *
1238  * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
1239  *
1240  ******************************************************************************/
1241 
1242 typedef struct acpi_table_mcfg
1243 {
1244     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1245     UINT8                   Reserved[8];
1246 
1247 } ACPI_TABLE_MCFG;
1248 
1249 
1250 /* Subtable */
1251 
1252 typedef struct acpi_mcfg_allocation
1253 {
1254     UINT64                  Address;            /* Base address, processor-relative */
1255     UINT16                  PciSegment;         /* PCI segment group number */
1256     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
1257     UINT8                   EndBusNumber;       /* Final PCI Bus number */
1258     UINT32                  Reserved;
1259 
1260 } ACPI_MCFG_ALLOCATION;
1261 
1262 
1263 /*******************************************************************************
1264  *
1265  * MCHI - Management Controller Host Interface Table
1266  *        Version 1
1267  *
1268  * Conforms to "Management Component Transport Protocol (MCTP) Host
1269  * Interface Specification", Revision 1.0.0a, October 13, 2009
1270  *
1271  ******************************************************************************/
1272 
1273 typedef struct acpi_table_mchi
1274 {
1275     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1276     UINT8                   InterfaceType;
1277     UINT8                   Protocol;
1278     UINT64                  ProtocolData;
1279     UINT8                   InterruptType;
1280     UINT8                   Gpe;
1281     UINT8                   PciDeviceFlag;
1282     UINT32                  GlobalInterrupt;
1283     ACPI_GENERIC_ADDRESS    ControlRegister;
1284     UINT8                   PciSegment;
1285     UINT8                   PciBus;
1286     UINT8                   PciDevice;
1287     UINT8                   PciFunction;
1288 
1289 } ACPI_TABLE_MCHI;
1290 
1291 
1292 /*******************************************************************************
1293  *
1294  * MSDM - Microsoft Data Management table
1295  *
1296  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1297  * November 29, 2011. Copyright 2011 Microsoft
1298  *
1299  ******************************************************************************/
1300 
1301 /* Basic MSDM table is only the common ACPI header */
1302 
1303 typedef struct acpi_table_msdm
1304 {
1305     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1306 
1307 } ACPI_TABLE_MSDM;
1308 
1309 
1310 /*******************************************************************************
1311  *
1312  * MTMR - MID Timer Table
1313  *        Version 1
1314  *
1315  * Conforms to "Simple Firmware Interface Specification",
1316  * Draft 0.8.2, Oct 19, 2010
1317  * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
1318  *
1319  ******************************************************************************/
1320 
1321 typedef struct acpi_table_mtmr
1322 {
1323     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1324 
1325 } ACPI_TABLE_MTMR;
1326 
1327 /* MTMR entry */
1328 
1329 typedef struct acpi_mtmr_entry
1330 {
1331     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1332     UINT32                  Frequency;
1333     UINT32                  Irq;
1334 
1335 } ACPI_MTMR_ENTRY;
1336 
1337 
1338 /*******************************************************************************
1339  *
1340  * SLIC - Software Licensing Description Table
1341  *
1342  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
1343  * November 29, 2011. Copyright 2011 Microsoft
1344  *
1345  ******************************************************************************/
1346 
1347 /* Basic SLIC table is only the common ACPI header */
1348 
1349 typedef struct acpi_table_slic
1350 {
1351     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1352 
1353 } ACPI_TABLE_SLIC;
1354 
1355 
1356 /*******************************************************************************
1357  *
1358  * SPCR - Serial Port Console Redirection table
1359  *        Version 1
1360  *
1361  * Conforms to "Serial Port Console Redirection Table",
1362  * Version 1.00, January 11, 2002
1363  *
1364  ******************************************************************************/
1365 
1366 typedef struct acpi_table_spcr
1367 {
1368     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1369     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
1370     UINT8                   Reserved[3];
1371     ACPI_GENERIC_ADDRESS    SerialPort;
1372     UINT8                   InterruptType;
1373     UINT8                   PcInterrupt;
1374     UINT32                  Interrupt;
1375     UINT8                   BaudRate;
1376     UINT8                   Parity;
1377     UINT8                   StopBits;
1378     UINT8                   FlowControl;
1379     UINT8                   TerminalType;
1380     UINT8                   Reserved1;
1381     UINT16                  PciDeviceId;
1382     UINT16                  PciVendorId;
1383     UINT8                   PciBus;
1384     UINT8                   PciDevice;
1385     UINT8                   PciFunction;
1386     UINT32                  PciFlags;
1387     UINT8                   PciSegment;
1388     UINT32                  Reserved2;
1389 
1390 } ACPI_TABLE_SPCR;
1391 
1392 /* Masks for PciFlags field above */
1393 
1394 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
1395 
1396 
1397 /*******************************************************************************
1398  *
1399  * SPMI - Server Platform Management Interface table
1400  *        Version 5
1401  *
1402  * Conforms to "Intelligent Platform Management Interface Specification
1403  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
1404  * June 12, 2009 markup.
1405  *
1406  ******************************************************************************/
1407 
1408 typedef struct acpi_table_spmi
1409 {
1410     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1411     UINT8                   InterfaceType;
1412     UINT8                   Reserved;           /* Must be 1 */
1413     UINT16                  SpecRevision;       /* Version of IPMI */
1414     UINT8                   InterruptType;
1415     UINT8                   GpeNumber;          /* GPE assigned */
1416     UINT8                   Reserved1;
1417     UINT8                   PciDeviceFlag;
1418     UINT32                  Interrupt;
1419     ACPI_GENERIC_ADDRESS    IpmiRegister;
1420     UINT8                   PciSegment;
1421     UINT8                   PciBus;
1422     UINT8                   PciDevice;
1423     UINT8                   PciFunction;
1424     UINT8                   Reserved2;
1425 
1426 } ACPI_TABLE_SPMI;
1427 
1428 /* Values for InterfaceType above */
1429 
1430 enum AcpiSpmiInterfaceTypes
1431 {
1432     ACPI_SPMI_NOT_USED              = 0,
1433     ACPI_SPMI_KEYBOARD              = 1,
1434     ACPI_SPMI_SMI                   = 2,
1435     ACPI_SPMI_BLOCK_TRANSFER        = 3,
1436     ACPI_SPMI_SMBUS                 = 4,
1437     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
1438 };
1439 
1440 
1441 /*******************************************************************************
1442  *
1443  * TCPA - Trusted Computing Platform Alliance table
1444  *        Version 2
1445  *
1446  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1447  * December 19, 2014
1448  *
1449  * NOTE: There are two versions of the table with the same signature --
1450  * the client version and the server version. The common PlatformClass
1451  * field is used to differentiate the two types of tables.
1452  *
1453  ******************************************************************************/
1454 
1455 typedef struct acpi_table_tcpa_hdr
1456 {
1457     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1458     UINT16                  PlatformClass;
1459 
1460 } ACPI_TABLE_TCPA_HDR;
1461 
1462 /*
1463  * Values for PlatformClass above.
1464  * This is how the client and server subtables are differentiated
1465  */
1466 #define ACPI_TCPA_CLIENT_TABLE          0
1467 #define ACPI_TCPA_SERVER_TABLE          1
1468 
1469 
1470 typedef struct acpi_table_tcpa_client
1471 {
1472     UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
1473     UINT64                  LogAddress;         /* Address of the event log area */
1474 
1475 } ACPI_TABLE_TCPA_CLIENT;
1476 
1477 typedef struct acpi_table_tcpa_server
1478 {
1479     UINT16                  Reserved;
1480     UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
1481     UINT64                  LogAddress;         /* Address of the event log area */
1482     UINT16                  SpecRevision;
1483     UINT8                   DeviceFlags;
1484     UINT8                   InterruptFlags;
1485     UINT8                   GpeNumber;
1486     UINT8                   Reserved2[3];
1487     UINT32                  GlobalInterrupt;
1488     ACPI_GENERIC_ADDRESS    Address;
1489     UINT32                  Reserved3;
1490     ACPI_GENERIC_ADDRESS    ConfigAddress;
1491     UINT8                   Group;
1492     UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
1493     UINT8                   Device;
1494     UINT8                   Function;
1495 
1496 } ACPI_TABLE_TCPA_SERVER;
1497 
1498 /* Values for DeviceFlags above */
1499 
1500 #define ACPI_TCPA_PCI_DEVICE            (1)
1501 #define ACPI_TCPA_BUS_PNP               (1<<1)
1502 #define ACPI_TCPA_ADDRESS_VALID         (1<<2)
1503 
1504 /* Values for InterruptFlags above */
1505 
1506 #define ACPI_TCPA_INTERRUPT_MODE        (1)
1507 #define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
1508 #define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
1509 #define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
1510 
1511 
1512 /*******************************************************************************
1513  *
1514  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
1515  *        Version 4
1516  *
1517  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
1518  * December 19, 2014
1519  *
1520  ******************************************************************************/
1521 
1522 typedef struct acpi_table_tpm2
1523 {
1524     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1525     UINT16                  PlatformClass;
1526     UINT16                  Reserved;
1527     UINT64                  ControlAddress;
1528     UINT32                  StartMethod;
1529 
1530     /* Platform-specific data follows */
1531 
1532 } ACPI_TABLE_TPM2;
1533 
1534 /* Values for StartMethod above */
1535 
1536 #define ACPI_TPM2_NOT_ALLOWED                       0
1537 #define ACPI_TPM2_START_METHOD                      2
1538 #define ACPI_TPM2_MEMORY_MAPPED                     6
1539 #define ACPI_TPM2_COMMAND_BUFFER                    7
1540 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
1541 
1542 
1543 /*******************************************************************************
1544  *
1545  * UEFI - UEFI Boot optimization Table
1546  *        Version 1
1547  *
1548  * Conforms to "Unified Extensible Firmware Interface Specification",
1549  * Version 2.3, May 8, 2009
1550  *
1551  ******************************************************************************/
1552 
1553 typedef struct acpi_table_uefi
1554 {
1555     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1556     UINT8                   Identifier[16];     /* UUID identifier */
1557     UINT16                  DataOffset;         /* Offset of remaining data in table */
1558 
1559 } ACPI_TABLE_UEFI;
1560 
1561 
1562 /*******************************************************************************
1563  *
1564  * VRTC - Virtual Real Time Clock Table
1565  *        Version 1
1566  *
1567  * Conforms to "Simple Firmware Interface Specification",
1568  * Draft 0.8.2, Oct 19, 2010
1569  * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
1570  *
1571  ******************************************************************************/
1572 
1573 typedef struct acpi_table_vrtc
1574 {
1575     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1576 
1577 } ACPI_TABLE_VRTC;
1578 
1579 /* VRTC entry */
1580 
1581 typedef struct acpi_vrtc_entry
1582 {
1583     ACPI_GENERIC_ADDRESS    PhysicalAddress;
1584     UINT32                  Irq;
1585 
1586 } ACPI_VRTC_ENTRY;
1587 
1588 
1589 /*******************************************************************************
1590  *
1591  * WAET - Windows ACPI Emulated devices Table
1592  *        Version 1
1593  *
1594  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
1595  *
1596  ******************************************************************************/
1597 
1598 typedef struct acpi_table_waet
1599 {
1600     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1601     UINT32                  Flags;
1602 
1603 } ACPI_TABLE_WAET;
1604 
1605 /* Masks for Flags field above */
1606 
1607 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
1608 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
1609 
1610 
1611 /*******************************************************************************
1612  *
1613  * WDAT - Watchdog Action Table
1614  *        Version 1
1615  *
1616  * Conforms to "Hardware Watchdog Timers Design Specification",
1617  * Copyright 2006 Microsoft Corporation.
1618  *
1619  ******************************************************************************/
1620 
1621 typedef struct acpi_table_wdat
1622 {
1623     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1624     UINT32                  HeaderLength;       /* Watchdog Header Length */
1625     UINT16                  PciSegment;         /* PCI Segment number */
1626     UINT8                   PciBus;             /* PCI Bus number */
1627     UINT8                   PciDevice;          /* PCI Device number */
1628     UINT8                   PciFunction;        /* PCI Function number */
1629     UINT8                   Reserved[3];
1630     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1631     UINT32                  MaxCount;           /* Maximum counter value supported */
1632     UINT32                  MinCount;           /* Minimum counter value */
1633     UINT8                   Flags;
1634     UINT8                   Reserved2[3];
1635     UINT32                  Entries;            /* Number of watchdog entries that follow */
1636 
1637 } ACPI_TABLE_WDAT;
1638 
1639 /* Masks for Flags field above */
1640 
1641 #define ACPI_WDAT_ENABLED           (1)
1642 #define ACPI_WDAT_STOPPED           0x80
1643 
1644 
1645 /* WDAT Instruction Entries (actions) */
1646 
1647 typedef struct acpi_wdat_entry
1648 {
1649     UINT8                   Action;
1650     UINT8                   Instruction;
1651     UINT16                  Reserved;
1652     ACPI_GENERIC_ADDRESS    RegisterRegion;
1653     UINT32                  Value;              /* Value used with Read/Write register */
1654     UINT32                  Mask;               /* Bitmask required for this register instruction */
1655 
1656 } ACPI_WDAT_ENTRY;
1657 
1658 /* Values for Action field above */
1659 
1660 enum AcpiWdatActions
1661 {
1662     ACPI_WDAT_RESET                 = 1,
1663     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1664     ACPI_WDAT_GET_COUNTDOWN         = 5,
1665     ACPI_WDAT_SET_COUNTDOWN         = 6,
1666     ACPI_WDAT_GET_RUNNING_STATE     = 8,
1667     ACPI_WDAT_SET_RUNNING_STATE     = 9,
1668     ACPI_WDAT_GET_STOPPED_STATE     = 10,
1669     ACPI_WDAT_SET_STOPPED_STATE     = 11,
1670     ACPI_WDAT_GET_REBOOT            = 16,
1671     ACPI_WDAT_SET_REBOOT            = 17,
1672     ACPI_WDAT_GET_SHUTDOWN          = 18,
1673     ACPI_WDAT_SET_SHUTDOWN          = 19,
1674     ACPI_WDAT_GET_STATUS            = 32,
1675     ACPI_WDAT_SET_STATUS            = 33,
1676     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
1677 };
1678 
1679 /* Values for Instruction field above */
1680 
1681 enum AcpiWdatInstructions
1682 {
1683     ACPI_WDAT_READ_VALUE            = 0,
1684     ACPI_WDAT_READ_COUNTDOWN        = 1,
1685     ACPI_WDAT_WRITE_VALUE           = 2,
1686     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
1687     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
1688     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
1689 };
1690 
1691 
1692 /*******************************************************************************
1693  *
1694  * WDDT - Watchdog Descriptor Table
1695  *        Version 1
1696  *
1697  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
1698  * Version 001, September 2002
1699  *
1700  ******************************************************************************/
1701 
1702 typedef struct acpi_table_wddt
1703 {
1704     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1705     UINT16                  SpecVersion;
1706     UINT16                  TableVersion;
1707     UINT16                  PciVendorId;
1708     ACPI_GENERIC_ADDRESS    Address;
1709     UINT16                  MaxCount;           /* Maximum counter value supported */
1710     UINT16                  MinCount;           /* Minimum counter value supported */
1711     UINT16                  Period;
1712     UINT16                  Status;
1713     UINT16                  Capability;
1714 
1715 } ACPI_TABLE_WDDT;
1716 
1717 /* Flags for Status field above */
1718 
1719 #define ACPI_WDDT_AVAILABLE     (1)
1720 #define ACPI_WDDT_ACTIVE        (1<<1)
1721 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
1722 #define ACPI_WDDT_USER_RESET    (1<<11)
1723 #define ACPI_WDDT_WDT_RESET     (1<<12)
1724 #define ACPI_WDDT_POWER_FAIL    (1<<13)
1725 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
1726 
1727 /* Flags for Capability field above */
1728 
1729 #define ACPI_WDDT_AUTO_RESET    (1)
1730 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
1731 
1732 
1733 /*******************************************************************************
1734  *
1735  * WDRT - Watchdog Resource Table
1736  *        Version 1
1737  *
1738  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
1739  * Version 1.01, August 28, 2006
1740  *
1741  ******************************************************************************/
1742 
1743 typedef struct acpi_table_wdrt
1744 {
1745     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1746     ACPI_GENERIC_ADDRESS    ControlRegister;
1747     ACPI_GENERIC_ADDRESS    CountRegister;
1748     UINT16                  PciDeviceId;
1749     UINT16                  PciVendorId;
1750     UINT8                   PciBus;             /* PCI Bus number */
1751     UINT8                   PciDevice;          /* PCI Device number */
1752     UINT8                   PciFunction;        /* PCI Function number */
1753     UINT8                   PciSegment;         /* PCI Segment number */
1754     UINT16                  MaxCount;           /* Maximum counter value supported */
1755     UINT8                   Units;
1756 
1757 } ACPI_TABLE_WDRT;
1758 
1759 
1760 /* Reset to default packing */
1761 
1762 #pragma pack()
1763 
1764 #endif /* __ACTBL2_H__ */
1765