xref: /haiku/src/add-ons/kernel/bus_managers/acpi/acpica/include/actbl1.h (revision aed35104852941f0f6f3d1dcc5338b5f337d0a3c)
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 - 2012, 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 #ifndef __ACTBL1_H__
117 #define __ACTBL1_H__
118 
119 
120 /*******************************************************************************
121  *
122  * Additional ACPI Tables (1)
123  *
124  * These tables are not consumed directly by the ACPICA subsystem, but are
125  * included here to support device drivers and the AML disassembler.
126  *
127  * The tables in this file are fully defined within the ACPI specification.
128  *
129  ******************************************************************************/
130 
131 
132 /*
133  * Values for description table header signatures for tables defined in this
134  * file. Useful because they make it more difficult to inadvertently type in
135  * the wrong signature.
136  */
137 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
138 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
139 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
140 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
141 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
142 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
143 #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
144 #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
145 #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
146 #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
147 #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
148 
149 
150 /*
151  * All tables must be byte-packed to match the ACPI specification, since
152  * the tables are provided by the system BIOS.
153  */
154 #pragma pack(1)
155 
156 /*
157  * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
158  * This is the only type that is even remotely portable. Anything else is not
159  * portable, so do not use any other bitfield types.
160  */
161 
162 
163 /*******************************************************************************
164  *
165  * Common subtable headers
166  *
167  ******************************************************************************/
168 
169 /* Generic subtable header (used in MADT, SRAT, etc.) */
170 
171 typedef struct acpi_subtable_header
172 {
173     UINT8                   Type;
174     UINT8                   Length;
175 
176 } ACPI_SUBTABLE_HEADER;
177 
178 
179 /* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
180 
181 typedef struct acpi_whea_header
182 {
183     UINT8                   Action;
184     UINT8                   Instruction;
185     UINT8                   Flags;
186     UINT8                   Reserved;
187     ACPI_GENERIC_ADDRESS    RegisterRegion;
188     UINT64                  Value;              /* Value used with Read/Write register */
189     UINT64                  Mask;               /* Bitmask required for this register instruction */
190 
191 } ACPI_WHEA_HEADER;
192 
193 
194 /*******************************************************************************
195  *
196  * BERT - Boot Error Record Table (ACPI 4.0)
197  *        Version 1
198  *
199  ******************************************************************************/
200 
201 typedef struct acpi_table_bert
202 {
203     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
204     UINT32                  RegionLength;       /* Length of the boot error region */
205     UINT64                  Address;            /* Physical address of the error region */
206 
207 } ACPI_TABLE_BERT;
208 
209 
210 /* Boot Error Region (not a subtable, pointed to by Address field above) */
211 
212 typedef struct acpi_bert_region
213 {
214     UINT32                  BlockStatus;        /* Type of error information */
215     UINT32                  RawDataOffset;      /* Offset to raw error data */
216     UINT32                  RawDataLength;      /* Length of raw error data */
217     UINT32                  DataLength;         /* Length of generic error data */
218     UINT32                  ErrorSeverity;      /* Severity code */
219 
220 } ACPI_BERT_REGION;
221 
222 /* Values for BlockStatus flags above */
223 
224 #define ACPI_BERT_UNCORRECTABLE             (1)
225 #define ACPI_BERT_CORRECTABLE               (1<<1)
226 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (1<<2)
227 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (1<<3)
228 #define ACPI_BERT_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
229 
230 /* Values for ErrorSeverity above */
231 
232 enum AcpiBertErrorSeverity
233 {
234     ACPI_BERT_ERROR_CORRECTABLE     = 0,
235     ACPI_BERT_ERROR_FATAL           = 1,
236     ACPI_BERT_ERROR_CORRECTED       = 2,
237     ACPI_BERT_ERROR_NONE            = 3,
238     ACPI_BERT_ERROR_RESERVED        = 4     /* 4 and greater are reserved */
239 };
240 
241 /*
242  * Note: The generic error data that follows the ErrorSeverity field above
243  * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
244  */
245 
246 
247 /*******************************************************************************
248  *
249  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
250  *        Version 1
251  *
252  ******************************************************************************/
253 
254 typedef struct acpi_table_cpep
255 {
256     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
257     UINT64                  Reserved;
258 
259 } ACPI_TABLE_CPEP;
260 
261 
262 /* Subtable */
263 
264 typedef struct acpi_cpep_polling
265 {
266     ACPI_SUBTABLE_HEADER    Header;
267     UINT8                   Id;                 /* Processor ID */
268     UINT8                   Eid;                /* Processor EID */
269     UINT32                  Interval;           /* Polling interval (msec) */
270 
271 } ACPI_CPEP_POLLING;
272 
273 
274 /*******************************************************************************
275  *
276  * ECDT - Embedded Controller Boot Resources Table
277  *        Version 1
278  *
279  ******************************************************************************/
280 
281 typedef struct acpi_table_ecdt
282 {
283     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
284     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
285     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
286     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
287     UINT8                   Gpe;                /* The GPE for the EC */
288     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
289 
290 } ACPI_TABLE_ECDT;
291 
292 
293 /*******************************************************************************
294  *
295  * EINJ - Error Injection Table (ACPI 4.0)
296  *        Version 1
297  *
298  ******************************************************************************/
299 
300 typedef struct acpi_table_einj
301 {
302     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
303     UINT32                  HeaderLength;
304     UINT8                   Flags;
305     UINT8                   Reserved[3];
306     UINT32                  Entries;
307 
308 } ACPI_TABLE_EINJ;
309 
310 
311 /* EINJ Injection Instruction Entries (actions) */
312 
313 typedef struct acpi_einj_entry
314 {
315     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
316 
317 } ACPI_EINJ_ENTRY;
318 
319 /* Masks for Flags field above */
320 
321 #define ACPI_EINJ_PRESERVE          (1)
322 
323 /* Values for Action field above */
324 
325 enum AcpiEinjActions
326 {
327     ACPI_EINJ_BEGIN_OPERATION               = 0,
328     ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
329     ACPI_EINJ_SET_ERROR_TYPE                = 2,
330     ACPI_EINJ_GET_ERROR_TYPE                = 3,
331     ACPI_EINJ_END_OPERATION                 = 4,
332     ACPI_EINJ_EXECUTE_OPERATION             = 5,
333     ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
334     ACPI_EINJ_GET_COMMAND_STATUS            = 7,
335     ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
336     ACPI_EINJ_ACTION_RESERVED               = 9,     /* 9 and greater are reserved */
337     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
338 };
339 
340 /* Values for Instruction field above */
341 
342 enum AcpiEinjInstructions
343 {
344     ACPI_EINJ_READ_REGISTER         = 0,
345     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
346     ACPI_EINJ_WRITE_REGISTER        = 2,
347     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
348     ACPI_EINJ_NOOP                  = 4,
349     ACPI_EINJ_FLUSH_CACHELINE       = 5,
350     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
351 };
352 
353 typedef struct acpi_einj_error_type_with_addr
354 {
355     UINT32                  ErrorType;
356     UINT32                  VendorStructOffset;
357     UINT32                  Flags;
358     UINT32                  ApicId;
359     UINT64                  Address;
360     UINT64                  Range;
361     UINT32                  PcieId;
362 
363 } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
364 
365 typedef struct acpi_einj_vendor
366 {
367     UINT32                  Length;
368     UINT32                  PcieId;
369     UINT16                  VendorId;
370     UINT16                  DeviceId;
371     UINT8                   RevisionId;
372     UINT8                   Reserved[3];
373 
374 } ACPI_EINJ_VENDOR;
375 
376 
377 /* EINJ Trigger Error Action Table */
378 
379 typedef struct acpi_einj_trigger
380 {
381     UINT32                  HeaderSize;
382     UINT32                  Revision;
383     UINT32                  TableSize;
384     UINT32                  EntryCount;
385 
386 } ACPI_EINJ_TRIGGER;
387 
388 /* Command status return values */
389 
390 enum AcpiEinjCommandStatus
391 {
392     ACPI_EINJ_SUCCESS               = 0,
393     ACPI_EINJ_FAILURE               = 1,
394     ACPI_EINJ_INVALID_ACCESS        = 2,
395     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
396 };
397 
398 
399 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
400 
401 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
402 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
403 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
404 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
405 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
406 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
407 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
408 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
409 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
410 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
411 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
412 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
413 #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
414 
415 
416 /*******************************************************************************
417  *
418  * ERST - Error Record Serialization Table (ACPI 4.0)
419  *        Version 1
420  *
421  ******************************************************************************/
422 
423 typedef struct acpi_table_erst
424 {
425     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
426     UINT32                  HeaderLength;
427     UINT32                  Reserved;
428     UINT32                  Entries;
429 
430 } ACPI_TABLE_ERST;
431 
432 
433 /* ERST Serialization Entries (actions) */
434 
435 typedef struct acpi_erst_entry
436 {
437     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
438 
439 } ACPI_ERST_ENTRY;
440 
441 /* Masks for Flags field above */
442 
443 #define ACPI_ERST_PRESERVE          (1)
444 
445 /* Values for Action field above */
446 
447 enum AcpiErstActions
448 {
449     ACPI_ERST_BEGIN_WRITE           = 0,
450     ACPI_ERST_BEGIN_READ            = 1,
451     ACPI_ERST_BEGIN_CLEAR           = 2,
452     ACPI_ERST_END                   = 3,
453     ACPI_ERST_SET_RECORD_OFFSET     = 4,
454     ACPI_ERST_EXECUTE_OPERATION     = 5,
455     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
456     ACPI_ERST_GET_COMMAND_STATUS    = 7,
457     ACPI_ERST_GET_RECORD_ID         = 8,
458     ACPI_ERST_SET_RECORD_ID         = 9,
459     ACPI_ERST_GET_RECORD_COUNT      = 10,
460     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
461     ACPI_ERST_NOT_USED              = 12,
462     ACPI_ERST_GET_ERROR_RANGE       = 13,
463     ACPI_ERST_GET_ERROR_LENGTH      = 14,
464     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
465     ACPI_ERST_ACTION_RESERVED       = 16    /* 16 and greater are reserved */
466 };
467 
468 /* Values for Instruction field above */
469 
470 enum AcpiErstInstructions
471 {
472     ACPI_ERST_READ_REGISTER         = 0,
473     ACPI_ERST_READ_REGISTER_VALUE   = 1,
474     ACPI_ERST_WRITE_REGISTER        = 2,
475     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
476     ACPI_ERST_NOOP                  = 4,
477     ACPI_ERST_LOAD_VAR1             = 5,
478     ACPI_ERST_LOAD_VAR2             = 6,
479     ACPI_ERST_STORE_VAR1            = 7,
480     ACPI_ERST_ADD                   = 8,
481     ACPI_ERST_SUBTRACT              = 9,
482     ACPI_ERST_ADD_VALUE             = 10,
483     ACPI_ERST_SUBTRACT_VALUE        = 11,
484     ACPI_ERST_STALL                 = 12,
485     ACPI_ERST_STALL_WHILE_TRUE      = 13,
486     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
487     ACPI_ERST_GOTO                  = 15,
488     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
489     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
490     ACPI_ERST_MOVE_DATA             = 18,
491     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
492 };
493 
494 /* Command status return values */
495 
496 enum AcpiErstCommandStatus
497 {
498     ACPI_ERST_SUCESS                = 0,
499     ACPI_ERST_NO_SPACE              = 1,
500     ACPI_ERST_NOT_AVAILABLE         = 2,
501     ACPI_ERST_FAILURE               = 3,
502     ACPI_ERST_RECORD_EMPTY          = 4,
503     ACPI_ERST_NOT_FOUND             = 5,
504     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
505 };
506 
507 
508 /* Error Record Serialization Information */
509 
510 typedef struct acpi_erst_info
511 {
512     UINT16                  Signature;          /* Should be "ER" */
513     UINT8                   Data[48];
514 
515 } ACPI_ERST_INFO;
516 
517 
518 /*******************************************************************************
519  *
520  * HEST - Hardware Error Source Table (ACPI 4.0)
521  *        Version 1
522  *
523  ******************************************************************************/
524 
525 typedef struct acpi_table_hest
526 {
527     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
528     UINT32                  ErrorSourceCount;
529 
530 } ACPI_TABLE_HEST;
531 
532 
533 /* HEST subtable header */
534 
535 typedef struct acpi_hest_header
536 {
537     UINT16                  Type;
538     UINT16                  SourceId;
539 
540 } ACPI_HEST_HEADER;
541 
542 
543 /* Values for Type field above for subtables */
544 
545 enum AcpiHestTypes
546 {
547     ACPI_HEST_TYPE_IA32_CHECK           = 0,
548     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
549     ACPI_HEST_TYPE_IA32_NMI             = 2,
550     ACPI_HEST_TYPE_NOT_USED3            = 3,
551     ACPI_HEST_TYPE_NOT_USED4            = 4,
552     ACPI_HEST_TYPE_NOT_USED5            = 5,
553     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
554     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
555     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
556     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
557     ACPI_HEST_TYPE_RESERVED             = 10    /* 10 and greater are reserved */
558 };
559 
560 
561 /*
562  * HEST substructures contained in subtables
563  */
564 
565 /*
566  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
567  * ACPI_HEST_IA_CORRECTED structures.
568  */
569 typedef struct acpi_hest_ia_error_bank
570 {
571     UINT8                   BankNumber;
572     UINT8                   ClearStatusOnInit;
573     UINT8                   StatusFormat;
574     UINT8                   Reserved;
575     UINT32                  ControlRegister;
576     UINT64                  ControlData;
577     UINT32                  StatusRegister;
578     UINT32                  AddressRegister;
579     UINT32                  MiscRegister;
580 
581 } ACPI_HEST_IA_ERROR_BANK;
582 
583 
584 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
585 
586 typedef struct acpi_hest_aer_common
587 {
588     UINT16                  Reserved1;
589     UINT8                   Flags;
590     UINT8                   Enabled;
591     UINT32                  RecordsToPreallocate;
592     UINT32                  MaxSectionsPerRecord;
593     UINT32                  Bus;
594     UINT16                  Device;
595     UINT16                  Function;
596     UINT16                  DeviceControl;
597     UINT16                  Reserved2;
598     UINT32                  UncorrectableMask;
599     UINT32                  UncorrectableSeverity;
600     UINT32                  CorrectableMask;
601     UINT32                  AdvancedCapabilities;
602 
603 } ACPI_HEST_AER_COMMON;
604 
605 /* Masks for HEST Flags fields */
606 
607 #define ACPI_HEST_FIRMWARE_FIRST        (1)
608 #define ACPI_HEST_GLOBAL                (1<<1)
609 
610 
611 /* Hardware Error Notification */
612 
613 typedef struct acpi_hest_notify
614 {
615     UINT8                   Type;
616     UINT8                   Length;
617     UINT16                  ConfigWriteEnable;
618     UINT32                  PollInterval;
619     UINT32                  Vector;
620     UINT32                  PollingThresholdValue;
621     UINT32                  PollingThresholdWindow;
622     UINT32                  ErrorThresholdValue;
623     UINT32                  ErrorThresholdWindow;
624 
625 } ACPI_HEST_NOTIFY;
626 
627 /* Values for Notify Type field above */
628 
629 enum AcpiHestNotifyTypes
630 {
631     ACPI_HEST_NOTIFY_POLLED     = 0,
632     ACPI_HEST_NOTIFY_EXTERNAL   = 1,
633     ACPI_HEST_NOTIFY_LOCAL      = 2,
634     ACPI_HEST_NOTIFY_SCI        = 3,
635     ACPI_HEST_NOTIFY_NMI        = 4,
636     ACPI_HEST_NOTIFY_RESERVED   = 5     /* 5 and greater are reserved */
637 };
638 
639 /* Values for ConfigWriteEnable bitfield above */
640 
641 #define ACPI_HEST_TYPE                  (1)
642 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
643 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
644 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
645 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
646 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
647 
648 
649 /*
650  * HEST subtables
651  */
652 
653 /* 0: IA32 Machine Check Exception */
654 
655 typedef struct acpi_hest_ia_machine_check
656 {
657     ACPI_HEST_HEADER        Header;
658     UINT16                  Reserved1;
659     UINT8                   Flags;
660     UINT8                   Enabled;
661     UINT32                  RecordsToPreallocate;
662     UINT32                  MaxSectionsPerRecord;
663     UINT64                  GlobalCapabilityData;
664     UINT64                  GlobalControlData;
665     UINT8                   NumHardwareBanks;
666     UINT8                   Reserved3[7];
667 
668 } ACPI_HEST_IA_MACHINE_CHECK;
669 
670 
671 /* 1: IA32 Corrected Machine Check */
672 
673 typedef struct acpi_hest_ia_corrected
674 {
675     ACPI_HEST_HEADER        Header;
676     UINT16                  Reserved1;
677     UINT8                   Flags;
678     UINT8                   Enabled;
679     UINT32                  RecordsToPreallocate;
680     UINT32                  MaxSectionsPerRecord;
681     ACPI_HEST_NOTIFY        Notify;
682     UINT8                   NumHardwareBanks;
683     UINT8                   Reserved2[3];
684 
685 } ACPI_HEST_IA_CORRECTED;
686 
687 
688 /* 2: IA32 Non-Maskable Interrupt */
689 
690 typedef struct acpi_hest_ia_nmi
691 {
692     ACPI_HEST_HEADER        Header;
693     UINT32                  Reserved;
694     UINT32                  RecordsToPreallocate;
695     UINT32                  MaxSectionsPerRecord;
696     UINT32                  MaxRawDataLength;
697 
698 } ACPI_HEST_IA_NMI;
699 
700 
701 /* 3,4,5: Not used */
702 
703 /* 6: PCI Express Root Port AER */
704 
705 typedef struct acpi_hest_aer_root
706 {
707     ACPI_HEST_HEADER        Header;
708     ACPI_HEST_AER_COMMON    Aer;
709     UINT32                  RootErrorCommand;
710 
711 } ACPI_HEST_AER_ROOT;
712 
713 
714 /* 7: PCI Express AER (AER Endpoint) */
715 
716 typedef struct acpi_hest_aer
717 {
718     ACPI_HEST_HEADER        Header;
719     ACPI_HEST_AER_COMMON    Aer;
720 
721 } ACPI_HEST_AER;
722 
723 
724 /* 8: PCI Express/PCI-X Bridge AER */
725 
726 typedef struct acpi_hest_aer_bridge
727 {
728     ACPI_HEST_HEADER        Header;
729     ACPI_HEST_AER_COMMON    Aer;
730     UINT32                  UncorrectableMask2;
731     UINT32                  UncorrectableSeverity2;
732     UINT32                  AdvancedCapabilities2;
733 
734 } ACPI_HEST_AER_BRIDGE;
735 
736 
737 /* 9: Generic Hardware Error Source */
738 
739 typedef struct acpi_hest_generic
740 {
741     ACPI_HEST_HEADER        Header;
742     UINT16                  RelatedSourceId;
743     UINT8                   Reserved;
744     UINT8                   Enabled;
745     UINT32                  RecordsToPreallocate;
746     UINT32                  MaxSectionsPerRecord;
747     UINT32                  MaxRawDataLength;
748     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
749     ACPI_HEST_NOTIFY        Notify;
750     UINT32                  ErrorBlockLength;
751 
752 } ACPI_HEST_GENERIC;
753 
754 
755 /* Generic Error Status block */
756 
757 typedef struct acpi_hest_generic_status
758 {
759     UINT32                  BlockStatus;
760     UINT32                  RawDataOffset;
761     UINT32                  RawDataLength;
762     UINT32                  DataLength;
763     UINT32                  ErrorSeverity;
764 
765 } ACPI_HEST_GENERIC_STATUS;
766 
767 /* Values for BlockStatus flags above */
768 
769 #define ACPI_HEST_UNCORRECTABLE             (1)
770 #define ACPI_HEST_CORRECTABLE               (1<<1)
771 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
772 #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
773 #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
774 
775 
776 /* Generic Error Data entry */
777 
778 typedef struct acpi_hest_generic_data
779 {
780     UINT8                   SectionType[16];
781     UINT32                  ErrorSeverity;
782     UINT16                  Revision;
783     UINT8                   ValidationBits;
784     UINT8                   Flags;
785     UINT32                  ErrorDataLength;
786     UINT8                   FruId[16];
787     UINT8                   FruText[20];
788 
789 } ACPI_HEST_GENERIC_DATA;
790 
791 
792 /*******************************************************************************
793  *
794  * MADT - Multiple APIC Description Table
795  *        Version 3
796  *
797  ******************************************************************************/
798 
799 typedef struct acpi_table_madt
800 {
801     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
802     UINT32                  Address;            /* Physical address of local APIC */
803     UINT32                  Flags;
804 
805 } ACPI_TABLE_MADT;
806 
807 /* Masks for Flags field above */
808 
809 #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
810 
811 /* Values for PCATCompat flag */
812 
813 #define ACPI_MADT_DUAL_PIC          0
814 #define ACPI_MADT_MULTIPLE_APIC     1
815 
816 
817 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
818 
819 enum AcpiMadtType
820 {
821     ACPI_MADT_TYPE_LOCAL_APIC           = 0,
822     ACPI_MADT_TYPE_IO_APIC              = 1,
823     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
824     ACPI_MADT_TYPE_NMI_SOURCE           = 3,
825     ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
826     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
827     ACPI_MADT_TYPE_IO_SAPIC             = 6,
828     ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
829     ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
830     ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
831     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
832     ACPI_MADT_TYPE_GENERIC_INTERRUPT    = 11,
833     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR  = 12,
834     ACPI_MADT_TYPE_RESERVED             = 13    /* 13 and greater are reserved */
835 };
836 
837 
838 /*
839  * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
840  */
841 
842 /* 0: Processor Local APIC */
843 
844 typedef struct acpi_madt_local_apic
845 {
846     ACPI_SUBTABLE_HEADER    Header;
847     UINT8                   ProcessorId;        /* ACPI processor id */
848     UINT8                   Id;                 /* Processor's local APIC id */
849     UINT32                  LapicFlags;
850 
851 } ACPI_MADT_LOCAL_APIC;
852 
853 
854 /* 1: IO APIC */
855 
856 typedef struct acpi_madt_io_apic
857 {
858     ACPI_SUBTABLE_HEADER    Header;
859     UINT8                   Id;                 /* I/O APIC ID */
860     UINT8                   Reserved;           /* Reserved - must be zero */
861     UINT32                  Address;            /* APIC physical address */
862     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
863 
864 } ACPI_MADT_IO_APIC;
865 
866 
867 /* 2: Interrupt Override */
868 
869 typedef struct acpi_madt_interrupt_override
870 {
871     ACPI_SUBTABLE_HEADER    Header;
872     UINT8                   Bus;                /* 0 - ISA */
873     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
874     UINT32                  GlobalIrq;          /* Global system interrupt */
875     UINT16                  IntiFlags;
876 
877 } ACPI_MADT_INTERRUPT_OVERRIDE;
878 
879 
880 /* 3: NMI Source */
881 
882 typedef struct acpi_madt_nmi_source
883 {
884     ACPI_SUBTABLE_HEADER    Header;
885     UINT16                  IntiFlags;
886     UINT32                  GlobalIrq;          /* Global system interrupt */
887 
888 } ACPI_MADT_NMI_SOURCE;
889 
890 
891 /* 4: Local APIC NMI */
892 
893 typedef struct acpi_madt_local_apic_nmi
894 {
895     ACPI_SUBTABLE_HEADER    Header;
896     UINT8                   ProcessorId;        /* ACPI processor id */
897     UINT16                  IntiFlags;
898     UINT8                   Lint;               /* LINTn to which NMI is connected */
899 
900 } ACPI_MADT_LOCAL_APIC_NMI;
901 
902 
903 /* 5: Address Override */
904 
905 typedef struct acpi_madt_local_apic_override
906 {
907     ACPI_SUBTABLE_HEADER    Header;
908     UINT16                  Reserved;           /* Reserved, must be zero */
909     UINT64                  Address;            /* APIC physical address */
910 
911 } ACPI_MADT_LOCAL_APIC_OVERRIDE;
912 
913 
914 /* 6: I/O Sapic */
915 
916 typedef struct acpi_madt_io_sapic
917 {
918     ACPI_SUBTABLE_HEADER    Header;
919     UINT8                   Id;                 /* I/O SAPIC ID */
920     UINT8                   Reserved;           /* Reserved, must be zero */
921     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
922     UINT64                  Address;            /* SAPIC physical address */
923 
924 } ACPI_MADT_IO_SAPIC;
925 
926 
927 /* 7: Local Sapic */
928 
929 typedef struct acpi_madt_local_sapic
930 {
931     ACPI_SUBTABLE_HEADER    Header;
932     UINT8                   ProcessorId;        /* ACPI processor id */
933     UINT8                   Id;                 /* SAPIC ID */
934     UINT8                   Eid;                /* SAPIC EID */
935     UINT8                   Reserved[3];        /* Reserved, must be zero */
936     UINT32                  LapicFlags;
937     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
938     char                    UidString[1];       /* String UID  - ACPI 3.0 */
939 
940 } ACPI_MADT_LOCAL_SAPIC;
941 
942 
943 /* 8: Platform Interrupt Source */
944 
945 typedef struct acpi_madt_interrupt_source
946 {
947     ACPI_SUBTABLE_HEADER    Header;
948     UINT16                  IntiFlags;
949     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
950     UINT8                   Id;                 /* Processor ID */
951     UINT8                   Eid;                /* Processor EID */
952     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
953     UINT32                  GlobalIrq;          /* Global system interrupt */
954     UINT32                  Flags;              /* Interrupt Source Flags */
955 
956 } ACPI_MADT_INTERRUPT_SOURCE;
957 
958 /* Masks for Flags field above */
959 
960 #define ACPI_MADT_CPEI_OVERRIDE     (1)
961 
962 
963 /* 9: Processor Local X2APIC (ACPI 4.0) */
964 
965 typedef struct acpi_madt_local_x2apic
966 {
967     ACPI_SUBTABLE_HEADER    Header;
968     UINT16                  Reserved;           /* Reserved - must be zero */
969     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
970     UINT32                  LapicFlags;
971     UINT32                  Uid;                /* ACPI processor UID */
972 
973 } ACPI_MADT_LOCAL_X2APIC;
974 
975 
976 /* 10: Local X2APIC NMI (ACPI 4.0) */
977 
978 typedef struct acpi_madt_local_x2apic_nmi
979 {
980     ACPI_SUBTABLE_HEADER    Header;
981     UINT16                  IntiFlags;
982     UINT32                  Uid;                /* ACPI processor UID */
983     UINT8                   Lint;               /* LINTn to which NMI is connected */
984     UINT8                   Reserved[3];        /* Reserved - must be zero */
985 
986 } ACPI_MADT_LOCAL_X2APIC_NMI;
987 
988 
989 /* 11: Generic Interrupt (ACPI 5.0) */
990 
991 typedef struct acpi_madt_generic_interrupt
992 {
993     ACPI_SUBTABLE_HEADER    Header;
994     UINT16                  Reserved;           /* Reserved - must be zero */
995     UINT32                  GicId;
996     UINT32                  Uid;
997     UINT32                  Flags;
998     UINT32                  ParkingVersion;
999     UINT32                  PerformanceInterrupt;
1000     UINT64                  ParkedAddress;
1001     UINT64                  BaseAddress;
1002 
1003 } ACPI_MADT_GENERIC_INTERRUPT;
1004 
1005 
1006 /* 12: Generic Distributor (ACPI 5.0) */
1007 
1008 typedef struct acpi_madt_generic_distributor
1009 {
1010     ACPI_SUBTABLE_HEADER    Header;
1011     UINT16                  Reserved;           /* Reserved - must be zero */
1012     UINT32                  GicId;
1013     UINT64                  BaseAddress;
1014     UINT32                  GlobalIrqBase;
1015     UINT32                  Reserved2;          /* Reserved - must be zero */
1016 
1017 } ACPI_MADT_GENERIC_DISTRIBUTOR;
1018 
1019 
1020 /*
1021  * Common flags fields for MADT subtables
1022  */
1023 
1024 /* MADT Local APIC flags (LapicFlags) and GIC flags */
1025 
1026 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
1027 
1028 /* MADT MPS INTI flags (IntiFlags) */
1029 
1030 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
1031 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
1032 
1033 /* Values for MPS INTI flags */
1034 
1035 #define ACPI_MADT_POLARITY_CONFORMS       0
1036 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
1037 #define ACPI_MADT_POLARITY_RESERVED       2
1038 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
1039 
1040 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
1041 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
1042 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
1043 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
1044 
1045 
1046 /*******************************************************************************
1047  *
1048  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1049  *        Version 1
1050  *
1051  ******************************************************************************/
1052 
1053 typedef struct acpi_table_msct
1054 {
1055     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1056     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
1057     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
1058     UINT32                  MaxClockDomains;    /* Max number of clock domains */
1059     UINT64                  MaxAddress;         /* Max physical address in system */
1060 
1061 } ACPI_TABLE_MSCT;
1062 
1063 
1064 /* Subtable - Maximum Proximity Domain Information. Version 1 */
1065 
1066 typedef struct acpi_msct_proximity
1067 {
1068     UINT8                   Revision;
1069     UINT8                   Length;
1070     UINT32                  RangeStart;         /* Start of domain range */
1071     UINT32                  RangeEnd;           /* End of domain range */
1072     UINT32                  ProcessorCapacity;
1073     UINT64                  MemoryCapacity;     /* In bytes */
1074 
1075 } ACPI_MSCT_PROXIMITY;
1076 
1077 
1078 /*******************************************************************************
1079  *
1080  * SBST - Smart Battery Specification Table
1081  *        Version 1
1082  *
1083  ******************************************************************************/
1084 
1085 typedef struct acpi_table_sbst
1086 {
1087     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1088     UINT32                  WarningLevel;
1089     UINT32                  LowLevel;
1090     UINT32                  CriticalLevel;
1091 
1092 } ACPI_TABLE_SBST;
1093 
1094 
1095 /*******************************************************************************
1096  *
1097  * SLIT - System Locality Distance Information Table
1098  *        Version 1
1099  *
1100  ******************************************************************************/
1101 
1102 typedef struct acpi_table_slit
1103 {
1104     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1105     UINT64                  LocalityCount;
1106     UINT8                   Entry[1];           /* Real size = localities^2 */
1107 
1108 } ACPI_TABLE_SLIT;
1109 
1110 
1111 /*******************************************************************************
1112  *
1113  * SRAT - System Resource Affinity Table
1114  *        Version 3
1115  *
1116  ******************************************************************************/
1117 
1118 typedef struct acpi_table_srat
1119 {
1120     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1121     UINT32                  TableRevision;      /* Must be value '1' */
1122     UINT64                  Reserved;           /* Reserved, must be zero */
1123 
1124 } ACPI_TABLE_SRAT;
1125 
1126 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1127 
1128 enum AcpiSratType
1129 {
1130     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1131     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1132     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1133     ACPI_SRAT_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
1134 };
1135 
1136 /*
1137  * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
1138  */
1139 
1140 /* 0: Processor Local APIC/SAPIC Affinity */
1141 
1142 typedef struct acpi_srat_cpu_affinity
1143 {
1144     ACPI_SUBTABLE_HEADER    Header;
1145     UINT8                   ProximityDomainLo;
1146     UINT8                   ApicId;
1147     UINT32                  Flags;
1148     UINT8                   LocalSapicEid;
1149     UINT8                   ProximityDomainHi[3];
1150     UINT32                  Reserved;           /* Reserved, must be zero */
1151 
1152 } ACPI_SRAT_CPU_AFFINITY;
1153 
1154 /* Flags */
1155 
1156 #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
1157 
1158 
1159 /* 1: Memory Affinity */
1160 
1161 typedef struct acpi_srat_mem_affinity
1162 {
1163     ACPI_SUBTABLE_HEADER    Header;
1164     UINT32                  ProximityDomain;
1165     UINT16                  Reserved;           /* Reserved, must be zero */
1166     UINT64                  BaseAddress;
1167     UINT64                  Length;
1168     UINT32                  Reserved1;
1169     UINT32                  Flags;
1170     UINT64                  Reserved2;          /* Reserved, must be zero */
1171 
1172 } ACPI_SRAT_MEM_AFFINITY;
1173 
1174 /* Flags */
1175 
1176 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1177 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1178 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1179 
1180 
1181 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1182 
1183 typedef struct acpi_srat_x2apic_cpu_affinity
1184 {
1185     ACPI_SUBTABLE_HEADER    Header;
1186     UINT16                  Reserved;           /* Reserved, must be zero */
1187     UINT32                  ProximityDomain;
1188     UINT32                  ApicId;
1189     UINT32                  Flags;
1190     UINT32                  ClockDomain;
1191     UINT32                  Reserved2;
1192 
1193 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1194 
1195 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1196 
1197 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1198 
1199 
1200 /* Reset to default packing */
1201 
1202 #pragma pack()
1203 
1204 #endif /* __ACTBL1_H__ */
1205