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