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