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