xref: /freebsd/sys/contrib/dev/acpica/include/actbl1.h (revision d6b92ffa)
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 - 2017, 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 (1)
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  * The tables in this file are fully defined within the ACPI specification.
164  *
165  ******************************************************************************/
166 
167 
168 /*
169  * Values for description table header signatures for tables defined in this
170  * file. Useful because they make it more difficult to inadvertently type in
171  * the wrong signature.
172  */
173 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
174 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
175 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
176 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
177 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
178 #define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
179 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
180 #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
181 #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
182 #define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
183 #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
184 #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
185 #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
186 #define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
187 
188 
189 /*
190  * All tables must be byte-packed to match the ACPI specification, since
191  * the tables are provided by the system BIOS.
192  */
193 #pragma pack(1)
194 
195 /*
196  * Note: C bitfields are not used for this reason:
197  *
198  * "Bitfields are great and easy to read, but unfortunately the C language
199  * does not specify the layout of bitfields in memory, which means they are
200  * essentially useless for dealing with packed data in on-disk formats or
201  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
202  * this decision was a design error in C. Ritchie could have picked an order
203  * and stuck with it." Norman Ramsey.
204  * See http://stackoverflow.com/a/1053662/41661
205  */
206 
207 
208 /*******************************************************************************
209  *
210  * Common subtable headers
211  *
212  ******************************************************************************/
213 
214 /* Generic subtable header (used in MADT, SRAT, etc.) */
215 
216 typedef struct acpi_subtable_header
217 {
218     UINT8                   Type;
219     UINT8                   Length;
220 
221 } ACPI_SUBTABLE_HEADER;
222 
223 
224 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
225 
226 typedef struct acpi_whea_header
227 {
228     UINT8                   Action;
229     UINT8                   Instruction;
230     UINT8                   Flags;
231     UINT8                   Reserved;
232     ACPI_GENERIC_ADDRESS    RegisterRegion;
233     UINT64                  Value;              /* Value used with Read/Write register */
234     UINT64                  Mask;               /* Bitmask required for this register instruction */
235 
236 } ACPI_WHEA_HEADER;
237 
238 
239 /*******************************************************************************
240  *
241  * BERT - Boot Error Record Table (ACPI 4.0)
242  *        Version 1
243  *
244  ******************************************************************************/
245 
246 typedef struct acpi_table_bert
247 {
248     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
249     UINT32                  RegionLength;       /* Length of the boot error region */
250     UINT64                  Address;            /* Physical address of the error region */
251 
252 } ACPI_TABLE_BERT;
253 
254 
255 /* Boot Error Region (not a subtable, pointed to by Address field above) */
256 
257 typedef struct acpi_bert_region
258 {
259     UINT32                  BlockStatus;        /* Type of error information */
260     UINT32                  RawDataOffset;      /* Offset to raw error data */
261     UINT32                  RawDataLength;      /* Length of raw error data */
262     UINT32                  DataLength;         /* Length of generic error data */
263     UINT32                  ErrorSeverity;      /* Severity code */
264 
265 } ACPI_BERT_REGION;
266 
267 /* Values for BlockStatus flags above */
268 
269 #define ACPI_BERT_UNCORRECTABLE             (1)
270 #define ACPI_BERT_CORRECTABLE               (1<<1)
271 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
272 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
273 #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
274 
275 /* Values for ErrorSeverity above */
276 
277 enum AcpiBertErrorSeverity
278 {
279     ACPI_BERT_ERROR_CORRECTABLE     = 0,
280     ACPI_BERT_ERROR_FATAL           = 1,
281     ACPI_BERT_ERROR_CORRECTED       = 2,
282     ACPI_BERT_ERROR_NONE            = 3,
283     ACPI_BERT_ERROR_RESERVED        = 4     /* 4 and greater are reserved */
284 };
285 
286 /*
287  * Note: The generic error data that follows the ErrorSeverity field above
288  * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
289  */
290 
291 
292 /*******************************************************************************
293  *
294  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
295  *        Version 1
296  *
297  ******************************************************************************/
298 
299 typedef struct acpi_table_cpep
300 {
301     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
302     UINT64                  Reserved;
303 
304 } ACPI_TABLE_CPEP;
305 
306 
307 /* Subtable */
308 
309 typedef struct acpi_cpep_polling
310 {
311     ACPI_SUBTABLE_HEADER    Header;
312     UINT8                   Id;                 /* Processor ID */
313     UINT8                   Eid;                /* Processor EID */
314     UINT32                  Interval;           /* Polling interval (msec) */
315 
316 } ACPI_CPEP_POLLING;
317 
318 
319 /*******************************************************************************
320  *
321  * ECDT - Embedded Controller Boot Resources Table
322  *        Version 1
323  *
324  ******************************************************************************/
325 
326 typedef struct acpi_table_ecdt
327 {
328     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
329     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
330     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
331     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
332     UINT8                   Gpe;                /* The GPE for the EC */
333     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
334 
335 } ACPI_TABLE_ECDT;
336 
337 
338 /*******************************************************************************
339  *
340  * EINJ - Error Injection Table (ACPI 4.0)
341  *        Version 1
342  *
343  ******************************************************************************/
344 
345 typedef struct acpi_table_einj
346 {
347     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
348     UINT32                  HeaderLength;
349     UINT8                   Flags;
350     UINT8                   Reserved[3];
351     UINT32                  Entries;
352 
353 } ACPI_TABLE_EINJ;
354 
355 
356 /* EINJ Injection Instruction Entries (actions) */
357 
358 typedef struct acpi_einj_entry
359 {
360     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
361 
362 } ACPI_EINJ_ENTRY;
363 
364 /* Masks for Flags field above */
365 
366 #define ACPI_EINJ_PRESERVE          (1)
367 
368 /* Values for Action field above */
369 
370 enum AcpiEinjActions
371 {
372     ACPI_EINJ_BEGIN_OPERATION               = 0,
373     ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
374     ACPI_EINJ_SET_ERROR_TYPE                = 2,
375     ACPI_EINJ_GET_ERROR_TYPE                = 3,
376     ACPI_EINJ_END_OPERATION                 = 4,
377     ACPI_EINJ_EXECUTE_OPERATION             = 5,
378     ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
379     ACPI_EINJ_GET_COMMAND_STATUS            = 7,
380     ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
381     ACPI_EINJ_GET_EXECUTE_TIMINGS           = 9,
382     ACPI_EINJ_ACTION_RESERVED               = 10,    /* 10 and greater are reserved */
383     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
384 };
385 
386 /* Values for Instruction field above */
387 
388 enum AcpiEinjInstructions
389 {
390     ACPI_EINJ_READ_REGISTER         = 0,
391     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
392     ACPI_EINJ_WRITE_REGISTER        = 2,
393     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
394     ACPI_EINJ_NOOP                  = 4,
395     ACPI_EINJ_FLUSH_CACHELINE       = 5,
396     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
397 };
398 
399 typedef struct acpi_einj_error_type_with_addr
400 {
401     UINT32                  ErrorType;
402     UINT32                  VendorStructOffset;
403     UINT32                  Flags;
404     UINT32                  ApicId;
405     UINT64                  Address;
406     UINT64                  Range;
407     UINT32                  PcieId;
408 
409 } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
410 
411 typedef struct acpi_einj_vendor
412 {
413     UINT32                  Length;
414     UINT32                  PcieId;
415     UINT16                  VendorId;
416     UINT16                  DeviceId;
417     UINT8                   RevisionId;
418     UINT8                   Reserved[3];
419 
420 } ACPI_EINJ_VENDOR;
421 
422 
423 /* EINJ Trigger Error Action Table */
424 
425 typedef struct acpi_einj_trigger
426 {
427     UINT32                  HeaderSize;
428     UINT32                  Revision;
429     UINT32                  TableSize;
430     UINT32                  EntryCount;
431 
432 } ACPI_EINJ_TRIGGER;
433 
434 /* Command status return values */
435 
436 enum AcpiEinjCommandStatus
437 {
438     ACPI_EINJ_SUCCESS               = 0,
439     ACPI_EINJ_FAILURE               = 1,
440     ACPI_EINJ_INVALID_ACCESS        = 2,
441     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
442 };
443 
444 
445 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
446 
447 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
448 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
449 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
450 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
451 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
452 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
453 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
454 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
455 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
456 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
457 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
458 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
459 #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
460 
461 
462 /*******************************************************************************
463  *
464  * ERST - Error Record Serialization Table (ACPI 4.0)
465  *        Version 1
466  *
467  ******************************************************************************/
468 
469 typedef struct acpi_table_erst
470 {
471     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
472     UINT32                  HeaderLength;
473     UINT32                  Reserved;
474     UINT32                  Entries;
475 
476 } ACPI_TABLE_ERST;
477 
478 
479 /* ERST Serialization Entries (actions) */
480 
481 typedef struct acpi_erst_entry
482 {
483     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
484 
485 } ACPI_ERST_ENTRY;
486 
487 /* Masks for Flags field above */
488 
489 #define ACPI_ERST_PRESERVE          (1)
490 
491 /* Values for Action field above */
492 
493 enum AcpiErstActions
494 {
495     ACPI_ERST_BEGIN_WRITE           = 0,
496     ACPI_ERST_BEGIN_READ            = 1,
497     ACPI_ERST_BEGIN_CLEAR           = 2,
498     ACPI_ERST_END                   = 3,
499     ACPI_ERST_SET_RECORD_OFFSET     = 4,
500     ACPI_ERST_EXECUTE_OPERATION     = 5,
501     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
502     ACPI_ERST_GET_COMMAND_STATUS    = 7,
503     ACPI_ERST_GET_RECORD_ID         = 8,
504     ACPI_ERST_SET_RECORD_ID         = 9,
505     ACPI_ERST_GET_RECORD_COUNT      = 10,
506     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
507     ACPI_ERST_NOT_USED              = 12,
508     ACPI_ERST_GET_ERROR_RANGE       = 13,
509     ACPI_ERST_GET_ERROR_LENGTH      = 14,
510     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
511     ACPI_ERST_EXECUTE_TIMINGS       = 16,
512     ACPI_ERST_ACTION_RESERVED       = 17    /* 17 and greater are reserved */
513 };
514 
515 /* Values for Instruction field above */
516 
517 enum AcpiErstInstructions
518 {
519     ACPI_ERST_READ_REGISTER         = 0,
520     ACPI_ERST_READ_REGISTER_VALUE   = 1,
521     ACPI_ERST_WRITE_REGISTER        = 2,
522     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
523     ACPI_ERST_NOOP                  = 4,
524     ACPI_ERST_LOAD_VAR1             = 5,
525     ACPI_ERST_LOAD_VAR2             = 6,
526     ACPI_ERST_STORE_VAR1            = 7,
527     ACPI_ERST_ADD                   = 8,
528     ACPI_ERST_SUBTRACT              = 9,
529     ACPI_ERST_ADD_VALUE             = 10,
530     ACPI_ERST_SUBTRACT_VALUE        = 11,
531     ACPI_ERST_STALL                 = 12,
532     ACPI_ERST_STALL_WHILE_TRUE      = 13,
533     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
534     ACPI_ERST_GOTO                  = 15,
535     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
536     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
537     ACPI_ERST_MOVE_DATA             = 18,
538     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
539 };
540 
541 /* Command status return values */
542 
543 enum AcpiErstCommandStatus
544 {
545     ACPI_ERST_SUCESS                = 0,
546     ACPI_ERST_NO_SPACE              = 1,
547     ACPI_ERST_NOT_AVAILABLE         = 2,
548     ACPI_ERST_FAILURE               = 3,
549     ACPI_ERST_RECORD_EMPTY          = 4,
550     ACPI_ERST_NOT_FOUND             = 5,
551     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
552 };
553 
554 
555 /* Error Record Serialization Information */
556 
557 typedef struct acpi_erst_info
558 {
559     UINT16                  Signature;          /* Should be "ER" */
560     UINT8                   Data[48];
561 
562 } ACPI_ERST_INFO;
563 
564 
565 /*******************************************************************************
566  *
567  * HEST - Hardware Error Source Table (ACPI 4.0)
568  *        Version 1
569  *
570  ******************************************************************************/
571 
572 typedef struct acpi_table_hest
573 {
574     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
575     UINT32                  ErrorSourceCount;
576 
577 } ACPI_TABLE_HEST;
578 
579 
580 /* HEST subtable header */
581 
582 typedef struct acpi_hest_header
583 {
584     UINT16                  Type;
585     UINT16                  SourceId;
586 
587 } ACPI_HEST_HEADER;
588 
589 
590 /* Values for Type field above for subtables */
591 
592 enum AcpiHestTypes
593 {
594     ACPI_HEST_TYPE_IA32_CHECK           = 0,
595     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
596     ACPI_HEST_TYPE_IA32_NMI             = 2,
597     ACPI_HEST_TYPE_NOT_USED3            = 3,
598     ACPI_HEST_TYPE_NOT_USED4            = 4,
599     ACPI_HEST_TYPE_NOT_USED5            = 5,
600     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
601     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
602     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
603     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
604     ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
605     ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
606     ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
607 };
608 
609 
610 /*
611  * HEST substructures contained in subtables
612  */
613 
614 /*
615  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
616  * ACPI_HEST_IA_CORRECTED structures.
617  */
618 typedef struct acpi_hest_ia_error_bank
619 {
620     UINT8                   BankNumber;
621     UINT8                   ClearStatusOnInit;
622     UINT8                   StatusFormat;
623     UINT8                   Reserved;
624     UINT32                  ControlRegister;
625     UINT64                  ControlData;
626     UINT32                  StatusRegister;
627     UINT32                  AddressRegister;
628     UINT32                  MiscRegister;
629 
630 } ACPI_HEST_IA_ERROR_BANK;
631 
632 
633 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
634 
635 typedef struct acpi_hest_aer_common
636 {
637     UINT16                  Reserved1;
638     UINT8                   Flags;
639     UINT8                   Enabled;
640     UINT32                  RecordsToPreallocate;
641     UINT32                  MaxSectionsPerRecord;
642     UINT32                  Bus;                    /* Bus and Segment numbers */
643     UINT16                  Device;
644     UINT16                  Function;
645     UINT16                  DeviceControl;
646     UINT16                  Reserved2;
647     UINT32                  UncorrectableMask;
648     UINT32                  UncorrectableSeverity;
649     UINT32                  CorrectableMask;
650     UINT32                  AdvancedCapabilities;
651 
652 } ACPI_HEST_AER_COMMON;
653 
654 /* Masks for HEST Flags fields */
655 
656 #define ACPI_HEST_FIRMWARE_FIRST        (1)
657 #define ACPI_HEST_GLOBAL                (1<<1)
658 #define ACPI_HEST_GHES_ASSIST           (1<<2)
659 
660 /*
661  * Macros to access the bus/segment numbers in Bus field above:
662  *  Bus number is encoded in bits 7:0
663  *  Segment number is encoded in bits 23:8
664  */
665 #define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
666 #define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
667 
668 
669 /* Hardware Error Notification */
670 
671 typedef struct acpi_hest_notify
672 {
673     UINT8                   Type;
674     UINT8                   Length;
675     UINT16                  ConfigWriteEnable;
676     UINT32                  PollInterval;
677     UINT32                  Vector;
678     UINT32                  PollingThresholdValue;
679     UINT32                  PollingThresholdWindow;
680     UINT32                  ErrorThresholdValue;
681     UINT32                  ErrorThresholdWindow;
682 
683 } ACPI_HEST_NOTIFY;
684 
685 /* Values for Notify Type field above */
686 
687 enum AcpiHestNotifyTypes
688 {
689     ACPI_HEST_NOTIFY_POLLED             = 0,
690     ACPI_HEST_NOTIFY_EXTERNAL           = 1,
691     ACPI_HEST_NOTIFY_LOCAL              = 2,
692     ACPI_HEST_NOTIFY_SCI                = 3,
693     ACPI_HEST_NOTIFY_NMI                = 4,
694     ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
695     ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
696     ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
697     ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
698     ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
699     ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
700     ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
701     ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
702 };
703 
704 /* Values for ConfigWriteEnable bitfield above */
705 
706 #define ACPI_HEST_TYPE                  (1)
707 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
708 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
709 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
710 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
711 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
712 
713 
714 /*
715  * HEST subtables
716  */
717 
718 /* 0: IA32 Machine Check Exception */
719 
720 typedef struct acpi_hest_ia_machine_check
721 {
722     ACPI_HEST_HEADER        Header;
723     UINT16                  Reserved1;
724     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
725     UINT8                   Enabled;
726     UINT32                  RecordsToPreallocate;
727     UINT32                  MaxSectionsPerRecord;
728     UINT64                  GlobalCapabilityData;
729     UINT64                  GlobalControlData;
730     UINT8                   NumHardwareBanks;
731     UINT8                   Reserved3[7];
732 
733 } ACPI_HEST_IA_MACHINE_CHECK;
734 
735 
736 /* 1: IA32 Corrected Machine Check */
737 
738 typedef struct acpi_hest_ia_corrected
739 {
740     ACPI_HEST_HEADER        Header;
741     UINT16                  Reserved1;
742     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
743     UINT8                   Enabled;
744     UINT32                  RecordsToPreallocate;
745     UINT32                  MaxSectionsPerRecord;
746     ACPI_HEST_NOTIFY        Notify;
747     UINT8                   NumHardwareBanks;
748     UINT8                   Reserved2[3];
749 
750 } ACPI_HEST_IA_CORRECTED;
751 
752 
753 /* 2: IA32 Non-Maskable Interrupt */
754 
755 typedef struct acpi_hest_ia_nmi
756 {
757     ACPI_HEST_HEADER        Header;
758     UINT32                  Reserved;
759     UINT32                  RecordsToPreallocate;
760     UINT32                  MaxSectionsPerRecord;
761     UINT32                  MaxRawDataLength;
762 
763 } ACPI_HEST_IA_NMI;
764 
765 
766 /* 3,4,5: Not used */
767 
768 /* 6: PCI Express Root Port AER */
769 
770 typedef struct acpi_hest_aer_root
771 {
772     ACPI_HEST_HEADER        Header;
773     ACPI_HEST_AER_COMMON    Aer;
774     UINT32                  RootErrorCommand;
775 
776 } ACPI_HEST_AER_ROOT;
777 
778 
779 /* 7: PCI Express AER (AER Endpoint) */
780 
781 typedef struct acpi_hest_aer
782 {
783     ACPI_HEST_HEADER        Header;
784     ACPI_HEST_AER_COMMON    Aer;
785 
786 } ACPI_HEST_AER;
787 
788 
789 /* 8: PCI Express/PCI-X Bridge AER */
790 
791 typedef struct acpi_hest_aer_bridge
792 {
793     ACPI_HEST_HEADER        Header;
794     ACPI_HEST_AER_COMMON    Aer;
795     UINT32                  UncorrectableMask2;
796     UINT32                  UncorrectableSeverity2;
797     UINT32                  AdvancedCapabilities2;
798 
799 } ACPI_HEST_AER_BRIDGE;
800 
801 
802 /* 9: Generic Hardware Error Source */
803 
804 typedef struct acpi_hest_generic
805 {
806     ACPI_HEST_HEADER        Header;
807     UINT16                  RelatedSourceId;
808     UINT8                   Reserved;
809     UINT8                   Enabled;
810     UINT32                  RecordsToPreallocate;
811     UINT32                  MaxSectionsPerRecord;
812     UINT32                  MaxRawDataLength;
813     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
814     ACPI_HEST_NOTIFY        Notify;
815     UINT32                  ErrorBlockLength;
816 
817 } ACPI_HEST_GENERIC;
818 
819 
820 /* 10: Generic Hardware Error Source, version 2 */
821 
822 typedef struct acpi_hest_generic_v2
823 {
824     ACPI_HEST_HEADER        Header;
825     UINT16                  RelatedSourceId;
826     UINT8                   Reserved;
827     UINT8                   Enabled;
828     UINT32                  RecordsToPreallocate;
829     UINT32                  MaxSectionsPerRecord;
830     UINT32                  MaxRawDataLength;
831     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
832     ACPI_HEST_NOTIFY        Notify;
833     UINT32                  ErrorBlockLength;
834     ACPI_GENERIC_ADDRESS    ReadAckRegister;
835     UINT64                  ReadAckPreserve;
836     UINT64                  ReadAckWrite;
837 
838 } ACPI_HEST_GENERIC_V2;
839 
840 
841 /* Generic Error Status block */
842 
843 typedef struct acpi_hest_generic_status
844 {
845     UINT32                  BlockStatus;
846     UINT32                  RawDataOffset;
847     UINT32                  RawDataLength;
848     UINT32                  DataLength;
849     UINT32                  ErrorSeverity;
850 
851 } ACPI_HEST_GENERIC_STATUS;
852 
853 /* Values for BlockStatus flags above */
854 
855 #define ACPI_HEST_UNCORRECTABLE             (1)
856 #define ACPI_HEST_CORRECTABLE               (1<<1)
857 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
858 #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
859 #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
860 
861 
862 /* Generic Error Data entry */
863 
864 typedef struct acpi_hest_generic_data
865 {
866     UINT8                   SectionType[16];
867     UINT32                  ErrorSeverity;
868     UINT16                  Revision;
869     UINT8                   ValidationBits;
870     UINT8                   Flags;
871     UINT32                  ErrorDataLength;
872     UINT8                   FruId[16];
873     UINT8                   FruText[20];
874 
875 } ACPI_HEST_GENERIC_DATA;
876 
877 /* Extension for revision 0x0300 */
878 
879 typedef struct acpi_hest_generic_data_v300
880 {
881     UINT8                   SectionType[16];
882     UINT32                  ErrorSeverity;
883     UINT16                  Revision;
884     UINT8                   ValidationBits;
885     UINT8                   Flags;
886     UINT32                  ErrorDataLength;
887     UINT8                   FruId[16];
888     UINT8                   FruText[20];
889     UINT64                  TimeStamp;
890 
891 } ACPI_HEST_GENERIC_DATA_V300;
892 
893 /* Values for ErrorSeverity above */
894 
895 #define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
896 #define ACPI_HEST_GEN_ERROR_FATAL           1
897 #define ACPI_HEST_GEN_ERROR_CORRECTED       2
898 #define ACPI_HEST_GEN_ERROR_NONE            3
899 
900 /* Flags for ValidationBits above */
901 
902 #define ACPI_HEST_GEN_VALID_FRU_ID          (1)
903 #define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
904 #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
905 
906 
907 /* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
908 
909 typedef struct acpi_hest_ia_deferred_check
910 {
911     ACPI_HEST_HEADER        Header;
912     UINT16                  Reserved1;
913     UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
914     UINT8                   Enabled;
915     UINT32                  RecordsToPreallocate;
916     UINT32                  MaxSectionsPerRecord;
917     ACPI_HEST_NOTIFY        Notify;
918     UINT8                   NumHardwareBanks;
919     UINT8                   Reserved2[3];
920 
921 } ACPI_HEST_IA_DEFERRED_CHECK;
922 
923 
924 /*******************************************************************************
925  *
926  * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
927  *        Version 1
928  *
929  ******************************************************************************/
930 
931 typedef struct acpi_table_hmat
932 {
933     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
934     UINT32                  Reserved;
935 
936 } ACPI_TABLE_HMAT;
937 
938 
939 /* Values for HMAT structure types */
940 
941 enum AcpiHmatType
942 {
943     ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subystem address range */
944     ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
945     ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
946     ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
947 };
948 
949 typedef struct acpi_hmat_structure
950 {
951     UINT16                  Type;
952     UINT16                  Reserved;
953     UINT32                  Length;
954 
955 } ACPI_HMAT_STRUCTURE;
956 
957 
958 /*
959  * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
960  */
961 
962 /* 0: Memory subystem address range */
963 
964 typedef struct acpi_hmat_address_range
965 {
966     ACPI_HMAT_STRUCTURE     Header;
967     UINT16                  Flags;
968     UINT16                  Reserved1;
969     UINT32                  ProcessorPD;            /* Processor proximity domain */
970     UINT32                  MemoryPD;               /* Memory proximity domain */
971     UINT32                  Reserved2;
972     UINT64                  PhysicalAddressBase;    /* Physical address range base */
973     UINT64                  PhysicalAddressLength;  /* Physical address range length */
974 
975 } ACPI_HMAT_ADDRESS_RANGE;
976 
977 /* Masks for Flags field above */
978 
979 #define ACPI_HMAT_PROCESSOR_PD_VALID    (1)     /* 1: ProcessorPD field is valid */
980 #define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)  /* 1: MemoryPD field is valid */
981 #define ACPI_HMAT_RESERVATION_HINT      (1<<2)  /* 1: Reservation hint */
982 
983 
984 /* 1: System locality latency and bandwidth information */
985 
986 typedef struct acpi_hmat_locality
987 {
988     ACPI_HMAT_STRUCTURE     Header;
989     UINT8                   Flags;
990     UINT8                   DataType;
991     UINT16                  Reserved1;
992     UINT32                  NumberOfInitiatorPDs;
993     UINT32                  NumberOfTargetPDs;
994     UINT32                  Reserved2;
995     UINT64                  EntryBaseUnit;
996 
997 } ACPI_HMAT_LOCALITY;
998 
999 /* Masks for Flags field above */
1000 
1001 #define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
1002 
1003 /* Values for Memory Hierarchy flag */
1004 
1005 #define ACPI_HMAT_MEMORY            0
1006 #define ACPI_HMAT_LAST_LEVEL_CACHE  1
1007 #define ACPI_HMAT_1ST_LEVEL_CACHE   2
1008 #define ACPI_HMAT_2ND_LEVEL_CACHE   3
1009 #define ACPI_HMAT_3RD_LEVEL_CACHE   4
1010 
1011 /* Values for DataType field above */
1012 
1013 #define ACPI_HMAT_ACCESS_LATENCY    0
1014 #define ACPI_HMAT_READ_LATENCY      1
1015 #define ACPI_HMAT_WRITE_LATENCY     2
1016 #define ACPI_HMAT_ACCESS_BANDWIDTH  3
1017 #define ACPI_HMAT_READ_BANDWIDTH    4
1018 #define ACPI_HMAT_WRITE_BANDWIDTH   5
1019 
1020 
1021 /* 2: Memory side cache information */
1022 
1023 typedef struct acpi_hmat_cache
1024 {
1025     ACPI_HMAT_STRUCTURE     Header;
1026     UINT32                  MemoryPD;
1027     UINT32                  Reserved1;
1028     UINT64                  CacheSize;
1029     UINT32                  CacheAttributes;
1030     UINT16                  Reserved2;
1031     UINT16                  NumberOfSMBIOSHandles;
1032 
1033 } ACPI_HMAT_CACHE;
1034 
1035 /* Masks for CacheAttributes field above */
1036 
1037 #define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
1038 #define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
1039 #define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
1040 #define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
1041 #define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
1042 
1043 /* Values for cache associativity flag */
1044 
1045 #define ACPI_HMAT_CA_NONE                     (0)
1046 #define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
1047 #define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
1048 
1049 /* Values for write policy flag */
1050 
1051 #define ACPI_HMAT_CP_NONE   (0)
1052 #define ACPI_HMAT_CP_WB     (1)
1053 #define ACPI_HMAT_CP_WT     (2)
1054 
1055 
1056 /*******************************************************************************
1057  *
1058  * MADT - Multiple APIC Description Table
1059  *        Version 3
1060  *
1061  ******************************************************************************/
1062 
1063 typedef struct acpi_table_madt
1064 {
1065     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1066     UINT32                  Address;            /* Physical address of local APIC */
1067     UINT32                  Flags;
1068 
1069 } ACPI_TABLE_MADT;
1070 
1071 /* Masks for Flags field above */
1072 
1073 #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
1074 
1075 /* Values for PCATCompat flag */
1076 
1077 #define ACPI_MADT_DUAL_PIC          1
1078 #define ACPI_MADT_MULTIPLE_APIC     0
1079 
1080 
1081 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
1082 
1083 enum AcpiMadtType
1084 {
1085     ACPI_MADT_TYPE_LOCAL_APIC               = 0,
1086     ACPI_MADT_TYPE_IO_APIC                  = 1,
1087     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
1088     ACPI_MADT_TYPE_NMI_SOURCE               = 3,
1089     ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
1090     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
1091     ACPI_MADT_TYPE_IO_SAPIC                 = 6,
1092     ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
1093     ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
1094     ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
1095     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
1096     ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
1097     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
1098     ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
1099     ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
1100     ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
1101     ACPI_MADT_TYPE_RESERVED                 = 16    /* 16 and greater are reserved */
1102 };
1103 
1104 
1105 /*
1106  * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
1107  */
1108 
1109 /* 0: Processor Local APIC */
1110 
1111 typedef struct acpi_madt_local_apic
1112 {
1113     ACPI_SUBTABLE_HEADER    Header;
1114     UINT8                   ProcessorId;        /* ACPI processor id */
1115     UINT8                   Id;                 /* Processor's local APIC id */
1116     UINT32                  LapicFlags;
1117 
1118 } ACPI_MADT_LOCAL_APIC;
1119 
1120 
1121 /* 1: IO APIC */
1122 
1123 typedef struct acpi_madt_io_apic
1124 {
1125     ACPI_SUBTABLE_HEADER    Header;
1126     UINT8                   Id;                 /* I/O APIC ID */
1127     UINT8                   Reserved;           /* Reserved - must be zero */
1128     UINT32                  Address;            /* APIC physical address */
1129     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
1130 
1131 } ACPI_MADT_IO_APIC;
1132 
1133 
1134 /* 2: Interrupt Override */
1135 
1136 typedef struct acpi_madt_interrupt_override
1137 {
1138     ACPI_SUBTABLE_HEADER    Header;
1139     UINT8                   Bus;                /* 0 - ISA */
1140     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
1141     UINT32                  GlobalIrq;          /* Global system interrupt */
1142     UINT16                  IntiFlags;
1143 
1144 } ACPI_MADT_INTERRUPT_OVERRIDE;
1145 
1146 
1147 /* 3: NMI Source */
1148 
1149 typedef struct acpi_madt_nmi_source
1150 {
1151     ACPI_SUBTABLE_HEADER    Header;
1152     UINT16                  IntiFlags;
1153     UINT32                  GlobalIrq;          /* Global system interrupt */
1154 
1155 } ACPI_MADT_NMI_SOURCE;
1156 
1157 
1158 /* 4: Local APIC NMI */
1159 
1160 typedef struct acpi_madt_local_apic_nmi
1161 {
1162     ACPI_SUBTABLE_HEADER    Header;
1163     UINT8                   ProcessorId;        /* ACPI processor id */
1164     UINT16                  IntiFlags;
1165     UINT8                   Lint;               /* LINTn to which NMI is connected */
1166 
1167 } ACPI_MADT_LOCAL_APIC_NMI;
1168 
1169 
1170 /* 5: Address Override */
1171 
1172 typedef struct acpi_madt_local_apic_override
1173 {
1174     ACPI_SUBTABLE_HEADER    Header;
1175     UINT16                  Reserved;           /* Reserved, must be zero */
1176     UINT64                  Address;            /* APIC physical address */
1177 
1178 } ACPI_MADT_LOCAL_APIC_OVERRIDE;
1179 
1180 
1181 /* 6: I/O Sapic */
1182 
1183 typedef struct acpi_madt_io_sapic
1184 {
1185     ACPI_SUBTABLE_HEADER    Header;
1186     UINT8                   Id;                 /* I/O SAPIC ID */
1187     UINT8                   Reserved;           /* Reserved, must be zero */
1188     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
1189     UINT64                  Address;            /* SAPIC physical address */
1190 
1191 } ACPI_MADT_IO_SAPIC;
1192 
1193 
1194 /* 7: Local Sapic */
1195 
1196 typedef struct acpi_madt_local_sapic
1197 {
1198     ACPI_SUBTABLE_HEADER    Header;
1199     UINT8                   ProcessorId;        /* ACPI processor id */
1200     UINT8                   Id;                 /* SAPIC ID */
1201     UINT8                   Eid;                /* SAPIC EID */
1202     UINT8                   Reserved[3];        /* Reserved, must be zero */
1203     UINT32                  LapicFlags;
1204     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
1205     char                    UidString[1];       /* String UID  - ACPI 3.0 */
1206 
1207 } ACPI_MADT_LOCAL_SAPIC;
1208 
1209 
1210 /* 8: Platform Interrupt Source */
1211 
1212 typedef struct acpi_madt_interrupt_source
1213 {
1214     ACPI_SUBTABLE_HEADER    Header;
1215     UINT16                  IntiFlags;
1216     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
1217     UINT8                   Id;                 /* Processor ID */
1218     UINT8                   Eid;                /* Processor EID */
1219     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
1220     UINT32                  GlobalIrq;          /* Global system interrupt */
1221     UINT32                  Flags;              /* Interrupt Source Flags */
1222 
1223 } ACPI_MADT_INTERRUPT_SOURCE;
1224 
1225 /* Masks for Flags field above */
1226 
1227 #define ACPI_MADT_CPEI_OVERRIDE     (1)
1228 
1229 
1230 /* 9: Processor Local X2APIC (ACPI 4.0) */
1231 
1232 typedef struct acpi_madt_local_x2apic
1233 {
1234     ACPI_SUBTABLE_HEADER    Header;
1235     UINT16                  Reserved;           /* Reserved - must be zero */
1236     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
1237     UINT32                  LapicFlags;
1238     UINT32                  Uid;                /* ACPI processor UID */
1239 
1240 } ACPI_MADT_LOCAL_X2APIC;
1241 
1242 
1243 /* 10: Local X2APIC NMI (ACPI 4.0) */
1244 
1245 typedef struct acpi_madt_local_x2apic_nmi
1246 {
1247     ACPI_SUBTABLE_HEADER    Header;
1248     UINT16                  IntiFlags;
1249     UINT32                  Uid;                /* ACPI processor UID */
1250     UINT8                   Lint;               /* LINTn to which NMI is connected */
1251     UINT8                   Reserved[3];        /* Reserved - must be zero */
1252 
1253 } ACPI_MADT_LOCAL_X2APIC_NMI;
1254 
1255 
1256 /* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
1257 
1258 typedef struct acpi_madt_generic_interrupt
1259 {
1260     ACPI_SUBTABLE_HEADER    Header;
1261     UINT16                  Reserved;           /* Reserved - must be zero */
1262     UINT32                  CpuInterfaceNumber;
1263     UINT32                  Uid;
1264     UINT32                  Flags;
1265     UINT32                  ParkingVersion;
1266     UINT32                  PerformanceInterrupt;
1267     UINT64                  ParkedAddress;
1268     UINT64                  BaseAddress;
1269     UINT64                  GicvBaseAddress;
1270     UINT64                  GichBaseAddress;
1271     UINT32                  VgicInterrupt;
1272     UINT64                  GicrBaseAddress;
1273     UINT64                  ArmMpidr;
1274     UINT8                   EfficiencyClass;
1275     UINT8                   Reserved2[3];
1276 
1277 } ACPI_MADT_GENERIC_INTERRUPT;
1278 
1279 /* Masks for Flags field above */
1280 
1281 /* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
1282 #define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
1283 #define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
1284 
1285 
1286 /* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
1287 
1288 typedef struct acpi_madt_generic_distributor
1289 {
1290     ACPI_SUBTABLE_HEADER    Header;
1291     UINT16                  Reserved;           /* Reserved - must be zero */
1292     UINT32                  GicId;
1293     UINT64                  BaseAddress;
1294     UINT32                  GlobalIrqBase;
1295     UINT8                   Version;
1296     UINT8                   Reserved2[3];       /* Reserved - must be zero */
1297 
1298 } ACPI_MADT_GENERIC_DISTRIBUTOR;
1299 
1300 /* Values for Version field above */
1301 
1302 enum AcpiMadtGicVersion
1303 {
1304     ACPI_MADT_GIC_VERSION_NONE          = 0,
1305     ACPI_MADT_GIC_VERSION_V1            = 1,
1306     ACPI_MADT_GIC_VERSION_V2            = 2,
1307     ACPI_MADT_GIC_VERSION_V3            = 3,
1308     ACPI_MADT_GIC_VERSION_V4            = 4,
1309     ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
1310 };
1311 
1312 
1313 /* 13: Generic MSI Frame (ACPI 5.1) */
1314 
1315 typedef struct acpi_madt_generic_msi_frame
1316 {
1317     ACPI_SUBTABLE_HEADER    Header;
1318     UINT16                  Reserved;           /* Reserved - must be zero */
1319     UINT32                  MsiFrameId;
1320     UINT64                  BaseAddress;
1321     UINT32                  Flags;
1322     UINT16                  SpiCount;
1323     UINT16                  SpiBase;
1324 
1325 } ACPI_MADT_GENERIC_MSI_FRAME;
1326 
1327 /* Masks for Flags field above */
1328 
1329 #define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
1330 
1331 
1332 /* 14: Generic Redistributor (ACPI 5.1) */
1333 
1334 typedef struct acpi_madt_generic_redistributor
1335 {
1336     ACPI_SUBTABLE_HEADER    Header;
1337     UINT16                  Reserved;           /* reserved - must be zero */
1338     UINT64                  BaseAddress;
1339     UINT32                  Length;
1340 
1341 } ACPI_MADT_GENERIC_REDISTRIBUTOR;
1342 
1343 
1344 /* 15: Generic Translator (ACPI 6.0) */
1345 
1346 typedef struct acpi_madt_generic_translator
1347 {
1348     ACPI_SUBTABLE_HEADER    Header;
1349     UINT16                  Reserved;           /* reserved - must be zero */
1350     UINT32                  TranslationId;
1351     UINT64                  BaseAddress;
1352     UINT32                  Reserved2;
1353 
1354 } ACPI_MADT_GENERIC_TRANSLATOR;
1355 
1356 
1357 /*
1358  * Common flags fields for MADT subtables
1359  */
1360 
1361 /* MADT Local APIC flags */
1362 
1363 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
1364 
1365 /* MADT MPS INTI flags (IntiFlags) */
1366 
1367 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
1368 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
1369 
1370 /* Values for MPS INTI flags */
1371 
1372 #define ACPI_MADT_POLARITY_CONFORMS       0
1373 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
1374 #define ACPI_MADT_POLARITY_RESERVED       2
1375 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
1376 
1377 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
1378 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
1379 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
1380 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
1381 
1382 
1383 /*******************************************************************************
1384  *
1385  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1386  *        Version 1
1387  *
1388  ******************************************************************************/
1389 
1390 typedef struct acpi_table_msct
1391 {
1392     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1393     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
1394     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
1395     UINT32                  MaxClockDomains;    /* Max number of clock domains */
1396     UINT64                  MaxAddress;         /* Max physical address in system */
1397 
1398 } ACPI_TABLE_MSCT;
1399 
1400 
1401 /* Subtable - Maximum Proximity Domain Information. Version 1 */
1402 
1403 typedef struct acpi_msct_proximity
1404 {
1405     UINT8                   Revision;
1406     UINT8                   Length;
1407     UINT32                  RangeStart;         /* Start of domain range */
1408     UINT32                  RangeEnd;           /* End of domain range */
1409     UINT32                  ProcessorCapacity;
1410     UINT64                  MemoryCapacity;     /* In bytes */
1411 
1412 } ACPI_MSCT_PROXIMITY;
1413 
1414 
1415 /*******************************************************************************
1416  *
1417  * NFIT - NVDIMM Interface Table (ACPI 6.0+)
1418  *        Version 1
1419  *
1420  ******************************************************************************/
1421 
1422 typedef struct acpi_table_nfit
1423 {
1424     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1425     UINT32                  Reserved;           /* Reserved, must be zero */
1426 
1427 } ACPI_TABLE_NFIT;
1428 
1429 /* Subtable header for NFIT */
1430 
1431 typedef struct acpi_nfit_header
1432 {
1433     UINT16                   Type;
1434     UINT16                   Length;
1435 
1436 } ACPI_NFIT_HEADER;
1437 
1438 
1439 /* Values for subtable type in ACPI_NFIT_HEADER */
1440 
1441 enum AcpiNfitType
1442 {
1443     ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
1444     ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
1445     ACPI_NFIT_TYPE_INTERLEAVE           = 2,
1446     ACPI_NFIT_TYPE_SMBIOS               = 3,
1447     ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
1448     ACPI_NFIT_TYPE_DATA_REGION          = 5,
1449     ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
1450     ACPI_NFIT_TYPE_RESERVED             = 7     /* 7 and greater are reserved */
1451 };
1452 
1453 /*
1454  * NFIT Subtables
1455  */
1456 
1457 /* 0: System Physical Address Range Structure */
1458 
1459 typedef struct acpi_nfit_system_address
1460 {
1461     ACPI_NFIT_HEADER        Header;
1462     UINT16                  RangeIndex;
1463     UINT16                  Flags;
1464     UINT32                  Reserved;           /* Reseved, must be zero */
1465     UINT32                  ProximityDomain;
1466     UINT8                   RangeGuid[16];
1467     UINT64                  Address;
1468     UINT64                  Length;
1469     UINT64                  MemoryMapping;
1470 
1471 } ACPI_NFIT_SYSTEM_ADDRESS;
1472 
1473 /* Flags */
1474 
1475 #define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
1476 #define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
1477 
1478 /* Range Type GUIDs appear in the include/acuuid.h file */
1479 
1480 
1481 /* 1: Memory Device to System Address Range Map Structure */
1482 
1483 typedef struct acpi_nfit_memory_map
1484 {
1485     ACPI_NFIT_HEADER        Header;
1486     UINT32                  DeviceHandle;
1487     UINT16                  PhysicalId;
1488     UINT16                  RegionId;
1489     UINT16                  RangeIndex;
1490     UINT16                  RegionIndex;
1491     UINT64                  RegionSize;
1492     UINT64                  RegionOffset;
1493     UINT64                  Address;
1494     UINT16                  InterleaveIndex;
1495     UINT16                  InterleaveWays;
1496     UINT16                  Flags;
1497     UINT16                  Reserved;           /* Reserved, must be zero */
1498 
1499 } ACPI_NFIT_MEMORY_MAP;
1500 
1501 /* Flags */
1502 
1503 #define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
1504 #define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
1505 #define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
1506 #define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
1507 #define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
1508 #define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
1509 #define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
1510 
1511 
1512 /* 2: Interleave Structure */
1513 
1514 typedef struct acpi_nfit_interleave
1515 {
1516     ACPI_NFIT_HEADER        Header;
1517     UINT16                  InterleaveIndex;
1518     UINT16                  Reserved;           /* Reserved, must be zero */
1519     UINT32                  LineCount;
1520     UINT32                  LineSize;
1521     UINT32                  LineOffset[1];      /* Variable length */
1522 
1523 } ACPI_NFIT_INTERLEAVE;
1524 
1525 
1526 /* 3: SMBIOS Management Information Structure */
1527 
1528 typedef struct acpi_nfit_smbios
1529 {
1530     ACPI_NFIT_HEADER        Header;
1531     UINT32                  Reserved;           /* Reserved, must be zero */
1532     UINT8                   Data[1];            /* Variable length */
1533 
1534 } ACPI_NFIT_SMBIOS;
1535 
1536 
1537 /* 4: NVDIMM Control Region Structure */
1538 
1539 typedef struct acpi_nfit_control_region
1540 {
1541     ACPI_NFIT_HEADER        Header;
1542     UINT16                  RegionIndex;
1543     UINT16                  VendorId;
1544     UINT16                  DeviceId;
1545     UINT16                  RevisionId;
1546     UINT16                  SubsystemVendorId;
1547     UINT16                  SubsystemDeviceId;
1548     UINT16                  SubsystemRevisionId;
1549     UINT8                   ValidFields;
1550     UINT8                   ManufacturingLocation;
1551     UINT16                  ManufacturingDate;
1552     UINT8                   Reserved[2];        /* Reserved, must be zero */
1553     UINT32                  SerialNumber;
1554     UINT16                  Code;
1555     UINT16                  Windows;
1556     UINT64                  WindowSize;
1557     UINT64                  CommandOffset;
1558     UINT64                  CommandSize;
1559     UINT64                  StatusOffset;
1560     UINT64                  StatusSize;
1561     UINT16                  Flags;
1562     UINT8                   Reserved1[6];       /* Reserved, must be zero */
1563 
1564 } ACPI_NFIT_CONTROL_REGION;
1565 
1566 /* Flags */
1567 
1568 #define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
1569 
1570 /* ValidFields bits */
1571 
1572 #define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
1573 
1574 
1575 /* 5: NVDIMM Block Data Window Region Structure */
1576 
1577 typedef struct acpi_nfit_data_region
1578 {
1579     ACPI_NFIT_HEADER        Header;
1580     UINT16                  RegionIndex;
1581     UINT16                  Windows;
1582     UINT64                  Offset;
1583     UINT64                  Size;
1584     UINT64                  Capacity;
1585     UINT64                  StartAddress;
1586 
1587 } ACPI_NFIT_DATA_REGION;
1588 
1589 
1590 /* 6: Flush Hint Address Structure */
1591 
1592 typedef struct acpi_nfit_flush_address
1593 {
1594     ACPI_NFIT_HEADER        Header;
1595     UINT32                  DeviceHandle;
1596     UINT16                  HintCount;
1597     UINT8                   Reserved[6];        /* Reserved, must be zero */
1598     UINT64                  HintAddress[1];     /* Variable length */
1599 
1600 } ACPI_NFIT_FLUSH_ADDRESS;
1601 
1602 
1603 /*******************************************************************************
1604  *
1605  * PPTT - Processor Properties Topology Table (ACPI 6.2)
1606  *        Version 1
1607  *
1608  ******************************************************************************/
1609 
1610 typedef struct acpi_table_pptt
1611 {
1612     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1613 
1614 } ACPI_TABLE_PPTT;
1615 
1616 /* Values for Type field above */
1617 
1618 enum AcpiPpttType
1619 {
1620     ACPI_PPTT_TYPE_PROCESSOR            = 0,
1621     ACPI_PPTT_TYPE_CACHE                = 1,
1622     ACPI_PPTT_TYPE_ID                   = 2,
1623     ACPI_PPTT_TYPE_RESERVED             = 3
1624 };
1625 
1626 
1627 /* 0: Processor Hierarchy Node Structure */
1628 
1629 typedef struct acpi_pptt_processor {
1630     ACPI_SUBTABLE_HEADER    Header;
1631     UINT16                  Reserved;
1632     UINT32                  Flags;
1633     UINT32                  Parent;
1634     UINT32                  AcpiProcessorId;
1635     UINT32                  NumberOfPrivResources;
1636 
1637 } ACPI_PPTT_PROCESSOR;
1638 
1639 /* Flags */
1640 
1641 #define ACPI_PPTT_PHYSICAL_PACKAGE          (1)     /* Physical package */
1642 #define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (2)     /* ACPI Processor ID valid */
1643 
1644 
1645 /* 1: Cache Type Structure */
1646 
1647 typedef struct acpi_pptt_cache {
1648     ACPI_SUBTABLE_HEADER    Header;
1649     UINT16                  Reserved;
1650     UINT32                  Flags;
1651     UINT32                  NextLevelOfCache;
1652     UINT32                  Size;
1653     UINT32                  NumberOfSets;
1654     UINT8                   Associativity;
1655     UINT8                   Attributes;
1656     UINT16                  LineSize;
1657 
1658 } ACPI_PPTT_CACHE;
1659 
1660 /* Flags */
1661 
1662 #define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
1663 #define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
1664 #define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
1665 #define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
1666 #define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
1667 #define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
1668 #define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
1669 
1670 /* Masks for Attributes */
1671 
1672 #define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
1673 #define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
1674 #define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
1675 
1676 
1677 /* 2: ID Structure */
1678 
1679 typedef struct acpi_pptt_id {
1680     ACPI_SUBTABLE_HEADER    Header;
1681     UINT16                  Reserved;
1682     UINT32                  VendorId;
1683     UINT64                  Level1Id;
1684     UINT64                  Level2Id;
1685     UINT16                  MajorRev;
1686     UINT16                  MinorRev;
1687     UINT16                  SpinRev;
1688 
1689 } ACPI_PPTT_ID;
1690 
1691 
1692 /*******************************************************************************
1693  *
1694  * SBST - Smart Battery Specification Table
1695  *        Version 1
1696  *
1697  ******************************************************************************/
1698 
1699 typedef struct acpi_table_sbst
1700 {
1701     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1702     UINT32                  WarningLevel;
1703     UINT32                  LowLevel;
1704     UINT32                  CriticalLevel;
1705 
1706 } ACPI_TABLE_SBST;
1707 
1708 
1709 /*******************************************************************************
1710  *
1711  * SLIT - System Locality Distance Information Table
1712  *        Version 1
1713  *
1714  ******************************************************************************/
1715 
1716 typedef struct acpi_table_slit
1717 {
1718     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1719     UINT64                  LocalityCount;
1720     UINT8                   Entry[1];           /* Real size = localities^2 */
1721 
1722 } ACPI_TABLE_SLIT;
1723 
1724 
1725 /*******************************************************************************
1726  *
1727  * SRAT - System Resource Affinity Table
1728  *        Version 3
1729  *
1730  ******************************************************************************/
1731 
1732 typedef struct acpi_table_srat
1733 {
1734     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1735     UINT32                  TableRevision;      /* Must be value '1' */
1736     UINT64                  Reserved;           /* Reserved, must be zero */
1737 
1738 } ACPI_TABLE_SRAT;
1739 
1740 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1741 
1742 enum AcpiSratType
1743 {
1744     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1745     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1746     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1747     ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
1748     ACPI_SRAT_TYPE_GIC_ITS_AFFINITY     = 4,    /* ACPI 6.2 */
1749     ACPI_SRAT_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
1750 };
1751 
1752 /*
1753  * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
1754  */
1755 
1756 /* 0: Processor Local APIC/SAPIC Affinity */
1757 
1758 typedef struct acpi_srat_cpu_affinity
1759 {
1760     ACPI_SUBTABLE_HEADER    Header;
1761     UINT8                   ProximityDomainLo;
1762     UINT8                   ApicId;
1763     UINT32                  Flags;
1764     UINT8                   LocalSapicEid;
1765     UINT8                   ProximityDomainHi[3];
1766     UINT32                  ClockDomain;
1767 
1768 } ACPI_SRAT_CPU_AFFINITY;
1769 
1770 /* Flags */
1771 
1772 #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
1773 
1774 
1775 /* 1: Memory Affinity */
1776 
1777 typedef struct acpi_srat_mem_affinity
1778 {
1779     ACPI_SUBTABLE_HEADER    Header;
1780     UINT32                  ProximityDomain;
1781     UINT16                  Reserved;           /* Reserved, must be zero */
1782     UINT64                  BaseAddress;
1783     UINT64                  Length;
1784     UINT32                  Reserved1;
1785     UINT32                  Flags;
1786     UINT64                  Reserved2;          /* Reserved, must be zero */
1787 
1788 } ACPI_SRAT_MEM_AFFINITY;
1789 
1790 /* Flags */
1791 
1792 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1793 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1794 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1795 
1796 
1797 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1798 
1799 typedef struct acpi_srat_x2apic_cpu_affinity
1800 {
1801     ACPI_SUBTABLE_HEADER    Header;
1802     UINT16                  Reserved;           /* Reserved, must be zero */
1803     UINT32                  ProximityDomain;
1804     UINT32                  ApicId;
1805     UINT32                  Flags;
1806     UINT32                  ClockDomain;
1807     UINT32                  Reserved2;
1808 
1809 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1810 
1811 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1812 
1813 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1814 
1815 
1816 /* 3: GICC Affinity (ACPI 5.1) */
1817 
1818 typedef struct acpi_srat_gicc_affinity
1819 {
1820     ACPI_SUBTABLE_HEADER    Header;
1821     UINT32                  ProximityDomain;
1822     UINT32                  AcpiProcessorUid;
1823     UINT32                  Flags;
1824     UINT32                  ClockDomain;
1825 
1826 } ACPI_SRAT_GICC_AFFINITY;
1827 
1828 /* Flags for ACPI_SRAT_GICC_AFFINITY */
1829 
1830 #define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
1831 
1832 
1833 /* 4: GCC ITS Affinity (ACPI 6.2) */
1834 
1835 typedef struct acpi_srat_gic_its_affinity
1836 {
1837     ACPI_SUBTABLE_HEADER    Header;
1838     UINT32                  ProximityDomain;
1839     UINT16                  Reserved;
1840     UINT32                  ItsId;
1841 
1842 } ACPI_SRAT_GIC_ITS_AFFINITY;
1843 
1844 
1845 /* Reset to default packing */
1846 
1847 #pragma pack()
1848 
1849 #endif /* __ACTBL1_H__ */
1850