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