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