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