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