xref: /reactos/drivers/bus/acpi/acpica/include/actbl1.h (revision 98e8827a)
1 /******************************************************************************
2  *
3  * Name: actbl1.h - Additional ACPI table definitions
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2021, 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 __ACTBL1_H__
45 #define __ACTBL1_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_AEST           "AEST"      /* Arm Error Source Table */
64 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
65 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
66 #define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
67 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
68 #define ACPI_SIG_CEDT           "CEDT"      /* CXL Early Discovery Table */
69 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
70 #define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
71 #define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
72 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
73 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
74 #define ACPI_SIG_DRTM           "DRTM"      /* Dynamic Root of Trust for Measurement table */
75 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
76 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
77 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
78 #define ACPI_SIG_FPDT           "FPDT"      /* Firmware Performance Data Table */
79 #define ACPI_SIG_GTDT           "GTDT"      /* Generic Timer Description Table */
80 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
81 #define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
82 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
83 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
84 
85 #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
86 #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
87 
88 
89 /* Reserved table signatures */
90 
91 #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
92 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
93 
94 /*
95  * These tables have been seen in the field, but no definition has been found
96  */
97 #ifdef ACPI_UNDEFINED_TABLES
98 #define ACPI_SIG_ATKG           "ATKG"
99 #define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
100 #define ACPI_SIG_IEIT           "IEIT"
101 #endif
102 
103 /*
104  * All tables must be byte-packed to match the ACPI specification, since
105  * the tables are provided by the system BIOS.
106  */
107 #pragma pack(1)
108 
109 /*
110  * Note: C bitfields are not used for this reason:
111  *
112  * "Bitfields are great and easy to read, but unfortunately the C language
113  * does not specify the layout of bitfields in memory, which means they are
114  * essentially useless for dealing with packed data in on-disk formats or
115  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
116  * this decision was a design error in C. Ritchie could have picked an order
117  * and stuck with it." Norman Ramsey.
118  * See http://stackoverflow.com/a/1053662/41661
119  */
120 
121 
122 /*******************************************************************************
123  *
124  * Common subtable headers
125  *
126  ******************************************************************************/
127 
128 /* Generic subtable header (used in MADT, SRAT, etc.) */
129 
130 typedef struct acpi_subtable_header
131 {
132     UINT8                   Type;
133     UINT8                   Length;
134 
135 } ACPI_SUBTABLE_HEADER;
136 
137 
138 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
139 
140 typedef struct acpi_whea_header
141 {
142     UINT8                   Action;
143     UINT8                   Instruction;
144     UINT8                   Flags;
145     UINT8                   Reserved;
146     ACPI_GENERIC_ADDRESS    RegisterRegion;
147     UINT64                  Value;              /* Value used with Read/Write register */
148     UINT64                  Mask;               /* Bitmask required for this register instruction */
149 
150 } ACPI_WHEA_HEADER;
151 
152 
153 /*******************************************************************************
154  *
155  * ASF - Alert Standard Format table (Signature "ASF!")
156  *       Revision 0x10
157  *
158  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
159  *
160  ******************************************************************************/
161 
162 typedef struct acpi_table_asf
163 {
164     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
165 
166 } ACPI_TABLE_ASF;
167 
168 
169 /* ASF subtable header */
170 
171 typedef struct acpi_asf_header
172 {
173     UINT8                   Type;
174     UINT8                   Reserved;
175     UINT16                  Length;
176 
177 } ACPI_ASF_HEADER;
178 
179 
180 /* Values for Type field above */
181 
182 enum AcpiAsfType
183 {
184     ACPI_ASF_TYPE_INFO          = 0,
185     ACPI_ASF_TYPE_ALERT         = 1,
186     ACPI_ASF_TYPE_CONTROL       = 2,
187     ACPI_ASF_TYPE_BOOT          = 3,
188     ACPI_ASF_TYPE_ADDRESS       = 4,
189     ACPI_ASF_TYPE_RESERVED      = 5
190 };
191 
192 /*
193  * ASF subtables
194  */
195 
196 /* 0: ASF Information */
197 
198 typedef struct acpi_asf_info
199 {
200     ACPI_ASF_HEADER         Header;
201     UINT8                   MinResetValue;
202     UINT8                   MinPollInterval;
203     UINT16                  SystemId;
204     UINT32                  MfgId;
205     UINT8                   Flags;
206     UINT8                   Reserved2[3];
207 
208 } ACPI_ASF_INFO;
209 
210 /* Masks for Flags field above */
211 
212 #define ACPI_ASF_SMBUS_PROTOCOLS    (1)
213 
214 
215 /* 1: ASF Alerts */
216 
217 typedef struct acpi_asf_alert
218 {
219     ACPI_ASF_HEADER         Header;
220     UINT8                   AssertMask;
221     UINT8                   DeassertMask;
222     UINT8                   Alerts;
223     UINT8                   DataLength;
224 
225 } ACPI_ASF_ALERT;
226 
227 typedef struct acpi_asf_alert_data
228 {
229     UINT8                   Address;
230     UINT8                   Command;
231     UINT8                   Mask;
232     UINT8                   Value;
233     UINT8                   SensorType;
234     UINT8                   Type;
235     UINT8                   Offset;
236     UINT8                   SourceType;
237     UINT8                   Severity;
238     UINT8                   SensorNumber;
239     UINT8                   Entity;
240     UINT8                   Instance;
241 
242 } ACPI_ASF_ALERT_DATA;
243 
244 
245 /* 2: ASF Remote Control */
246 
247 typedef struct acpi_asf_remote
248 {
249     ACPI_ASF_HEADER         Header;
250     UINT8                   Controls;
251     UINT8                   DataLength;
252     UINT16                  Reserved2;
253 
254 } ACPI_ASF_REMOTE;
255 
256 typedef struct acpi_asf_control_data
257 {
258     UINT8                   Function;
259     UINT8                   Address;
260     UINT8                   Command;
261     UINT8                   Value;
262 
263 } ACPI_ASF_CONTROL_DATA;
264 
265 
266 /* 3: ASF RMCP Boot Options */
267 
268 typedef struct acpi_asf_rmcp
269 {
270     ACPI_ASF_HEADER         Header;
271     UINT8                   Capabilities[7];
272     UINT8                   CompletionCode;
273     UINT32                  EnterpriseId;
274     UINT8                   Command;
275     UINT16                  Parameter;
276     UINT16                  BootOptions;
277     UINT16                  OemParameters;
278 
279 } ACPI_ASF_RMCP;
280 
281 
282 /* 4: ASF Address */
283 
284 typedef struct acpi_asf_address
285 {
286     ACPI_ASF_HEADER         Header;
287     UINT8                   EpromAddress;
288     UINT8                   Devices;
289 
290 } ACPI_ASF_ADDRESS;
291 
292 
293 /*******************************************************************************
294  *
295  * BERT - Boot Error Record Table (ACPI 4.0)
296  *        Version 1
297  *
298  ******************************************************************************/
299 
300 typedef struct acpi_table_bert
301 {
302     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
303     UINT32                  RegionLength;       /* Length of the boot error region */
304     UINT64                  Address;            /* Physical address of the error region */
305 
306 } ACPI_TABLE_BERT;
307 
308 
309 /* Boot Error Region (not a subtable, pointed to by Address field above) */
310 
311 typedef struct acpi_bert_region
312 {
313     UINT32                  BlockStatus;        /* Type of error information */
314     UINT32                  RawDataOffset;      /* Offset to raw error data */
315     UINT32                  RawDataLength;      /* Length of raw error data */
316     UINT32                  DataLength;         /* Length of generic error data */
317     UINT32                  ErrorSeverity;      /* Severity code */
318 
319 } ACPI_BERT_REGION;
320 
321 /* Values for BlockStatus flags above */
322 
323 #define ACPI_BERT_UNCORRECTABLE             (1)
324 #define ACPI_BERT_CORRECTABLE               (1<<1)
325 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
326 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
327 #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
328 
329 /* Values for ErrorSeverity above */
330 
331 enum AcpiBertErrorSeverity
332 {
333     ACPI_BERT_ERROR_CORRECTABLE     = 0,
334     ACPI_BERT_ERROR_FATAL           = 1,
335     ACPI_BERT_ERROR_CORRECTED       = 2,
336     ACPI_BERT_ERROR_NONE            = 3,
337     ACPI_BERT_ERROR_RESERVED        = 4     /* 4 and greater are reserved */
338 };
339 
340 /*
341  * Note: The generic error data that follows the ErrorSeverity field above
342  * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
343  */
344 
345 
346 /*******************************************************************************
347  *
348  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
349  *        Version 1
350  *
351  ******************************************************************************/
352 
353 typedef struct acpi_table_bgrt
354 {
355     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
356     UINT16                  Version;
357     UINT8                   Status;
358     UINT8                   ImageType;
359     UINT64                  ImageAddress;
360     UINT32                  ImageOffsetX;
361     UINT32                  ImageOffsetY;
362 
363 } ACPI_TABLE_BGRT;
364 
365 /* Flags for Status field above */
366 
367 #define ACPI_BGRT_DISPLAYED                 (1)
368 #define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
369 
370 
371 /*******************************************************************************
372  *
373  * BOOT - Simple Boot Flag Table
374  *        Version 1
375  *
376  * Conforms to the "Simple Boot Flag Specification", Version 2.1
377  *
378  ******************************************************************************/
379 
380 typedef struct acpi_table_boot
381 {
382     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
383     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
384     UINT8                   Reserved[3];
385 
386 } ACPI_TABLE_BOOT;
387 
388 
389 /*******************************************************************************
390  *
391  * CEDT - CXL Early Discovery Table
392  *        Version 1
393  *
394  * Conforms to the "CXL Early Discovery Table" (CXL 2.0)
395  *
396  ******************************************************************************/
397 
398 typedef struct acpi_table_cedt
399 {
400     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
401 
402 } ACPI_TABLE_CEDT;
403 
404 /* CEDT subtable header (Performance Record Structure) */
405 
406 typedef struct acpi_cedt_header
407 {
408     UINT8                   Type;
409     UINT8                   Reserved;
410     UINT16                  Length;
411 
412 } ACPI_CEDT_HEADER;
413 
414 /* Values for Type field above */
415 
416 enum AcpiCedtType
417 {
418     ACPI_CEDT_TYPE_CHBS                 = 0,
419     ACPI_CEDT_TYPE_CFMWS                = 1,
420     ACPI_CEDT_TYPE_RESERVED             = 2,
421 };
422 
423 /* Values for version field above */
424 
425 #define ACPI_CEDT_CHBS_VERSION_CXL11    (0)
426 #define ACPI_CEDT_CHBS_VERSION_CXL20    (1)
427 
428 /* Values for length field above */
429 
430 #define ACPI_CEDT_CHBS_LENGTH_CXL11     (0x2000)
431 #define ACPI_CEDT_CHBS_LENGTH_CXL20     (0x10000)
432 
433 /*
434  * CEDT subtables
435  */
436 
437 /* 0: CXL Host Bridge Structure */
438 
439 typedef struct acpi_cedt_chbs
440 {
441     ACPI_CEDT_HEADER        Header;
442     UINT32                  Uid;
443     UINT32                  CxlVersion;
444     UINT32                  Reserved;
445     UINT64                  Base;
446     UINT64                  Length;
447 
448 } ACPI_CEDT_CHBS;
449 
450 
451 /* 1: CXL Fixed Memory Window Structure */
452 
453 typedef struct acpi_cedt_cfmws
454 {
455     ACPI_CEDT_HEADER        Header;
456     UINT32                  Reserved1;
457     UINT64                  BaseHpa;
458     UINT64                  WindowSize;
459     UINT8                   InterleaveWays;
460     UINT8                   InterleaveArithmetic;
461     UINT16                  Reserved2;
462     UINT32                  Granularity;
463     UINT16                  Restrictions;
464     UINT16                  QtgId;
465     UINT32                  InterleaveTargets[];
466 
467 } ACPI_CEDT_CFMWS;
468 
469 /* Values for Interleave Arithmetic field above */
470 
471 #define ACPI_CEDT_CFMWS_ARITHMETIC_MODULO	(0)
472 
473 /* Values for Restrictions field above */
474 
475 #define ACPI_CEDT_CFMWS_RESTRICT_TYPE2		(1)
476 #define ACPI_CEDT_CFMWS_RESTRICT_TYPE3		(1<<1)
477 #define ACPI_CEDT_CFMWS_RESTRICT_VOLATILE	(1<<2)
478 #define ACPI_CEDT_CFMWS_RESTRICT_PMEM		(1<<3)
479 #define ACPI_CEDT_CFMWS_RESTRICT_FIXED		(1<<4)
480 
481 
482 /*******************************************************************************
483  *
484  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
485  *        Version 1
486  *
487  ******************************************************************************/
488 
489 typedef struct acpi_table_cpep
490 {
491     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
492     UINT64                  Reserved;
493 
494 } ACPI_TABLE_CPEP;
495 
496 
497 /* Subtable */
498 
499 typedef struct acpi_cpep_polling
500 {
501     ACPI_SUBTABLE_HEADER    Header;
502     UINT8                   Id;                 /* Processor ID */
503     UINT8                   Eid;                /* Processor EID */
504     UINT32                  Interval;           /* Polling interval (msec) */
505 
506 } ACPI_CPEP_POLLING;
507 
508 
509 /*******************************************************************************
510  *
511  * CSRT - Core System Resource Table
512  *        Version 0
513  *
514  * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
515  *
516  ******************************************************************************/
517 
518 typedef struct acpi_table_csrt
519 {
520     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
521 
522 } ACPI_TABLE_CSRT;
523 
524 
525 /* Resource Group subtable */
526 
527 typedef struct acpi_csrt_group
528 {
529     UINT32                  Length;
530     UINT32                  VendorId;
531     UINT32                  SubvendorId;
532     UINT16                  DeviceId;
533     UINT16                  SubdeviceId;
534     UINT16                  Revision;
535     UINT16                  Reserved;
536     UINT32                  SharedInfoLength;
537 
538     /* Shared data immediately follows (Length = SharedInfoLength) */
539 
540 } ACPI_CSRT_GROUP;
541 
542 /* Shared Info subtable */
543 
544 typedef struct acpi_csrt_shared_info
545 {
546     UINT16                  MajorVersion;
547     UINT16                  MinorVersion;
548     UINT32                  MmioBaseLow;
549     UINT32                  MmioBaseHigh;
550     UINT32                  GsiInterrupt;
551     UINT8                   InterruptPolarity;
552     UINT8                   InterruptMode;
553     UINT8                   NumChannels;
554     UINT8                   DmaAddressWidth;
555     UINT16                  BaseRequestLine;
556     UINT16                  NumHandshakeSignals;
557     UINT32                  MaxBlockSize;
558 
559     /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
560 
561 } ACPI_CSRT_SHARED_INFO;
562 
563 /* Resource Descriptor subtable */
564 
565 typedef struct acpi_csrt_descriptor
566 {
567     UINT32                  Length;
568     UINT16                  Type;
569     UINT16                  Subtype;
570     UINT32                  Uid;
571 
572     /* Resource-specific information immediately follows */
573 
574 } ACPI_CSRT_DESCRIPTOR;
575 
576 
577 /* Resource Types */
578 
579 #define ACPI_CSRT_TYPE_INTERRUPT    0x0001
580 #define ACPI_CSRT_TYPE_TIMER        0x0002
581 #define ACPI_CSRT_TYPE_DMA          0x0003
582 
583 /* Resource Subtypes */
584 
585 #define ACPI_CSRT_XRUPT_LINE        0x0000
586 #define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
587 #define ACPI_CSRT_TIMER             0x0000
588 #define ACPI_CSRT_DMA_CHANNEL       0x0000
589 #define ACPI_CSRT_DMA_CONTROLLER    0x0001
590 
591 
592 /*******************************************************************************
593  *
594  * DBG2 - Debug Port Table 2
595  *        Version 0 (Both main table and subtables)
596  *
597  * Conforms to "Microsoft Debug Port Table 2 (DBG2)", September 21, 2020
598  *
599  ******************************************************************************/
600 
601 typedef struct acpi_table_dbg2
602 {
603     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
604     UINT32                  InfoOffset;
605     UINT32                  InfoCount;
606 
607 } ACPI_TABLE_DBG2;
608 
609 
610 typedef struct acpi_dbg2_header
611 {
612     UINT32                  InfoOffset;
613     UINT32                  InfoCount;
614 
615 } ACPI_DBG2_HEADER;
616 
617 
618 /* Debug Device Information Subtable */
619 
620 typedef struct acpi_dbg2_device
621 {
622     UINT8                   Revision;
623     UINT16                  Length;
624     UINT8                   RegisterCount;      /* Number of BaseAddress registers */
625     UINT16                  NamepathLength;
626     UINT16                  NamepathOffset;
627     UINT16                  OemDataLength;
628     UINT16                  OemDataOffset;
629     UINT16                  PortType;
630     UINT16                  PortSubtype;
631     UINT16                  Reserved;
632     UINT16                  BaseAddressOffset;
633     UINT16                  AddressSizeOffset;
634     /*
635      * Data that follows:
636      *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
637      *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
638      *    Namepath    (required) - Null terminated string. Single dot if not supported.
639      *    OemData     (optional) - Length is OemDataLength.
640      */
641 } ACPI_DBG2_DEVICE;
642 
643 /* Types for PortType field above */
644 
645 #define ACPI_DBG2_SERIAL_PORT       0x8000
646 #define ACPI_DBG2_1394_PORT         0x8001
647 #define ACPI_DBG2_USB_PORT          0x8002
648 #define ACPI_DBG2_NET_PORT          0x8003
649 
650 /* Subtypes for PortSubtype field above */
651 
652 #define ACPI_DBG2_16550_COMPATIBLE  0x0000
653 #define ACPI_DBG2_16550_SUBSET      0x0001
654 #define ACPI_DBG2_MAX311XE_SPI      0x0002
655 #define ACPI_DBG2_ARM_PL011         0x0003
656 #define ACPI_DBG2_MSM8X60           0x0004
657 #define ACPI_DBG2_16550_NVIDIA      0x0005
658 #define ACPI_DBG2_TI_OMAP           0x0006
659 #define ACPI_DBG2_APM88XXXX         0x0008
660 #define ACPI_DBG2_MSM8974           0x0009
661 #define ACPI_DBG2_SAM5250           0x000A
662 #define ACPI_DBG2_INTEL_USIF        0x000B
663 #define ACPI_DBG2_IMX6              0x000C
664 #define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
665 #define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
666 #define ACPI_DBG2_ARM_DCC           0x000F
667 #define ACPI_DBG2_BCM2835           0x0010
668 #define ACPI_DBG2_SDM845_1_8432MHZ  0x0011
669 #define ACPI_DBG2_16550_WITH_GAS    0x0012
670 #define ACPI_DBG2_SDM845_7_372MHZ   0x0013
671 #define ACPI_DBG2_INTEL_LPSS        0x0014
672 
673 #define ACPI_DBG2_1394_STANDARD     0x0000
674 
675 #define ACPI_DBG2_USB_XHCI          0x0000
676 #define ACPI_DBG2_USB_EHCI          0x0001
677 
678 
679 /*******************************************************************************
680  *
681  * DBGP - Debug Port table
682  *        Version 1
683  *
684  * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
685  *
686  ******************************************************************************/
687 
688 typedef struct acpi_table_dbgp
689 {
690     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
691     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
692     UINT8                   Reserved[3];
693     ACPI_GENERIC_ADDRESS    DebugPort;
694 
695 } ACPI_TABLE_DBGP;
696 
697 
698 /*******************************************************************************
699  *
700  * DMAR - DMA Remapping table
701  *        Version 1
702  *
703  * Conforms to "Intel Virtualization Technology for Directed I/O",
704  * Version 2.3, October 2014
705  *
706  ******************************************************************************/
707 
708 typedef struct acpi_table_dmar
709 {
710     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
711     UINT8                   Width;              /* Host Address Width */
712     UINT8                   Flags;
713     UINT8                   Reserved[10];
714 
715 } ACPI_TABLE_DMAR;
716 
717 /* Masks for Flags field above */
718 
719 #define ACPI_DMAR_INTR_REMAP        (1)
720 #define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
721 #define ACPI_DMAR_X2APIC_MODE       (1<<2)
722 
723 
724 /* DMAR subtable header */
725 
726 typedef struct acpi_dmar_header
727 {
728     UINT16                  Type;
729     UINT16                  Length;
730 
731 } ACPI_DMAR_HEADER;
732 
733 /* Values for subtable type in ACPI_DMAR_HEADER */
734 
735 enum AcpiDmarType
736 {
737     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
738     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
739     ACPI_DMAR_TYPE_ROOT_ATS             = 2,
740     ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
741     ACPI_DMAR_TYPE_NAMESPACE            = 4,
742     ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
743 };
744 
745 
746 /* DMAR Device Scope structure */
747 
748 typedef struct acpi_dmar_device_scope
749 {
750     UINT8                   EntryType;
751     UINT8                   Length;
752     UINT16                  Reserved;
753     UINT8                   EnumerationId;
754     UINT8                   Bus;
755 
756 } ACPI_DMAR_DEVICE_SCOPE;
757 
758 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
759 
760 enum AcpiDmarScopeType
761 {
762     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
763     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
764     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
765     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
766     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
767     ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
768     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
769 };
770 
771 typedef struct acpi_dmar_pci_path
772 {
773     UINT8                   Device;
774     UINT8                   Function;
775 
776 } ACPI_DMAR_PCI_PATH;
777 
778 
779 /*
780  * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
781  */
782 
783 /* 0: Hardware Unit Definition */
784 
785 typedef struct acpi_dmar_hardware_unit
786 {
787     ACPI_DMAR_HEADER        Header;
788     UINT8                   Flags;
789     UINT8                   Reserved;
790     UINT16                  Segment;
791     UINT64                  Address;            /* Register Base Address */
792 
793 } ACPI_DMAR_HARDWARE_UNIT;
794 
795 /* Masks for Flags field above */
796 
797 #define ACPI_DMAR_INCLUDE_ALL       (1)
798 
799 
800 /* 1: Reserved Memory Definition */
801 
802 typedef struct acpi_dmar_reserved_memory
803 {
804     ACPI_DMAR_HEADER        Header;
805     UINT16                  Reserved;
806     UINT16                  Segment;
807     UINT64                  BaseAddress;        /* 4K aligned base address */
808     UINT64                  EndAddress;         /* 4K aligned limit address */
809 
810 } ACPI_DMAR_RESERVED_MEMORY;
811 
812 /* Masks for Flags field above */
813 
814 #define ACPI_DMAR_ALLOW_ALL         (1)
815 
816 
817 /* 2: Root Port ATS Capability Reporting Structure */
818 
819 typedef struct acpi_dmar_atsr
820 {
821     ACPI_DMAR_HEADER        Header;
822     UINT8                   Flags;
823     UINT8                   Reserved;
824     UINT16                  Segment;
825 
826 } ACPI_DMAR_ATSR;
827 
828 /* Masks for Flags field above */
829 
830 #define ACPI_DMAR_ALL_PORTS         (1)
831 
832 
833 /* 3: Remapping Hardware Static Affinity Structure */
834 
835 typedef struct acpi_dmar_rhsa
836 {
837     ACPI_DMAR_HEADER        Header;
838     UINT32                  Reserved;
839     UINT64                  BaseAddress;
840     UINT32                  ProximityDomain;
841 
842 } ACPI_DMAR_RHSA;
843 
844 
845 /* 4: ACPI Namespace Device Declaration Structure */
846 
847 typedef struct acpi_dmar_andd
848 {
849     ACPI_DMAR_HEADER        Header;
850     UINT8                   Reserved[3];
851     UINT8                   DeviceNumber;
852     char                    DeviceName[1];
853 
854 } ACPI_DMAR_ANDD;
855 
856 
857 /*******************************************************************************
858  *
859  * DRTM - Dynamic Root of Trust for Measurement table
860  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
861  * Table version 1
862  *
863  ******************************************************************************/
864 
865 typedef struct acpi_table_drtm
866 {
867     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
868     UINT64                  EntryBaseAddress;
869     UINT64                  EntryLength;
870     UINT32                  EntryAddress32;
871     UINT64                  EntryAddress64;
872     UINT64                  ExitAddress;
873     UINT64                  LogAreaAddress;
874     UINT32                  LogAreaLength;
875     UINT64                  ArchDependentAddress;
876     UINT32                  Flags;
877 
878 } ACPI_TABLE_DRTM;
879 
880 /* Flag Definitions for above */
881 
882 #define ACPI_DRTM_ACCESS_ALLOWED            (1)
883 #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
884 #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
885 #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
886 
887 
888 /* 1) Validated Tables List (64-bit addresses) */
889 
890 typedef struct acpi_drtm_vtable_list
891 {
892     UINT32                  ValidatedTableCount;
893     UINT64                  ValidatedTables[1];
894 
895 } ACPI_DRTM_VTABLE_LIST;
896 
897 /* 2) Resources List (of Resource Descriptors) */
898 
899 /* Resource Descriptor */
900 
901 typedef struct acpi_drtm_resource
902 {
903     UINT8                   Size[7];
904     UINT8                   Type;
905     UINT64                  Address;
906 
907 } ACPI_DRTM_RESOURCE;
908 
909 typedef struct acpi_drtm_resource_list
910 {
911     UINT32                  ResourceCount;
912     ACPI_DRTM_RESOURCE      Resources[1];
913 
914 } ACPI_DRTM_RESOURCE_LIST;
915 
916 /* 3) Platform-specific Identifiers List */
917 
918 typedef struct acpi_drtm_dps_id
919 {
920     UINT32                  DpsIdLength;
921     UINT8                   DpsId[16];
922 
923 } ACPI_DRTM_DPS_ID;
924 
925 
926 /*******************************************************************************
927  *
928  * ECDT - Embedded Controller Boot Resources Table
929  *        Version 1
930  *
931  ******************************************************************************/
932 
933 typedef struct acpi_table_ecdt
934 {
935     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
936     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
937     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
938     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
939     UINT8                   Gpe;                /* The GPE for the EC */
940     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
941 
942 } ACPI_TABLE_ECDT;
943 
944 
945 /*******************************************************************************
946  *
947  * EINJ - Error Injection Table (ACPI 4.0)
948  *        Version 1
949  *
950  ******************************************************************************/
951 
952 typedef struct acpi_table_einj
953 {
954     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
955     UINT32                  HeaderLength;
956     UINT8                   Flags;
957     UINT8                   Reserved[3];
958     UINT32                  Entries;
959 
960 } ACPI_TABLE_EINJ;
961 
962 
963 /* EINJ Injection Instruction Entries (actions) */
964 
965 typedef struct acpi_einj_entry
966 {
967     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
968 
969 } ACPI_EINJ_ENTRY;
970 
971 /* Masks for Flags field above */
972 
973 #define ACPI_EINJ_PRESERVE          (1)
974 
975 /* Values for Action field above */
976 
977 enum AcpiEinjActions
978 {
979     ACPI_EINJ_BEGIN_OPERATION               = 0,
980     ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
981     ACPI_EINJ_SET_ERROR_TYPE                = 2,
982     ACPI_EINJ_GET_ERROR_TYPE                = 3,
983     ACPI_EINJ_END_OPERATION                 = 4,
984     ACPI_EINJ_EXECUTE_OPERATION             = 5,
985     ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
986     ACPI_EINJ_GET_COMMAND_STATUS            = 7,
987     ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
988     ACPI_EINJ_GET_EXECUTE_TIMINGS           = 9,
989     ACPI_EINJ_ACTION_RESERVED               = 10,    /* 10 and greater are reserved */
990     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
991 };
992 
993 /* Values for Instruction field above */
994 
995 enum AcpiEinjInstructions
996 {
997     ACPI_EINJ_READ_REGISTER         = 0,
998     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
999     ACPI_EINJ_WRITE_REGISTER        = 2,
1000     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
1001     ACPI_EINJ_NOOP                  = 4,
1002     ACPI_EINJ_FLUSH_CACHELINE       = 5,
1003     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
1004 };
1005 
1006 typedef struct acpi_einj_error_type_with_addr
1007 {
1008     UINT32                  ErrorType;
1009     UINT32                  VendorStructOffset;
1010     UINT32                  Flags;
1011     UINT32                  ApicId;
1012     UINT64                  Address;
1013     UINT64                  Range;
1014     UINT32                  PcieId;
1015 
1016 } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
1017 
1018 typedef struct acpi_einj_vendor
1019 {
1020     UINT32                  Length;
1021     UINT32                  PcieId;
1022     UINT16                  VendorId;
1023     UINT16                  DeviceId;
1024     UINT8                   RevisionId;
1025     UINT8                   Reserved[3];
1026 
1027 } ACPI_EINJ_VENDOR;
1028 
1029 
1030 /* EINJ Trigger Error Action Table */
1031 
1032 typedef struct acpi_einj_trigger
1033 {
1034     UINT32                  HeaderSize;
1035     UINT32                  Revision;
1036     UINT32                  TableSize;
1037     UINT32                  EntryCount;
1038 
1039 } ACPI_EINJ_TRIGGER;
1040 
1041 /* Command status return values */
1042 
1043 enum AcpiEinjCommandStatus
1044 {
1045     ACPI_EINJ_SUCCESS               = 0,
1046     ACPI_EINJ_FAILURE               = 1,
1047     ACPI_EINJ_INVALID_ACCESS        = 2,
1048     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
1049 };
1050 
1051 
1052 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
1053 
1054 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
1055 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
1056 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
1057 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
1058 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
1059 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
1060 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
1061 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
1062 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
1063 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
1064 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
1065 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
1066 #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
1067 
1068 
1069 /*******************************************************************************
1070  *
1071  * ERST - Error Record Serialization Table (ACPI 4.0)
1072  *        Version 1
1073  *
1074  ******************************************************************************/
1075 
1076 typedef struct acpi_table_erst
1077 {
1078     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1079     UINT32                  HeaderLength;
1080     UINT32                  Reserved;
1081     UINT32                  Entries;
1082 
1083 } ACPI_TABLE_ERST;
1084 
1085 
1086 /* ERST Serialization Entries (actions) */
1087 
1088 typedef struct acpi_erst_entry
1089 {
1090     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
1091 
1092 } ACPI_ERST_ENTRY;
1093 
1094 /* Masks for Flags field above */
1095 
1096 #define ACPI_ERST_PRESERVE          (1)
1097 
1098 /* Values for Action field above */
1099 
1100 enum AcpiErstActions
1101 {
1102     ACPI_ERST_BEGIN_WRITE           = 0,
1103     ACPI_ERST_BEGIN_READ            = 1,
1104     ACPI_ERST_BEGIN_CLEAR           = 2,
1105     ACPI_ERST_END                   = 3,
1106     ACPI_ERST_SET_RECORD_OFFSET     = 4,
1107     ACPI_ERST_EXECUTE_OPERATION     = 5,
1108     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
1109     ACPI_ERST_GET_COMMAND_STATUS    = 7,
1110     ACPI_ERST_GET_RECORD_ID         = 8,
1111     ACPI_ERST_SET_RECORD_ID         = 9,
1112     ACPI_ERST_GET_RECORD_COUNT      = 10,
1113     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
1114     ACPI_ERST_NOT_USED              = 12,
1115     ACPI_ERST_GET_ERROR_RANGE       = 13,
1116     ACPI_ERST_GET_ERROR_LENGTH      = 14,
1117     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
1118     ACPI_ERST_EXECUTE_TIMINGS       = 16,
1119     ACPI_ERST_ACTION_RESERVED       = 17    /* 17 and greater are reserved */
1120 };
1121 
1122 /* Values for Instruction field above */
1123 
1124 enum AcpiErstInstructions
1125 {
1126     ACPI_ERST_READ_REGISTER         = 0,
1127     ACPI_ERST_READ_REGISTER_VALUE   = 1,
1128     ACPI_ERST_WRITE_REGISTER        = 2,
1129     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
1130     ACPI_ERST_NOOP                  = 4,
1131     ACPI_ERST_LOAD_VAR1             = 5,
1132     ACPI_ERST_LOAD_VAR2             = 6,
1133     ACPI_ERST_STORE_VAR1            = 7,
1134     ACPI_ERST_ADD                   = 8,
1135     ACPI_ERST_SUBTRACT              = 9,
1136     ACPI_ERST_ADD_VALUE             = 10,
1137     ACPI_ERST_SUBTRACT_VALUE        = 11,
1138     ACPI_ERST_STALL                 = 12,
1139     ACPI_ERST_STALL_WHILE_TRUE      = 13,
1140     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
1141     ACPI_ERST_GOTO                  = 15,
1142     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
1143     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
1144     ACPI_ERST_MOVE_DATA             = 18,
1145     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
1146 };
1147 
1148 /* Command status return values */
1149 
1150 enum AcpiErstCommandStatus
1151 {
1152     ACPI_ERST_SUCCESS                = 0,
1153     ACPI_ERST_NO_SPACE              = 1,
1154     ACPI_ERST_NOT_AVAILABLE         = 2,
1155     ACPI_ERST_FAILURE               = 3,
1156     ACPI_ERST_RECORD_EMPTY          = 4,
1157     ACPI_ERST_NOT_FOUND             = 5,
1158     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
1159 };
1160 
1161 
1162 /* Error Record Serialization Information */
1163 
1164 typedef struct acpi_erst_info
1165 {
1166     UINT16                  Signature;          /* Should be "ER" */
1167     UINT8                   Data[48];
1168 
1169 } ACPI_ERST_INFO;
1170 
1171 
1172 /*******************************************************************************
1173  *
1174  * FPDT - Firmware Performance Data Table (ACPI 5.0)
1175  *        Version 1
1176  *
1177  ******************************************************************************/
1178 
1179 typedef struct acpi_table_fpdt
1180 {
1181     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1182 
1183 } ACPI_TABLE_FPDT;
1184 
1185 
1186 /* FPDT subtable header (Performance Record Structure) */
1187 
1188 typedef struct acpi_fpdt_header
1189 {
1190     UINT16                  Type;
1191     UINT8                   Length;
1192     UINT8                   Revision;
1193 
1194 } ACPI_FPDT_HEADER;
1195 
1196 /* Values for Type field above */
1197 
1198 enum AcpiFpdtType
1199 {
1200     ACPI_FPDT_TYPE_BOOT                 = 0,
1201     ACPI_FPDT_TYPE_S3PERF               = 1
1202 };
1203 
1204 
1205 /*
1206  * FPDT subtables
1207  */
1208 
1209 /* 0: Firmware Basic Boot Performance Record */
1210 
1211 typedef struct acpi_fpdt_boot_pointer
1212 {
1213     ACPI_FPDT_HEADER        Header;
1214     UINT8                   Reserved[4];
1215     UINT64                  Address;
1216 
1217 } ACPI_FPDT_BOOT_POINTER;
1218 
1219 
1220 /* 1: S3 Performance Table Pointer Record */
1221 
1222 typedef struct acpi_fpdt_s3pt_pointer
1223 {
1224     ACPI_FPDT_HEADER        Header;
1225     UINT8                   Reserved[4];
1226     UINT64                  Address;
1227 
1228 } ACPI_FPDT_S3PT_POINTER;
1229 
1230 
1231 /*
1232  * S3PT - S3 Performance Table. This table is pointed to by the
1233  * S3 Pointer Record above.
1234  */
1235 typedef struct acpi_table_s3pt
1236 {
1237     UINT8                   Signature[4]; /* "S3PT" */
1238     UINT32                  Length;
1239 
1240 } ACPI_TABLE_S3PT;
1241 
1242 
1243 /*
1244  * S3PT Subtables (Not part of the actual FPDT)
1245  */
1246 
1247 /* Values for Type field in S3PT header */
1248 
1249 enum AcpiS3ptType
1250 {
1251     ACPI_S3PT_TYPE_RESUME               = 0,
1252     ACPI_S3PT_TYPE_SUSPEND              = 1,
1253     ACPI_FPDT_BOOT_PERFORMANCE          = 2
1254 };
1255 
1256 typedef struct acpi_s3pt_resume
1257 {
1258     ACPI_FPDT_HEADER        Header;
1259     UINT32                  ResumeCount;
1260     UINT64                  FullResume;
1261     UINT64                  AverageResume;
1262 
1263 } ACPI_S3PT_RESUME;
1264 
1265 typedef struct acpi_s3pt_suspend
1266 {
1267     ACPI_FPDT_HEADER        Header;
1268     UINT64                  SuspendStart;
1269     UINT64                  SuspendEnd;
1270 
1271 } ACPI_S3PT_SUSPEND;
1272 
1273 
1274 /*
1275  * FPDT Boot Performance Record (Not part of the actual FPDT)
1276  */
1277 typedef struct acpi_fpdt_boot
1278 {
1279     ACPI_FPDT_HEADER        Header;
1280     UINT8                   Reserved[4];
1281     UINT64                  ResetEnd;
1282     UINT64                  LoadStart;
1283     UINT64                  StartupStart;
1284     UINT64                  ExitServicesEntry;
1285     UINT64                  ExitServicesExit;
1286 
1287 } ACPI_FPDT_BOOT;
1288 
1289 
1290 /*******************************************************************************
1291  *
1292  * GTDT - Generic Timer Description Table (ACPI 5.1)
1293  *        Version 2
1294  *
1295  ******************************************************************************/
1296 
1297 typedef struct acpi_table_gtdt
1298 {
1299     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1300     UINT64                  CounterBlockAddresss;
1301     UINT32                  Reserved;
1302     UINT32                  SecureEl1Interrupt;
1303     UINT32                  SecureEl1Flags;
1304     UINT32                  NonSecureEl1Interrupt;
1305     UINT32                  NonSecureEl1Flags;
1306     UINT32                  VirtualTimerInterrupt;
1307     UINT32                  VirtualTimerFlags;
1308     UINT32                  NonSecureEl2Interrupt;
1309     UINT32                  NonSecureEl2Flags;
1310     UINT64                  CounterReadBlockAddress;
1311     UINT32                  PlatformTimerCount;
1312     UINT32                  PlatformTimerOffset;
1313 
1314 } ACPI_TABLE_GTDT;
1315 
1316 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
1317 
1318 #define ACPI_GTDT_INTERRUPT_MODE        (1)
1319 #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
1320 #define ACPI_GTDT_ALWAYS_ON             (1<<2)
1321 
1322 typedef struct acpi_gtdt_el2
1323 {
1324     UINT32                  VirtualEL2TimerGsiv;
1325     UINT32                  VirtualEL2TimerFlags;
1326 } ACPI_GTDT_EL2;
1327 
1328 
1329 /* Common GTDT subtable header */
1330 
1331 typedef struct acpi_gtdt_header
1332 {
1333     UINT8                   Type;
1334     UINT16                  Length;
1335 
1336 } ACPI_GTDT_HEADER;
1337 
1338 /* Values for GTDT subtable type above */
1339 
1340 enum AcpiGtdtType
1341 {
1342     ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
1343     ACPI_GTDT_TYPE_WATCHDOG         = 1,
1344     ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
1345 };
1346 
1347 
1348 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
1349 
1350 /* 0: Generic Timer Block */
1351 
1352 typedef struct acpi_gtdt_timer_block
1353 {
1354     ACPI_GTDT_HEADER        Header;
1355     UINT8                   Reserved;
1356     UINT64                  BlockAddress;
1357     UINT32                  TimerCount;
1358     UINT32                  TimerOffset;
1359 
1360 } ACPI_GTDT_TIMER_BLOCK;
1361 
1362 /* Timer Sub-Structure, one per timer */
1363 
1364 typedef struct acpi_gtdt_timer_entry
1365 {
1366     UINT8                   FrameNumber;
1367     UINT8                   Reserved[3];
1368     UINT64                  BaseAddress;
1369     UINT64                  El0BaseAddress;
1370     UINT32                  TimerInterrupt;
1371     UINT32                  TimerFlags;
1372     UINT32                  VirtualTimerInterrupt;
1373     UINT32                  VirtualTimerFlags;
1374     UINT32                  CommonFlags;
1375 
1376 } ACPI_GTDT_TIMER_ENTRY;
1377 
1378 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
1379 
1380 #define ACPI_GTDT_GT_IRQ_MODE               (1)
1381 #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
1382 
1383 /* Flag Definitions: CommonFlags above */
1384 
1385 #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
1386 #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
1387 
1388 
1389 /* 1: SBSA Generic Watchdog Structure */
1390 
1391 typedef struct acpi_gtdt_watchdog
1392 {
1393     ACPI_GTDT_HEADER        Header;
1394     UINT8                   Reserved;
1395     UINT64                  RefreshFrameAddress;
1396     UINT64                  ControlFrameAddress;
1397     UINT32                  TimerInterrupt;
1398     UINT32                  TimerFlags;
1399 
1400 } ACPI_GTDT_WATCHDOG;
1401 
1402 /* Flag Definitions: TimerFlags above */
1403 
1404 #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
1405 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
1406 #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
1407 
1408 
1409 /*******************************************************************************
1410  *
1411  * HEST - Hardware Error Source Table (ACPI 4.0)
1412  *        Version 1
1413  *
1414  ******************************************************************************/
1415 
1416 typedef struct acpi_table_hest
1417 {
1418     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1419     UINT32                  ErrorSourceCount;
1420 
1421 } ACPI_TABLE_HEST;
1422 
1423 
1424 /* HEST subtable header */
1425 
1426 typedef struct acpi_hest_header
1427 {
1428     UINT16                  Type;
1429     UINT16                  SourceId;
1430 
1431 } ACPI_HEST_HEADER;
1432 
1433 
1434 /* Values for Type field above for subtables */
1435 
1436 enum AcpiHestTypes
1437 {
1438     ACPI_HEST_TYPE_IA32_CHECK           = 0,
1439     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
1440     ACPI_HEST_TYPE_IA32_NMI             = 2,
1441     ACPI_HEST_TYPE_NOT_USED3            = 3,
1442     ACPI_HEST_TYPE_NOT_USED4            = 4,
1443     ACPI_HEST_TYPE_NOT_USED5            = 5,
1444     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
1445     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
1446     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
1447     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
1448     ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
1449     ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
1450     ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
1451 };
1452 
1453 
1454 /*
1455  * HEST substructures contained in subtables
1456  */
1457 
1458 /*
1459  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
1460  * ACPI_HEST_IA_CORRECTED structures.
1461  */
1462 typedef struct acpi_hest_ia_error_bank
1463 {
1464     UINT8                   BankNumber;
1465     UINT8                   ClearStatusOnInit;
1466     UINT8                   StatusFormat;
1467     UINT8                   Reserved;
1468     UINT32                  ControlRegister;
1469     UINT64                  ControlData;
1470     UINT32                  StatusRegister;
1471     UINT32                  AddressRegister;
1472     UINT32                  MiscRegister;
1473 
1474 } ACPI_HEST_IA_ERROR_BANK;
1475 
1476 
1477 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
1478 
1479 typedef struct acpi_hest_aer_common
1480 {
1481     UINT16                  Reserved1;
1482     UINT8                   Flags;
1483     UINT8                   Enabled;
1484     UINT32                  RecordsToPreallocate;
1485     UINT32                  MaxSectionsPerRecord;
1486     UINT32                  Bus;                    /* Bus and Segment numbers */
1487     UINT16                  Device;
1488     UINT16                  Function;
1489     UINT16                  DeviceControl;
1490     UINT16                  Reserved2;
1491     UINT32                  UncorrectableMask;
1492     UINT32                  UncorrectableSeverity;
1493     UINT32                  CorrectableMask;
1494     UINT32                  AdvancedCapabilities;
1495 
1496 } ACPI_HEST_AER_COMMON;
1497 
1498 /* Masks for HEST Flags fields */
1499 
1500 #define ACPI_HEST_FIRMWARE_FIRST        (1)
1501 #define ACPI_HEST_GLOBAL                (1<<1)
1502 #define ACPI_HEST_GHES_ASSIST           (1<<2)
1503 
1504 /*
1505  * Macros to access the bus/segment numbers in Bus field above:
1506  *  Bus number is encoded in bits 7:0
1507  *  Segment number is encoded in bits 23:8
1508  */
1509 #define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
1510 #define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
1511 
1512 
1513 /* Hardware Error Notification */
1514 
1515 typedef struct acpi_hest_notify
1516 {
1517     UINT8                   Type;
1518     UINT8                   Length;
1519     UINT16                  ConfigWriteEnable;
1520     UINT32                  PollInterval;
1521     UINT32                  Vector;
1522     UINT32                  PollingThresholdValue;
1523     UINT32                  PollingThresholdWindow;
1524     UINT32                  ErrorThresholdValue;
1525     UINT32                  ErrorThresholdWindow;
1526 
1527 } ACPI_HEST_NOTIFY;
1528 
1529 /* Values for Notify Type field above */
1530 
1531 enum AcpiHestNotifyTypes
1532 {
1533     ACPI_HEST_NOTIFY_POLLED             = 0,
1534     ACPI_HEST_NOTIFY_EXTERNAL           = 1,
1535     ACPI_HEST_NOTIFY_LOCAL              = 2,
1536     ACPI_HEST_NOTIFY_SCI                = 3,
1537     ACPI_HEST_NOTIFY_NMI                = 4,
1538     ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
1539     ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
1540     ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
1541     ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
1542     ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
1543     ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
1544     ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
1545     ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
1546 };
1547 
1548 /* Values for ConfigWriteEnable bitfield above */
1549 
1550 #define ACPI_HEST_TYPE                  (1)
1551 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
1552 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
1553 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
1554 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
1555 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
1556 
1557 
1558 /*
1559  * HEST subtables
1560  */
1561 
1562 /* 0: IA32 Machine Check Exception */
1563 
1564 typedef struct acpi_hest_ia_machine_check
1565 {
1566     ACPI_HEST_HEADER        Header;
1567     UINT16                  Reserved1;
1568     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
1569     UINT8                   Enabled;
1570     UINT32                  RecordsToPreallocate;
1571     UINT32                  MaxSectionsPerRecord;
1572     UINT64                  GlobalCapabilityData;
1573     UINT64                  GlobalControlData;
1574     UINT8                   NumHardwareBanks;
1575     UINT8                   Reserved3[7];
1576 
1577 } ACPI_HEST_IA_MACHINE_CHECK;
1578 
1579 
1580 /* 1: IA32 Corrected Machine Check */
1581 
1582 typedef struct acpi_hest_ia_corrected
1583 {
1584     ACPI_HEST_HEADER        Header;
1585     UINT16                  Reserved1;
1586     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
1587     UINT8                   Enabled;
1588     UINT32                  RecordsToPreallocate;
1589     UINT32                  MaxSectionsPerRecord;
1590     ACPI_HEST_NOTIFY        Notify;
1591     UINT8                   NumHardwareBanks;
1592     UINT8                   Reserved2[3];
1593 
1594 } ACPI_HEST_IA_CORRECTED;
1595 
1596 
1597 /* 2: IA32 Non-Maskable Interrupt */
1598 
1599 typedef struct acpi_hest_ia_nmi
1600 {
1601     ACPI_HEST_HEADER        Header;
1602     UINT32                  Reserved;
1603     UINT32                  RecordsToPreallocate;
1604     UINT32                  MaxSectionsPerRecord;
1605     UINT32                  MaxRawDataLength;
1606 
1607 } ACPI_HEST_IA_NMI;
1608 
1609 
1610 /* 3,4,5: Not used */
1611 
1612 /* 6: PCI Express Root Port AER */
1613 
1614 typedef struct acpi_hest_aer_root
1615 {
1616     ACPI_HEST_HEADER        Header;
1617     ACPI_HEST_AER_COMMON    Aer;
1618     UINT32                  RootErrorCommand;
1619 
1620 } ACPI_HEST_AER_ROOT;
1621 
1622 
1623 /* 7: PCI Express AER (AER Endpoint) */
1624 
1625 typedef struct acpi_hest_aer
1626 {
1627     ACPI_HEST_HEADER        Header;
1628     ACPI_HEST_AER_COMMON    Aer;
1629 
1630 } ACPI_HEST_AER;
1631 
1632 
1633 /* 8: PCI Express/PCI-X Bridge AER */
1634 
1635 typedef struct acpi_hest_aer_bridge
1636 {
1637     ACPI_HEST_HEADER        Header;
1638     ACPI_HEST_AER_COMMON    Aer;
1639     UINT32                  UncorrectableMask2;
1640     UINT32                  UncorrectableSeverity2;
1641     UINT32                  AdvancedCapabilities2;
1642 
1643 } ACPI_HEST_AER_BRIDGE;
1644 
1645 
1646 /* 9: Generic Hardware Error Source */
1647 
1648 typedef struct acpi_hest_generic
1649 {
1650     ACPI_HEST_HEADER        Header;
1651     UINT16                  RelatedSourceId;
1652     UINT8                   Reserved;
1653     UINT8                   Enabled;
1654     UINT32                  RecordsToPreallocate;
1655     UINT32                  MaxSectionsPerRecord;
1656     UINT32                  MaxRawDataLength;
1657     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
1658     ACPI_HEST_NOTIFY        Notify;
1659     UINT32                  ErrorBlockLength;
1660 
1661 } ACPI_HEST_GENERIC;
1662 
1663 
1664 /* 10: Generic Hardware Error Source, version 2 */
1665 
1666 typedef struct acpi_hest_generic_v2
1667 {
1668     ACPI_HEST_HEADER        Header;
1669     UINT16                  RelatedSourceId;
1670     UINT8                   Reserved;
1671     UINT8                   Enabled;
1672     UINT32                  RecordsToPreallocate;
1673     UINT32                  MaxSectionsPerRecord;
1674     UINT32                  MaxRawDataLength;
1675     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
1676     ACPI_HEST_NOTIFY        Notify;
1677     UINT32                  ErrorBlockLength;
1678     ACPI_GENERIC_ADDRESS    ReadAckRegister;
1679     UINT64                  ReadAckPreserve;
1680     UINT64                  ReadAckWrite;
1681 
1682 } ACPI_HEST_GENERIC_V2;
1683 
1684 
1685 /* Generic Error Status block */
1686 
1687 typedef struct acpi_hest_generic_status
1688 {
1689     UINT32                  BlockStatus;
1690     UINT32                  RawDataOffset;
1691     UINT32                  RawDataLength;
1692     UINT32                  DataLength;
1693     UINT32                  ErrorSeverity;
1694 
1695 } ACPI_HEST_GENERIC_STATUS;
1696 
1697 /* Values for BlockStatus flags above */
1698 
1699 #define ACPI_HEST_UNCORRECTABLE             (1)
1700 #define ACPI_HEST_CORRECTABLE               (1<<1)
1701 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
1702 #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
1703 #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
1704 
1705 
1706 /* Generic Error Data entry */
1707 
1708 typedef struct acpi_hest_generic_data
1709 {
1710     UINT8                   SectionType[16];
1711     UINT32                  ErrorSeverity;
1712     UINT16                  Revision;
1713     UINT8                   ValidationBits;
1714     UINT8                   Flags;
1715     UINT32                  ErrorDataLength;
1716     UINT8                   FruId[16];
1717     UINT8                   FruText[20];
1718 
1719 } ACPI_HEST_GENERIC_DATA;
1720 
1721 /* Extension for revision 0x0300 */
1722 
1723 typedef struct acpi_hest_generic_data_v300
1724 {
1725     UINT8                   SectionType[16];
1726     UINT32                  ErrorSeverity;
1727     UINT16                  Revision;
1728     UINT8                   ValidationBits;
1729     UINT8                   Flags;
1730     UINT32                  ErrorDataLength;
1731     UINT8                   FruId[16];
1732     UINT8                   FruText[20];
1733     UINT64                  TimeStamp;
1734 
1735 } ACPI_HEST_GENERIC_DATA_V300;
1736 
1737 /* Values for ErrorSeverity above */
1738 
1739 #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
1740 #define ACPI_HEST_GEN_ERROR_FATAL           1
1741 #define ACPI_HEST_GEN_ERROR_CORRECTED       2
1742 #define ACPI_HEST_GEN_ERROR_NONE            3
1743 
1744 /* Flags for ValidationBits above */
1745 
1746 #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
1747 #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
1748 #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
1749 
1750 
1751 /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
1752 
1753 typedef struct acpi_hest_ia_deferred_check
1754 {
1755     ACPI_HEST_HEADER        Header;
1756     UINT16                  Reserved1;
1757     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
1758     UINT8                   Enabled;
1759     UINT32                  RecordsToPreallocate;
1760     UINT32                  MaxSectionsPerRecord;
1761     ACPI_HEST_NOTIFY        Notify;
1762     UINT8                   NumHardwareBanks;
1763     UINT8                   Reserved2[3];
1764 
1765 } ACPI_HEST_IA_DEFERRED_CHECK;
1766 
1767 
1768 /*******************************************************************************
1769  *
1770  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.3)
1771  *
1772  ******************************************************************************/
1773 
1774 typedef struct acpi_table_hmat
1775 {
1776     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1777     UINT32                  Reserved;
1778 
1779 } ACPI_TABLE_HMAT;
1780 
1781 
1782 /* Values for HMAT structure types */
1783 
1784 enum AcpiHmatType
1785 {
1786     ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subsystem address range */
1787     ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
1788     ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
1789     ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
1790 };
1791 
1792 typedef struct acpi_hmat_structure
1793 {
1794     UINT16                  Type;
1795     UINT16                  Reserved;
1796     UINT32                  Length;
1797 
1798 } ACPI_HMAT_STRUCTURE;
1799 
1800 
1801 /*
1802  * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
1803  */
1804 
1805 /* 0: Memory proximity domain attributes */
1806 
1807 typedef struct acpi_hmat_proximity_domain
1808 {
1809     ACPI_HMAT_STRUCTURE     Header;
1810     UINT16                  Flags;
1811     UINT16                  Reserved1;
1812     UINT32                  InitiatorPD;            /* Attached Initiator proximity domain */
1813     UINT32                  MemoryPD;               /* Memory proximity domain */
1814     UINT32                  Reserved2;
1815     UINT64                  Reserved3;
1816     UINT64                  Reserved4;
1817 
1818 } ACPI_HMAT_PROXIMITY_DOMAIN;
1819 
1820 /* Masks for Flags field above */
1821 
1822 #define ACPI_HMAT_INITIATOR_PD_VALID    (1)     /* 1: InitiatorPD field is valid */
1823 
1824 
1825 /* 1: System locality latency and bandwidth information */
1826 
1827 typedef struct acpi_hmat_locality
1828 {
1829     ACPI_HMAT_STRUCTURE     Header;
1830     UINT8                   Flags;
1831     UINT8                   DataType;
1832     UINT8                   MinTransferSize;
1833     UINT8                   Reserved1;
1834     UINT32                  NumberOfInitiatorPDs;
1835     UINT32                  NumberOfTargetPDs;
1836     UINT32                  Reserved2;
1837     UINT64                  EntryBaseUnit;
1838 
1839 } ACPI_HMAT_LOCALITY;
1840 
1841 /* Masks for Flags field above */
1842 
1843 #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)      /* Bits 0-3 */
1844 
1845 /* Values for Memory Hierarchy flags */
1846 
1847 #define ACPI_HMAT_MEMORY            0
1848 #define ACPI_HMAT_1ST_LEVEL_CACHE   1
1849 #define ACPI_HMAT_2ND_LEVEL_CACHE   2
1850 #define ACPI_HMAT_3RD_LEVEL_CACHE   3
1851 #define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10        /* Bit 4: ACPI 6.4 */
1852 #define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20     /* Bit 5: ACPI 6.4 */
1853 
1854 
1855 /* Values for DataType field above */
1856 
1857 #define ACPI_HMAT_ACCESS_LATENCY    0
1858 #define ACPI_HMAT_READ_LATENCY      1
1859 #define ACPI_HMAT_WRITE_LATENCY     2
1860 #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1861 #define ACPI_HMAT_READ_BANDWIDTH    4
1862 #define ACPI_HMAT_WRITE_BANDWIDTH   5
1863 
1864 
1865 /* 2: Memory side cache information */
1866 
1867 typedef struct acpi_hmat_cache
1868 {
1869     ACPI_HMAT_STRUCTURE     Header;
1870     UINT32                  MemoryPD;
1871     UINT32                  Reserved1;
1872     UINT64                  CacheSize;
1873     UINT32                  CacheAttributes;
1874     UINT16                  Reserved2;
1875     UINT16                  NumberOfSMBIOSHandles;
1876 
1877 } ACPI_HMAT_CACHE;
1878 
1879 /* Masks for CacheAttributes field above */
1880 
1881 #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1882 #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1883 #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1884 #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1885 #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1886 
1887 /* Values for cache associativity flag */
1888 
1889 #define ACPI_HMAT_CA_NONE                     (0)
1890 #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1891 #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1892 
1893 /* Values for write policy flag */
1894 
1895 #define ACPI_HMAT_CP_NONE   (0)
1896 #define ACPI_HMAT_CP_WB     (1)
1897 #define ACPI_HMAT_CP_WT     (2)
1898 
1899 
1900 /*******************************************************************************
1901  *
1902  * HPET - High Precision Event Timer table
1903  *        Version 1
1904  *
1905  * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
1906  * Version 1.0a, October 2004
1907  *
1908  ******************************************************************************/
1909 
1910 typedef struct acpi_table_hpet
1911 {
1912     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1913     UINT32                  Id;                 /* Hardware ID of event timer block */
1914     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
1915     UINT8                   Sequence;           /* HPET sequence number */
1916     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
1917     UINT8                   Flags;
1918 
1919 } ACPI_TABLE_HPET;
1920 
1921 /* Masks for Flags field above */
1922 
1923 #define ACPI_HPET_PAGE_PROTECT_MASK (3)
1924 
1925 /* Values for Page Protect flags */
1926 
1927 enum AcpiHpetPageProtect
1928 {
1929     ACPI_HPET_NO_PAGE_PROTECT       = 0,
1930     ACPI_HPET_PAGE_PROTECT4         = 1,
1931     ACPI_HPET_PAGE_PROTECT64        = 2
1932 };
1933 
1934 
1935 /*******************************************************************************
1936  *
1937  * IBFT - Boot Firmware Table
1938  *        Version 1
1939  *
1940  * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
1941  * Specification", Version 1.01, March 1, 2007
1942  *
1943  * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
1944  * Therefore, it is not currently supported by the disassembler.
1945  *
1946  ******************************************************************************/
1947 
1948 typedef struct acpi_table_ibft
1949 {
1950     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1951     UINT8                   Reserved[12];
1952 
1953 } ACPI_TABLE_IBFT;
1954 
1955 
1956 /* IBFT common subtable header */
1957 
1958 typedef struct acpi_ibft_header
1959 {
1960     UINT8                   Type;
1961     UINT8                   Version;
1962     UINT16                  Length;
1963     UINT8                   Index;
1964     UINT8                   Flags;
1965 
1966 } ACPI_IBFT_HEADER;
1967 
1968 /* Values for Type field above */
1969 
1970 enum AcpiIbftType
1971 {
1972     ACPI_IBFT_TYPE_NOT_USED         = 0,
1973     ACPI_IBFT_TYPE_CONTROL          = 1,
1974     ACPI_IBFT_TYPE_INITIATOR        = 2,
1975     ACPI_IBFT_TYPE_NIC              = 3,
1976     ACPI_IBFT_TYPE_TARGET           = 4,
1977     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
1978     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
1979 };
1980 
1981 
1982 /* IBFT subtables */
1983 
1984 typedef struct acpi_ibft_control
1985 {
1986     ACPI_IBFT_HEADER        Header;
1987     UINT16                  Extensions;
1988     UINT16                  InitiatorOffset;
1989     UINT16                  Nic0Offset;
1990     UINT16                  Target0Offset;
1991     UINT16                  Nic1Offset;
1992     UINT16                  Target1Offset;
1993 
1994 } ACPI_IBFT_CONTROL;
1995 
1996 typedef struct acpi_ibft_initiator
1997 {
1998     ACPI_IBFT_HEADER        Header;
1999     UINT8                   SnsServer[16];
2000     UINT8                   SlpServer[16];
2001     UINT8                   PrimaryServer[16];
2002     UINT8                   SecondaryServer[16];
2003     UINT16                  NameLength;
2004     UINT16                  NameOffset;
2005 
2006 } ACPI_IBFT_INITIATOR;
2007 
2008 typedef struct acpi_ibft_nic
2009 {
2010     ACPI_IBFT_HEADER        Header;
2011     UINT8                   IpAddress[16];
2012     UINT8                   SubnetMaskPrefix;
2013     UINT8                   Origin;
2014     UINT8                   Gateway[16];
2015     UINT8                   PrimaryDns[16];
2016     UINT8                   SecondaryDns[16];
2017     UINT8                   Dhcp[16];
2018     UINT16                  Vlan;
2019     UINT8                   MacAddress[6];
2020     UINT16                  PciAddress;
2021     UINT16                  NameLength;
2022     UINT16                  NameOffset;
2023 
2024 } ACPI_IBFT_NIC;
2025 
2026 typedef struct acpi_ibft_target
2027 {
2028     ACPI_IBFT_HEADER        Header;
2029     UINT8                   TargetIpAddress[16];
2030     UINT16                  TargetIpSocket;
2031     UINT8                   TargetBootLun[8];
2032     UINT8                   ChapType;
2033     UINT8                   NicAssociation;
2034     UINT16                  TargetNameLength;
2035     UINT16                  TargetNameOffset;
2036     UINT16                  ChapNameLength;
2037     UINT16                  ChapNameOffset;
2038     UINT16                  ChapSecretLength;
2039     UINT16                  ChapSecretOffset;
2040     UINT16                  ReverseChapNameLength;
2041     UINT16                  ReverseChapNameOffset;
2042     UINT16                  ReverseChapSecretLength;
2043     UINT16                  ReverseChapSecretOffset;
2044 
2045 } ACPI_IBFT_TARGET;
2046 
2047 
2048 /* Reset to default packing */
2049 
2050 #pragma pack()
2051 
2052 #endif /* __ACTBL1_H__ */
2053