xref: /freebsd/sys/contrib/dev/acpica/include/actbl3.h (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1 /******************************************************************************
2  *
3  * Name: actbl3.h - ACPI Table Definitions
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2021, 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  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #ifndef __ACTBL3_H__
153 #define __ACTBL3_H__
154 
155 
156 /*******************************************************************************
157  *
158  * Additional ACPI Tables
159  *
160  * These tables are not consumed directly by the ACPICA subsystem, but are
161  * included here to support device drivers and the AML disassembler.
162  *
163  ******************************************************************************/
164 
165 
166 /*
167  * Values for description table header signatures for tables defined in this
168  * file. Useful because they make it more difficult to inadvertently type in
169  * the wrong signature.
170  */
171 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
172 #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
173 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
174 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
175 #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
176 #define ACPI_SIG_STAO           "STAO"      /* Status Override table */
177 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
178 #define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
179 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
180 #define ACPI_SIG_VIOT           "VIOT"      /* Virtual I/O Translation Table */
181 #define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
182 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
183 #define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
184 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
185 #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
186 #define ACPI_SIG_WSMT           "WSMT"      /* Windows SMM Security Mitigations Table */
187 #define ACPI_SIG_XENV           "XENV"      /* Xen Environment table */
188 #define ACPI_SIG_XXXX           "XXXX"      /* Intermediate AML header for ASL/ASL+ converter */
189 
190 /*
191  * All tables must be byte-packed to match the ACPI specification, since
192  * the tables are provided by the system BIOS.
193  */
194 #pragma pack(1)
195 
196 /*
197  * Note: C bitfields are not used for this reason:
198  *
199  * "Bitfields are great and easy to read, but unfortunately the C language
200  * does not specify the layout of bitfields in memory, which means they are
201  * essentially useless for dealing with packed data in on-disk formats or
202  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
203  * this decision was a design error in C. Ritchie could have picked an order
204  * and stuck with it." Norman Ramsey.
205  * See http://stackoverflow.com/a/1053662/41661
206  */
207 
208 
209 /*******************************************************************************
210  *
211  * SLIC - Software Licensing Description Table
212  *
213  * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
214  * November 29, 2011. Copyright 2011 Microsoft
215  *
216  ******************************************************************************/
217 
218 /* Basic SLIC table is only the common ACPI header */
219 
220 typedef struct acpi_table_slic
221 {
222     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
223 
224 } ACPI_TABLE_SLIC;
225 
226 
227 /*******************************************************************************
228  *
229  * SLIT - System Locality Distance Information Table
230  *        Version 1
231  *
232  ******************************************************************************/
233 
234 typedef struct acpi_table_slit
235 {
236     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
237     UINT64                  LocalityCount;
238     UINT8                   Entry[1];           /* Real size = localities^2 */
239 
240 } ACPI_TABLE_SLIT;
241 
242 
243 /*******************************************************************************
244  *
245  * SPCR - Serial Port Console Redirection table
246  *        Version 2
247  *
248  * Conforms to "Serial Port Console Redirection Table",
249  * Version 1.03, August 10, 2015
250  *
251  ******************************************************************************/
252 
253 typedef struct acpi_table_spcr
254 {
255     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
256     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
257     UINT8                   Reserved[3];
258     ACPI_GENERIC_ADDRESS    SerialPort;
259     UINT8                   InterruptType;
260     UINT8                   PcInterrupt;
261     UINT32                  Interrupt;
262     UINT8                   BaudRate;
263     UINT8                   Parity;
264     UINT8                   StopBits;
265     UINT8                   FlowControl;
266     UINT8                   TerminalType;
267     UINT8                   Reserved1;
268     UINT16                  PciDeviceId;
269     UINT16                  PciVendorId;
270     UINT8                   PciBus;
271     UINT8                   PciDevice;
272     UINT8                   PciFunction;
273     UINT32                  PciFlags;
274     UINT8                   PciSegment;
275     UINT32                  Reserved2;
276 
277 } ACPI_TABLE_SPCR;
278 
279 /* Masks for PciFlags field above */
280 
281 #define ACPI_SPCR_DO_NOT_DISABLE    (1)
282 
283 /* Values for Interface Type: See the definition of the DBG2 table */
284 
285 
286 /*******************************************************************************
287  *
288  * SPMI - Server Platform Management Interface table
289  *        Version 5
290  *
291  * Conforms to "Intelligent Platform Management Interface Specification
292  * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
293  * June 12, 2009 markup.
294  *
295  ******************************************************************************/
296 
297 typedef struct acpi_table_spmi
298 {
299     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
300     UINT8                   InterfaceType;
301     UINT8                   Reserved;           /* Must be 1 */
302     UINT16                  SpecRevision;       /* Version of IPMI */
303     UINT8                   InterruptType;
304     UINT8                   GpeNumber;          /* GPE assigned */
305     UINT8                   Reserved1;
306     UINT8                   PciDeviceFlag;
307     UINT32                  Interrupt;
308     ACPI_GENERIC_ADDRESS    IpmiRegister;
309     UINT8                   PciSegment;
310     UINT8                   PciBus;
311     UINT8                   PciDevice;
312     UINT8                   PciFunction;
313     UINT8                   Reserved2;
314 
315 } ACPI_TABLE_SPMI;
316 
317 /* Values for InterfaceType above */
318 
319 enum AcpiSpmiInterfaceTypes
320 {
321     ACPI_SPMI_NOT_USED              = 0,
322     ACPI_SPMI_KEYBOARD              = 1,
323     ACPI_SPMI_SMI                   = 2,
324     ACPI_SPMI_BLOCK_TRANSFER        = 3,
325     ACPI_SPMI_SMBUS                 = 4,
326     ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
327 };
328 
329 
330 /*******************************************************************************
331  *
332  * SRAT - System Resource Affinity Table
333  *        Version 3
334  *
335  ******************************************************************************/
336 
337 typedef struct acpi_table_srat
338 {
339     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
340     UINT32                  TableRevision;      /* Must be value '1' */
341     UINT64                  Reserved;           /* Reserved, must be zero */
342 
343 } ACPI_TABLE_SRAT;
344 
345 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
346 
347 enum AcpiSratType
348 {
349     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
350     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
351     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
352     ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
353     ACPI_SRAT_TYPE_GIC_ITS_AFFINITY     = 4, /* ACPI 6.2 */
354     ACPI_SRAT_TYPE_GENERIC_AFFINITY     = 5, /* ACPI 6.3 */
355     ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY = 6, /* ACPI 6.4 */
356     ACPI_SRAT_TYPE_RESERVED              = 7  /* 7 and greater are reserved */
357 };
358 
359 /*
360  * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
361  */
362 
363 /* 0: Processor Local APIC/SAPIC Affinity */
364 
365 typedef struct acpi_srat_cpu_affinity
366 {
367     ACPI_SUBTABLE_HEADER    Header;
368     UINT8                   ProximityDomainLo;
369     UINT8                   ApicId;
370     UINT32                  Flags;
371     UINT8                   LocalSapicEid;
372     UINT8                   ProximityDomainHi[3];
373     UINT32                  ClockDomain;
374 
375 } ACPI_SRAT_CPU_AFFINITY;
376 
377 /* Flags */
378 
379 #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
380 
381 
382 /* 1: Memory Affinity */
383 
384 typedef struct acpi_srat_mem_affinity
385 {
386     ACPI_SUBTABLE_HEADER    Header;
387     UINT32                  ProximityDomain;
388     UINT16                  Reserved;           /* Reserved, must be zero */
389     UINT64                  BaseAddress;
390     UINT64                  Length;
391     UINT32                  Reserved1;
392     UINT32                  Flags;
393     UINT64                  Reserved2;          /* Reserved, must be zero */
394 
395 } ACPI_SRAT_MEM_AFFINITY;
396 
397 /* Flags */
398 
399 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
400 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
401 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
402 
403 
404 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
405 
406 typedef struct acpi_srat_x2apic_cpu_affinity
407 {
408     ACPI_SUBTABLE_HEADER    Header;
409     UINT16                  Reserved;           /* Reserved, must be zero */
410     UINT32                  ProximityDomain;
411     UINT32                  ApicId;
412     UINT32                  Flags;
413     UINT32                  ClockDomain;
414     UINT32                  Reserved2;
415 
416 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
417 
418 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
419 
420 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
421 
422 
423 /* 3: GICC Affinity (ACPI 5.1) */
424 
425 typedef struct acpi_srat_gicc_affinity
426 {
427     ACPI_SUBTABLE_HEADER    Header;
428     UINT32                  ProximityDomain;
429     UINT32                  AcpiProcessorUid;
430     UINT32                  Flags;
431     UINT32                  ClockDomain;
432 
433 } ACPI_SRAT_GICC_AFFINITY;
434 
435 /* Flags for ACPI_SRAT_GICC_AFFINITY */
436 
437 #define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
438 
439 
440 /* 4: GCC ITS Affinity (ACPI 6.2) */
441 
442 typedef struct acpi_srat_gic_its_affinity
443 {
444     ACPI_SUBTABLE_HEADER    Header;
445     UINT32                  ProximityDomain;
446     UINT16                  Reserved;
447     UINT32                  ItsId;
448 
449 } ACPI_SRAT_GIC_ITS_AFFINITY;
450 
451 /*
452  * Common structure for SRAT subtable types:
453  * 5: ACPI_SRAT_TYPE_GENERIC_AFFINITY
454  * 6: ACPI_SRAT_TYPE_GENERIC_PORT_AFFINITY
455  */
456 
457 typedef struct acpi_srat_generic_affinity
458 {
459     ACPI_SUBTABLE_HEADER    Header;
460     UINT8                   Reserved;
461     UINT8                   DeviceHandleType;
462     UINT32                  ProximityDomain;
463     UINT8                   DeviceHandle[16];
464     UINT32                  Flags;
465     UINT32                  Reserved1;
466 
467 } ACPI_SRAT_GENERIC_AFFINITY;
468 
469 /* Flags for ACPI_SRAT_GENERIC_AFFINITY */
470 
471 #define ACPI_SRAT_GENERIC_AFFINITY_ENABLED     (1)      /* 00: Use affinity structure */
472 #define ACPI_SRAT_ARCHITECTURAL_TRANSACTIONS   (1<<1)   /* ACPI 6.4 */
473 
474 /*******************************************************************************
475  *
476  * STAO - Status Override Table (_STA override) - ACPI 6.0
477  *        Version 1
478  *
479  * Conforms to "ACPI Specification for Status Override Table"
480  * 6 January 2015
481  *
482  ******************************************************************************/
483 
484 typedef struct acpi_table_stao
485 {
486     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
487     UINT8                   IgnoreUart;
488 
489 } ACPI_TABLE_STAO;
490 
491 
492 /*******************************************************************************
493  *
494  * TCPA - Trusted Computing Platform Alliance table
495  *        Version 2
496  *
497  * TCG Hardware Interface Table for TPM 1.2 Clients and Servers
498  *
499  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
500  * Version 1.2, Revision 8
501  * February 27, 2017
502  *
503  * NOTE: There are two versions of the table with the same signature --
504  * the client version and the server version. The common PlatformClass
505  * field is used to differentiate the two types of tables.
506  *
507  ******************************************************************************/
508 
509 typedef struct acpi_table_tcpa_hdr
510 {
511     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
512     UINT16                  PlatformClass;
513 
514 } ACPI_TABLE_TCPA_HDR;
515 
516 /*
517  * Values for PlatformClass above.
518  * This is how the client and server subtables are differentiated
519  */
520 #define ACPI_TCPA_CLIENT_TABLE          0
521 #define ACPI_TCPA_SERVER_TABLE          1
522 
523 
524 typedef struct acpi_table_tcpa_client
525 {
526     UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
527     UINT64                  LogAddress;         /* Address of the event log area */
528 
529 } ACPI_TABLE_TCPA_CLIENT;
530 
531 typedef struct acpi_table_tcpa_server
532 {
533     UINT16                  Reserved;
534     UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
535     UINT64                  LogAddress;         /* Address of the event log area */
536     UINT16                  SpecRevision;
537     UINT8                   DeviceFlags;
538     UINT8                   InterruptFlags;
539     UINT8                   GpeNumber;
540     UINT8                   Reserved2[3];
541     UINT32                  GlobalInterrupt;
542     ACPI_GENERIC_ADDRESS    Address;
543     UINT32                  Reserved3;
544     ACPI_GENERIC_ADDRESS    ConfigAddress;
545     UINT8                   Group;
546     UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
547     UINT8                   Device;
548     UINT8                   Function;
549 
550 } ACPI_TABLE_TCPA_SERVER;
551 
552 /* Values for DeviceFlags above */
553 
554 #define ACPI_TCPA_PCI_DEVICE            (1)
555 #define ACPI_TCPA_BUS_PNP               (1<<1)
556 #define ACPI_TCPA_ADDRESS_VALID         (1<<2)
557 
558 /* Values for InterruptFlags above */
559 
560 #define ACPI_TCPA_INTERRUPT_MODE        (1)
561 #define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
562 #define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
563 #define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
564 
565 
566 /*******************************************************************************
567  *
568  * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
569  *        Version 4
570  *
571  * TCG Hardware Interface Table for TPM 2.0 Clients and Servers
572  *
573  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
574  * Version 1.2, Revision 8
575  * February 27, 2017
576  *
577  ******************************************************************************/
578 
579 /* Revision 3 */
580 
581 typedef struct acpi_table_tpm23
582 {
583     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
584     UINT32                  Reserved;
585     UINT64                  ControlAddress;
586     UINT32                  StartMethod;
587 
588 } ACPI_TABLE_TPM23;
589 
590 /* Value for StartMethod above */
591 
592 #define ACPI_TPM23_ACPI_START_METHOD                 2
593 
594 /*
595  * Optional trailer for revision 3. If start method is 2, there is a 4 byte
596  * reserved area of all zeros.
597  */
598 typedef struct acpi_tmp23_trailer
599 {
600     UINT32                  Reserved;
601 
602 } ACPI_TPM23_TRAILER;
603 
604 
605 /* Revision 4 */
606 
607 typedef struct acpi_table_tpm2
608 {
609     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
610     UINT16                  PlatformClass;
611     UINT16                  Reserved;
612     UINT64                  ControlAddress;
613     UINT32                  StartMethod;
614 
615     /* Platform-specific data follows */
616 
617 } ACPI_TABLE_TPM2;
618 
619 /* Values for StartMethod above */
620 
621 #define ACPI_TPM2_NOT_ALLOWED                       0
622 #define ACPI_TPM2_RESERVED1                         1
623 #define ACPI_TPM2_START_METHOD                      2
624 #define ACPI_TPM2_RESERVED3                         3
625 #define ACPI_TPM2_RESERVED4                         4
626 #define ACPI_TPM2_RESERVED5                         5
627 #define ACPI_TPM2_MEMORY_MAPPED                     6
628 #define ACPI_TPM2_COMMAND_BUFFER                    7
629 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
630 #define ACPI_TPM2_RESERVED9                         9
631 #define ACPI_TPM2_RESERVED10                        10
632 #define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC       11  /* V1.2 Rev 8 */
633 #define ACPI_TPM2_RESERVED                          12
634 
635 
636 /* Optional trailer appears after any StartMethod subtables */
637 
638 typedef struct acpi_tpm2_trailer
639 {
640     UINT8                   MethodParameters[12];
641     UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
642     UINT64                  LogAddress;         /* Address of the event log area */
643 
644 } ACPI_TPM2_TRAILER;
645 
646 
647 /*
648  * Subtables (StartMethod-specific)
649  */
650 
651 /* 11: Start Method for ARM SMC (V1.2 Rev 8) */
652 
653 typedef struct acpi_tpm2_arm_smc
654 {
655     UINT32                  GlobalInterrupt;
656     UINT8                   InterruptFlags;
657     UINT8                   OperationFlags;
658     UINT16                  Reserved;
659     UINT32                  FunctionId;
660 
661 } ACPI_TPM2_ARM_SMC;
662 
663 /* Values for InterruptFlags above */
664 
665 #define ACPI_TPM2_INTERRUPT_SUPPORT     (1)
666 
667 /* Values for OperationFlags above */
668 
669 #define ACPI_TPM2_IDLE_SUPPORT          (1)
670 
671 
672 /*******************************************************************************
673  *
674  * UEFI - UEFI Boot optimization Table
675  *        Version 1
676  *
677  * Conforms to "Unified Extensible Firmware Interface Specification",
678  * Version 2.3, May 8, 2009
679  *
680  ******************************************************************************/
681 
682 typedef struct acpi_table_uefi
683 {
684     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
685     UINT8                   Identifier[16];     /* UUID identifier */
686     UINT16                  DataOffset;         /* Offset of remaining data in table */
687 
688 } ACPI_TABLE_UEFI;
689 
690 
691 /*******************************************************************************
692  *
693  * VIOT - Virtual I/O Translation Table
694  *        Version 1
695  *
696  ******************************************************************************/
697 
698 typedef struct acpi_table_viot
699 {
700     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
701     UINT16                  NodeCount;
702     UINT16                  NodeOffset;
703     UINT8                   Reserved[8];
704 
705 } ACPI_TABLE_VIOT;
706 
707 /* VIOT subtable header */
708 
709 typedef struct acpi_viot_header
710 {
711     UINT8                   Type;
712     UINT8                   Reserved;
713     UINT16                  Length;
714 
715 } ACPI_VIOT_HEADER;
716 
717 /* Values for Type field above */
718 
719 enum AcpiViotNodeType
720 {
721     ACPI_VIOT_NODE_PCI_RANGE            = 0x01,
722     ACPI_VIOT_NODE_MMIO                 = 0x02,
723     ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI     = 0x03,
724     ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO    = 0x04,
725     ACPI_VIOT_RESERVED                  = 0x05
726 };
727 
728 /* VIOT subtables */
729 
730 typedef struct acpi_viot_pci_range
731 {
732     ACPI_VIOT_HEADER        Header;
733     UINT32                  EndpointStart;
734     UINT16                  SegmentStart;
735     UINT16                  SegmentEnd;
736     UINT16                  BdfStart;
737     UINT16                  BdfEnd;
738     UINT16                  OutputNode;
739     UINT8                   Reserved[6];
740 
741 } ACPI_VIOT_PCI_RANGE;
742 
743 typedef struct acpi_viot_mmio
744 {
745     ACPI_VIOT_HEADER        Header;
746     UINT32                  Endpoint;
747     UINT64                  BaseAddress;
748     UINT16                  OutputNode;
749     UINT8                   Reserved[6];
750 
751 } ACPI_VIOT_MMIO;
752 
753 typedef struct acpi_viot_virtio_iommu_pci
754 {
755     ACPI_VIOT_HEADER        Header;
756     UINT16                  Segment;
757     UINT16                  Bdf;
758     UINT8                   Reserved[8];
759 
760 } ACPI_VIOT_VIRTIO_IOMMU_PCI;
761 
762 typedef struct acpi_viot_virtio_iommu_mmio
763 {
764     ACPI_VIOT_HEADER        Header;
765     UINT8                   Reserved[4];
766     UINT64                  BaseAddress;
767 
768 } ACPI_VIOT_VIRTIO_IOMMU_MMIO;
769 
770 
771 /*******************************************************************************
772  *
773  * WAET - Windows ACPI Emulated devices Table
774  *        Version 1
775  *
776  * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
777  *
778  ******************************************************************************/
779 
780 typedef struct acpi_table_waet
781 {
782     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
783     UINT32                  Flags;
784 
785 } ACPI_TABLE_WAET;
786 
787 /* Masks for Flags field above */
788 
789 #define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
790 #define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
791 
792 
793 /*******************************************************************************
794  *
795  * WDAT - Watchdog Action Table
796  *        Version 1
797  *
798  * Conforms to "Hardware Watchdog Timers Design Specification",
799  * Copyright 2006 Microsoft Corporation.
800  *
801  ******************************************************************************/
802 
803 typedef struct acpi_table_wdat
804 {
805     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
806     UINT32                  HeaderLength;       /* Watchdog Header Length */
807     UINT16                  PciSegment;         /* PCI Segment number */
808     UINT8                   PciBus;             /* PCI Bus number */
809     UINT8                   PciDevice;          /* PCI Device number */
810     UINT8                   PciFunction;        /* PCI Function number */
811     UINT8                   Reserved[3];
812     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
813     UINT32                  MaxCount;           /* Maximum counter value supported */
814     UINT32                  MinCount;           /* Minimum counter value */
815     UINT8                   Flags;
816     UINT8                   Reserved2[3];
817     UINT32                  Entries;            /* Number of watchdog entries that follow */
818 
819 } ACPI_TABLE_WDAT;
820 
821 /* Masks for Flags field above */
822 
823 #define ACPI_WDAT_ENABLED           (1)
824 #define ACPI_WDAT_STOPPED           0x80
825 
826 
827 /* WDAT Instruction Entries (actions) */
828 
829 typedef struct acpi_wdat_entry
830 {
831     UINT8                   Action;
832     UINT8                   Instruction;
833     UINT16                  Reserved;
834     ACPI_GENERIC_ADDRESS    RegisterRegion;
835     UINT32                  Value;              /* Value used with Read/Write register */
836     UINT32                  Mask;               /* Bitmask required for this register instruction */
837 
838 } ACPI_WDAT_ENTRY;
839 
840 /* Values for Action field above */
841 
842 enum AcpiWdatActions
843 {
844     ACPI_WDAT_RESET                 = 1,
845     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
846     ACPI_WDAT_GET_COUNTDOWN         = 5,
847     ACPI_WDAT_SET_COUNTDOWN         = 6,
848     ACPI_WDAT_GET_RUNNING_STATE     = 8,
849     ACPI_WDAT_SET_RUNNING_STATE     = 9,
850     ACPI_WDAT_GET_STOPPED_STATE     = 10,
851     ACPI_WDAT_SET_STOPPED_STATE     = 11,
852     ACPI_WDAT_GET_REBOOT            = 16,
853     ACPI_WDAT_SET_REBOOT            = 17,
854     ACPI_WDAT_GET_SHUTDOWN          = 18,
855     ACPI_WDAT_SET_SHUTDOWN          = 19,
856     ACPI_WDAT_GET_STATUS            = 32,
857     ACPI_WDAT_SET_STATUS            = 33,
858     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
859 };
860 
861 /* Values for Instruction field above */
862 
863 enum AcpiWdatInstructions
864 {
865     ACPI_WDAT_READ_VALUE            = 0,
866     ACPI_WDAT_READ_COUNTDOWN        = 1,
867     ACPI_WDAT_WRITE_VALUE           = 2,
868     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
869     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
870     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
871 };
872 
873 
874 /*******************************************************************************
875  *
876  * WDDT - Watchdog Descriptor Table
877  *        Version 1
878  *
879  * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
880  * Version 001, September 2002
881  *
882  ******************************************************************************/
883 
884 typedef struct acpi_table_wddt
885 {
886     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
887     UINT16                  SpecVersion;
888     UINT16                  TableVersion;
889     UINT16                  PciVendorId;
890     ACPI_GENERIC_ADDRESS    Address;
891     UINT16                  MaxCount;           /* Maximum counter value supported */
892     UINT16                  MinCount;           /* Minimum counter value supported */
893     UINT16                  Period;
894     UINT16                  Status;
895     UINT16                  Capability;
896 
897 } ACPI_TABLE_WDDT;
898 
899 /* Flags for Status field above */
900 
901 #define ACPI_WDDT_AVAILABLE     (1)
902 #define ACPI_WDDT_ACTIVE        (1<<1)
903 #define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
904 #define ACPI_WDDT_USER_RESET    (1<<11)
905 #define ACPI_WDDT_WDT_RESET     (1<<12)
906 #define ACPI_WDDT_POWER_FAIL    (1<<13)
907 #define ACPI_WDDT_UNKNOWN_RESET (1<<14)
908 
909 /* Flags for Capability field above */
910 
911 #define ACPI_WDDT_AUTO_RESET    (1)
912 #define ACPI_WDDT_ALERT_SUPPORT (1<<1)
913 
914 
915 /*******************************************************************************
916  *
917  * WDRT - Watchdog Resource Table
918  *        Version 1
919  *
920  * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
921  * Version 1.01, August 28, 2006
922  *
923  ******************************************************************************/
924 
925 typedef struct acpi_table_wdrt
926 {
927     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
928     ACPI_GENERIC_ADDRESS    ControlRegister;
929     ACPI_GENERIC_ADDRESS    CountRegister;
930     UINT16                  PciDeviceId;
931     UINT16                  PciVendorId;
932     UINT8                   PciBus;             /* PCI Bus number */
933     UINT8                   PciDevice;          /* PCI Device number */
934     UINT8                   PciFunction;        /* PCI Function number */
935     UINT8                   PciSegment;         /* PCI Segment number */
936     UINT16                  MaxCount;           /* Maximum counter value supported */
937     UINT8                   Units;
938 
939 } ACPI_TABLE_WDRT;
940 
941 
942 /*******************************************************************************
943  *
944  * WPBT - Windows Platform Environment Table (ACPI 6.0)
945  *        Version 1
946  *
947  * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
948  *
949  ******************************************************************************/
950 
951 typedef struct acpi_table_wpbt
952 {
953     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
954     UINT32                  HandoffSize;
955     UINT64                  HandoffAddress;
956     UINT8                   Layout;
957     UINT8                   Type;
958     UINT16                  ArgumentsLength;
959 
960 } ACPI_TABLE_WPBT;
961 
962 typedef struct acpi_wpbt_unicode
963 {
964     UINT16                  *UnicodeString;
965 
966 } ACPI_WPBT_UNICODE;
967 
968 
969 /*******************************************************************************
970  *
971  * WSMT - Windows SMM Security Mitigations Table
972  *        Version 1
973  *
974  * Conforms to "Windows SMM Security Mitigations Table",
975  * Version 1.0, April 18, 2016
976  *
977  ******************************************************************************/
978 
979 typedef struct acpi_table_wsmt
980 {
981     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
982     UINT32                  ProtectionFlags;
983 
984 } ACPI_TABLE_WSMT;
985 
986 /* Flags for ProtectionFlags field above */
987 
988 #define ACPI_WSMT_FIXED_COMM_BUFFERS                (1)
989 #define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
990 #define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION        (4)
991 
992 
993 /*******************************************************************************
994  *
995  * XENV - Xen Environment Table (ACPI 6.0)
996  *        Version 1
997  *
998  * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
999  *
1000  ******************************************************************************/
1001 
1002 typedef struct acpi_table_xenv
1003 {
1004     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1005     UINT64                  GrantTableAddress;
1006     UINT64                  GrantTableSize;
1007     UINT32                  EventInterrupt;
1008     UINT8                   EventFlags;
1009 
1010 } ACPI_TABLE_XENV;
1011 
1012 
1013 /* Reset to default packing */
1014 
1015 #pragma pack()
1016 
1017 #endif /* __ACTBL3_H__ */
1018