xref: /freebsd/sys/contrib/dev/acpica/include/actbl1.h (revision bb15ca603fa442c72dde3f3cb8b46db6970e3950)
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_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
264     ACPI_EINJ_ACTION_RESERVED               = 9,     /* 9 and greater are reserved */
265     ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
266 };
267 
268 /* Values for Instruction field above */
269 
270 enum AcpiEinjInstructions
271 {
272     ACPI_EINJ_READ_REGISTER         = 0,
273     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
274     ACPI_EINJ_WRITE_REGISTER        = 2,
275     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
276     ACPI_EINJ_NOOP                  = 4,
277     ACPI_EINJ_FLUSH_CACHELINE       = 5,
278     ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
279 };
280 
281 typedef struct acpi_einj_error_type_with_addr
282 {
283     UINT32                  ErrorType;
284     UINT32                  VendorStructOffset;
285     UINT32                  Flags;
286     UINT32                  ApicId;
287     UINT64                  Address;
288     UINT64                  Range;
289     UINT32                  PcieId;
290 
291 } ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
292 
293 typedef struct acpi_einj_vendor
294 {
295     UINT32                  Length;
296     UINT32                  PcieId;
297     UINT16                  VendorId;
298     UINT16                  DeviceId;
299     UINT8                   RevisionId;
300     UINT8                   Reserved[3];
301 
302 } ACPI_EINJ_VENDOR;
303 
304 
305 /* EINJ Trigger Error Action Table */
306 
307 typedef struct acpi_einj_trigger
308 {
309     UINT32                  HeaderSize;
310     UINT32                  Revision;
311     UINT32                  TableSize;
312     UINT32                  EntryCount;
313 
314 } ACPI_EINJ_TRIGGER;
315 
316 /* Command status return values */
317 
318 enum AcpiEinjCommandStatus
319 {
320     ACPI_EINJ_SUCCESS               = 0,
321     ACPI_EINJ_FAILURE               = 1,
322     ACPI_EINJ_INVALID_ACCESS        = 2,
323     ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
324 };
325 
326 
327 /* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
328 
329 #define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
330 #define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
331 #define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
332 #define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
333 #define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
334 #define ACPI_EINJ_MEMORY_FATAL              (1<<5)
335 #define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
336 #define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
337 #define ACPI_EINJ_PCIX_FATAL                (1<<8)
338 #define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
339 #define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
340 #define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
341 #define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
342 
343 
344 /*******************************************************************************
345  *
346  * ERST - Error Record Serialization Table (ACPI 4.0)
347  *        Version 1
348  *
349  ******************************************************************************/
350 
351 typedef struct acpi_table_erst
352 {
353     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
354     UINT32                  HeaderLength;
355     UINT32                  Reserved;
356     UINT32                  Entries;
357 
358 } ACPI_TABLE_ERST;
359 
360 
361 /* ERST Serialization Entries (actions) */
362 
363 typedef struct acpi_erst_entry
364 {
365     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
366 
367 } ACPI_ERST_ENTRY;
368 
369 /* Masks for Flags field above */
370 
371 #define ACPI_ERST_PRESERVE          (1)
372 
373 /* Values for Action field above */
374 
375 enum AcpiErstActions
376 {
377     ACPI_ERST_BEGIN_WRITE           = 0,
378     ACPI_ERST_BEGIN_READ            = 1,
379     ACPI_ERST_BEGIN_CLEAR           = 2,
380     ACPI_ERST_END                   = 3,
381     ACPI_ERST_SET_RECORD_OFFSET     = 4,
382     ACPI_ERST_EXECUTE_OPERATION     = 5,
383     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
384     ACPI_ERST_GET_COMMAND_STATUS    = 7,
385     ACPI_ERST_GET_RECORD_ID         = 8,
386     ACPI_ERST_SET_RECORD_ID         = 9,
387     ACPI_ERST_GET_RECORD_COUNT      = 10,
388     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
389     ACPI_ERST_NOT_USED              = 12,
390     ACPI_ERST_GET_ERROR_RANGE       = 13,
391     ACPI_ERST_GET_ERROR_LENGTH      = 14,
392     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
393     ACPI_ERST_ACTION_RESERVED       = 16    /* 16 and greater are reserved */
394 };
395 
396 /* Values for Instruction field above */
397 
398 enum AcpiErstInstructions
399 {
400     ACPI_ERST_READ_REGISTER         = 0,
401     ACPI_ERST_READ_REGISTER_VALUE   = 1,
402     ACPI_ERST_WRITE_REGISTER        = 2,
403     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
404     ACPI_ERST_NOOP                  = 4,
405     ACPI_ERST_LOAD_VAR1             = 5,
406     ACPI_ERST_LOAD_VAR2             = 6,
407     ACPI_ERST_STORE_VAR1            = 7,
408     ACPI_ERST_ADD                   = 8,
409     ACPI_ERST_SUBTRACT              = 9,
410     ACPI_ERST_ADD_VALUE             = 10,
411     ACPI_ERST_SUBTRACT_VALUE        = 11,
412     ACPI_ERST_STALL                 = 12,
413     ACPI_ERST_STALL_WHILE_TRUE      = 13,
414     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
415     ACPI_ERST_GOTO                  = 15,
416     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
417     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
418     ACPI_ERST_MOVE_DATA             = 18,
419     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
420 };
421 
422 /* Command status return values */
423 
424 enum AcpiErstCommandStatus
425 {
426     ACPI_ERST_SUCESS                = 0,
427     ACPI_ERST_NO_SPACE              = 1,
428     ACPI_ERST_NOT_AVAILABLE         = 2,
429     ACPI_ERST_FAILURE               = 3,
430     ACPI_ERST_RECORD_EMPTY          = 4,
431     ACPI_ERST_NOT_FOUND             = 5,
432     ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
433 };
434 
435 
436 /* Error Record Serialization Information */
437 
438 typedef struct acpi_erst_info
439 {
440     UINT16                  Signature;          /* Should be "ER" */
441     UINT8                   Data[48];
442 
443 } ACPI_ERST_INFO;
444 
445 
446 /*******************************************************************************
447  *
448  * HEST - Hardware Error Source Table (ACPI 4.0)
449  *        Version 1
450  *
451  ******************************************************************************/
452 
453 typedef struct acpi_table_hest
454 {
455     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
456     UINT32                  ErrorSourceCount;
457 
458 } ACPI_TABLE_HEST;
459 
460 
461 /* HEST subtable header */
462 
463 typedef struct acpi_hest_header
464 {
465     UINT16                  Type;
466     UINT16                  SourceId;
467 
468 } ACPI_HEST_HEADER;
469 
470 
471 /* Values for Type field above for subtables */
472 
473 enum AcpiHestTypes
474 {
475     ACPI_HEST_TYPE_IA32_CHECK           = 0,
476     ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
477     ACPI_HEST_TYPE_IA32_NMI             = 2,
478     ACPI_HEST_TYPE_NOT_USED3            = 3,
479     ACPI_HEST_TYPE_NOT_USED4            = 4,
480     ACPI_HEST_TYPE_NOT_USED5            = 5,
481     ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
482     ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
483     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
484     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
485     ACPI_HEST_TYPE_RESERVED             = 10    /* 10 and greater are reserved */
486 };
487 
488 
489 /*
490  * HEST substructures contained in subtables
491  */
492 
493 /*
494  * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
495  * ACPI_HEST_IA_CORRECTED structures.
496  */
497 typedef struct acpi_hest_ia_error_bank
498 {
499     UINT8                   BankNumber;
500     UINT8                   ClearStatusOnInit;
501     UINT8                   StatusFormat;
502     UINT8                   Reserved;
503     UINT32                  ControlRegister;
504     UINT64                  ControlData;
505     UINT32                  StatusRegister;
506     UINT32                  AddressRegister;
507     UINT32                  MiscRegister;
508 
509 } ACPI_HEST_IA_ERROR_BANK;
510 
511 
512 /* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
513 
514 typedef struct acpi_hest_aer_common
515 {
516     UINT16                  Reserved1;
517     UINT8                   Flags;
518     UINT8                   Enabled;
519     UINT32                  RecordsToPreallocate;
520     UINT32                  MaxSectionsPerRecord;
521     UINT32                  Bus;
522     UINT16                  Device;
523     UINT16                  Function;
524     UINT16                  DeviceControl;
525     UINT16                  Reserved2;
526     UINT32                  UncorrectableMask;
527     UINT32                  UncorrectableSeverity;
528     UINT32                  CorrectableMask;
529     UINT32                  AdvancedCapabilities;
530 
531 } ACPI_HEST_AER_COMMON;
532 
533 /* Masks for HEST Flags fields */
534 
535 #define ACPI_HEST_FIRMWARE_FIRST        (1)
536 #define ACPI_HEST_GLOBAL                (1<<1)
537 
538 
539 /* Hardware Error Notification */
540 
541 typedef struct acpi_hest_notify
542 {
543     UINT8                   Type;
544     UINT8                   Length;
545     UINT16                  ConfigWriteEnable;
546     UINT32                  PollInterval;
547     UINT32                  Vector;
548     UINT32                  PollingThresholdValue;
549     UINT32                  PollingThresholdWindow;
550     UINT32                  ErrorThresholdValue;
551     UINT32                  ErrorThresholdWindow;
552 
553 } ACPI_HEST_NOTIFY;
554 
555 /* Values for Notify Type field above */
556 
557 enum AcpiHestNotifyTypes
558 {
559     ACPI_HEST_NOTIFY_POLLED     = 0,
560     ACPI_HEST_NOTIFY_EXTERNAL   = 1,
561     ACPI_HEST_NOTIFY_LOCAL      = 2,
562     ACPI_HEST_NOTIFY_SCI        = 3,
563     ACPI_HEST_NOTIFY_NMI        = 4,
564     ACPI_HEST_NOTIFY_RESERVED   = 5     /* 5 and greater are reserved */
565 };
566 
567 /* Values for ConfigWriteEnable bitfield above */
568 
569 #define ACPI_HEST_TYPE                  (1)
570 #define ACPI_HEST_POLL_INTERVAL         (1<<1)
571 #define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
572 #define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
573 #define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
574 #define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
575 
576 
577 /*
578  * HEST subtables
579  */
580 
581 /* 0: IA32 Machine Check Exception */
582 
583 typedef struct acpi_hest_ia_machine_check
584 {
585     ACPI_HEST_HEADER        Header;
586     UINT16                  Reserved1;
587     UINT8                   Flags;
588     UINT8                   Enabled;
589     UINT32                  RecordsToPreallocate;
590     UINT32                  MaxSectionsPerRecord;
591     UINT64                  GlobalCapabilityData;
592     UINT64                  GlobalControlData;
593     UINT8                   NumHardwareBanks;
594     UINT8                   Reserved3[7];
595 
596 } ACPI_HEST_IA_MACHINE_CHECK;
597 
598 
599 /* 1: IA32 Corrected Machine Check */
600 
601 typedef struct acpi_hest_ia_corrected
602 {
603     ACPI_HEST_HEADER        Header;
604     UINT16                  Reserved1;
605     UINT8                   Flags;
606     UINT8                   Enabled;
607     UINT32                  RecordsToPreallocate;
608     UINT32                  MaxSectionsPerRecord;
609     ACPI_HEST_NOTIFY        Notify;
610     UINT8                   NumHardwareBanks;
611     UINT8                   Reserved2[3];
612 
613 } ACPI_HEST_IA_CORRECTED;
614 
615 
616 /* 2: IA32 Non-Maskable Interrupt */
617 
618 typedef struct acpi_hest_ia_nmi
619 {
620     ACPI_HEST_HEADER        Header;
621     UINT32                  Reserved;
622     UINT32                  RecordsToPreallocate;
623     UINT32                  MaxSectionsPerRecord;
624     UINT32                  MaxRawDataLength;
625 
626 } ACPI_HEST_IA_NMI;
627 
628 
629 /* 3,4,5: Not used */
630 
631 /* 6: PCI Express Root Port AER */
632 
633 typedef struct acpi_hest_aer_root
634 {
635     ACPI_HEST_HEADER        Header;
636     ACPI_HEST_AER_COMMON    Aer;
637     UINT32                  RootErrorCommand;
638 
639 } ACPI_HEST_AER_ROOT;
640 
641 
642 /* 7: PCI Express AER (AER Endpoint) */
643 
644 typedef struct acpi_hest_aer
645 {
646     ACPI_HEST_HEADER        Header;
647     ACPI_HEST_AER_COMMON    Aer;
648 
649 } ACPI_HEST_AER;
650 
651 
652 /* 8: PCI Express/PCI-X Bridge AER */
653 
654 typedef struct acpi_hest_aer_bridge
655 {
656     ACPI_HEST_HEADER        Header;
657     ACPI_HEST_AER_COMMON    Aer;
658     UINT32                  UncorrectableMask2;
659     UINT32                  UncorrectableSeverity2;
660     UINT32                  AdvancedCapabilities2;
661 
662 } ACPI_HEST_AER_BRIDGE;
663 
664 
665 /* 9: Generic Hardware Error Source */
666 
667 typedef struct acpi_hest_generic
668 {
669     ACPI_HEST_HEADER        Header;
670     UINT16                  RelatedSourceId;
671     UINT8                   Reserved;
672     UINT8                   Enabled;
673     UINT32                  RecordsToPreallocate;
674     UINT32                  MaxSectionsPerRecord;
675     UINT32                  MaxRawDataLength;
676     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
677     ACPI_HEST_NOTIFY        Notify;
678     UINT32                  ErrorBlockLength;
679 
680 } ACPI_HEST_GENERIC;
681 
682 
683 /* Generic Error Status block */
684 
685 typedef struct acpi_hest_generic_status
686 {
687     UINT32                  BlockStatus;
688     UINT32                  RawDataOffset;
689     UINT32                  RawDataLength;
690     UINT32                  DataLength;
691     UINT32                  ErrorSeverity;
692 
693 } ACPI_HEST_GENERIC_STATUS;
694 
695 /* Values for BlockStatus flags above */
696 
697 #define ACPI_HEST_UNCORRECTABLE             (1)
698 #define ACPI_HEST_CORRECTABLE               (1<<1)
699 #define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
700 #define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
701 #define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
702 
703 
704 /* Generic Error Data entry */
705 
706 typedef struct acpi_hest_generic_data
707 {
708     UINT8                   SectionType[16];
709     UINT32                  ErrorSeverity;
710     UINT16                  Revision;
711     UINT8                   ValidationBits;
712     UINT8                   Flags;
713     UINT32                  ErrorDataLength;
714     UINT8                   FruId[16];
715     UINT8                   FruText[20];
716 
717 } ACPI_HEST_GENERIC_DATA;
718 
719 
720 /*******************************************************************************
721  *
722  * MADT - Multiple APIC Description Table
723  *        Version 3
724  *
725  ******************************************************************************/
726 
727 typedef struct acpi_table_madt
728 {
729     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
730     UINT32                  Address;            /* Physical address of local APIC */
731     UINT32                  Flags;
732 
733 } ACPI_TABLE_MADT;
734 
735 /* Masks for Flags field above */
736 
737 #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
738 
739 /* Values for PCATCompat flag */
740 
741 #define ACPI_MADT_DUAL_PIC          0
742 #define ACPI_MADT_MULTIPLE_APIC     1
743 
744 
745 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
746 
747 enum AcpiMadtType
748 {
749     ACPI_MADT_TYPE_LOCAL_APIC           = 0,
750     ACPI_MADT_TYPE_IO_APIC              = 1,
751     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
752     ACPI_MADT_TYPE_NMI_SOURCE           = 3,
753     ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
754     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
755     ACPI_MADT_TYPE_IO_SAPIC             = 6,
756     ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
757     ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
758     ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
759     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
760     ACPI_MADT_TYPE_GENERIC_INTERRUPT    = 11,
761     ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR  = 12,
762     ACPI_MADT_TYPE_RESERVED             = 13    /* 13 and greater are reserved */
763 };
764 
765 
766 /*
767  * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
768  */
769 
770 /* 0: Processor Local APIC */
771 
772 typedef struct acpi_madt_local_apic
773 {
774     ACPI_SUBTABLE_HEADER    Header;
775     UINT8                   ProcessorId;        /* ACPI processor id */
776     UINT8                   Id;                 /* Processor's local APIC id */
777     UINT32                  LapicFlags;
778 
779 } ACPI_MADT_LOCAL_APIC;
780 
781 
782 /* 1: IO APIC */
783 
784 typedef struct acpi_madt_io_apic
785 {
786     ACPI_SUBTABLE_HEADER    Header;
787     UINT8                   Id;                 /* I/O APIC ID */
788     UINT8                   Reserved;           /* Reserved - must be zero */
789     UINT32                  Address;            /* APIC physical address */
790     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
791 
792 } ACPI_MADT_IO_APIC;
793 
794 
795 /* 2: Interrupt Override */
796 
797 typedef struct acpi_madt_interrupt_override
798 {
799     ACPI_SUBTABLE_HEADER    Header;
800     UINT8                   Bus;                /* 0 - ISA */
801     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
802     UINT32                  GlobalIrq;          /* Global system interrupt */
803     UINT16                  IntiFlags;
804 
805 } ACPI_MADT_INTERRUPT_OVERRIDE;
806 
807 
808 /* 3: NMI Source */
809 
810 typedef struct acpi_madt_nmi_source
811 {
812     ACPI_SUBTABLE_HEADER    Header;
813     UINT16                  IntiFlags;
814     UINT32                  GlobalIrq;          /* Global system interrupt */
815 
816 } ACPI_MADT_NMI_SOURCE;
817 
818 
819 /* 4: Local APIC NMI */
820 
821 typedef struct acpi_madt_local_apic_nmi
822 {
823     ACPI_SUBTABLE_HEADER    Header;
824     UINT8                   ProcessorId;        /* ACPI processor id */
825     UINT16                  IntiFlags;
826     UINT8                   Lint;               /* LINTn to which NMI is connected */
827 
828 } ACPI_MADT_LOCAL_APIC_NMI;
829 
830 
831 /* 5: Address Override */
832 
833 typedef struct acpi_madt_local_apic_override
834 {
835     ACPI_SUBTABLE_HEADER    Header;
836     UINT16                  Reserved;           /* Reserved, must be zero */
837     UINT64                  Address;            /* APIC physical address */
838 
839 } ACPI_MADT_LOCAL_APIC_OVERRIDE;
840 
841 
842 /* 6: I/O Sapic */
843 
844 typedef struct acpi_madt_io_sapic
845 {
846     ACPI_SUBTABLE_HEADER    Header;
847     UINT8                   Id;                 /* I/O SAPIC ID */
848     UINT8                   Reserved;           /* Reserved, must be zero */
849     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
850     UINT64                  Address;            /* SAPIC physical address */
851 
852 } ACPI_MADT_IO_SAPIC;
853 
854 
855 /* 7: Local Sapic */
856 
857 typedef struct acpi_madt_local_sapic
858 {
859     ACPI_SUBTABLE_HEADER    Header;
860     UINT8                   ProcessorId;        /* ACPI processor id */
861     UINT8                   Id;                 /* SAPIC ID */
862     UINT8                   Eid;                /* SAPIC EID */
863     UINT8                   Reserved[3];        /* Reserved, must be zero */
864     UINT32                  LapicFlags;
865     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
866     char                    UidString[1];       /* String UID  - ACPI 3.0 */
867 
868 } ACPI_MADT_LOCAL_SAPIC;
869 
870 
871 /* 8: Platform Interrupt Source */
872 
873 typedef struct acpi_madt_interrupt_source
874 {
875     ACPI_SUBTABLE_HEADER    Header;
876     UINT16                  IntiFlags;
877     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
878     UINT8                   Id;                 /* Processor ID */
879     UINT8                   Eid;                /* Processor EID */
880     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
881     UINT32                  GlobalIrq;          /* Global system interrupt */
882     UINT32                  Flags;              /* Interrupt Source Flags */
883 
884 } ACPI_MADT_INTERRUPT_SOURCE;
885 
886 /* Masks for Flags field above */
887 
888 #define ACPI_MADT_CPEI_OVERRIDE     (1)
889 
890 
891 /* 9: Processor Local X2APIC (ACPI 4.0) */
892 
893 typedef struct acpi_madt_local_x2apic
894 {
895     ACPI_SUBTABLE_HEADER    Header;
896     UINT16                  Reserved;           /* Reserved - must be zero */
897     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
898     UINT32                  LapicFlags;
899     UINT32                  Uid;                /* ACPI processor UID */
900 
901 } ACPI_MADT_LOCAL_X2APIC;
902 
903 
904 /* 10: Local X2APIC NMI (ACPI 4.0) */
905 
906 typedef struct acpi_madt_local_x2apic_nmi
907 {
908     ACPI_SUBTABLE_HEADER    Header;
909     UINT16                  IntiFlags;
910     UINT32                  Uid;                /* ACPI processor UID */
911     UINT8                   Lint;               /* LINTn to which NMI is connected */
912     UINT8                   Reserved[3];        /* Reserved - must be zero */
913 
914 } ACPI_MADT_LOCAL_X2APIC_NMI;
915 
916 
917 /* 11: Generic Interrupt (ACPI 5.0) */
918 
919 typedef struct acpi_madt_generic_interrupt
920 {
921     ACPI_SUBTABLE_HEADER    Header;
922     UINT16                  Reserved;           /* Reserved - must be zero */
923     UINT32                  GicId;
924     UINT32                  Uid;
925     UINT32                  Flags;
926     UINT32                  ParkingVersion;
927     UINT32                  PerformanceInterrupt;
928     UINT64                  ParkedAddress;
929     UINT64                  BaseAddress;
930 
931 } ACPI_MADT_GENERIC_INTERRUPT;
932 
933 
934 /* 12: Generic Distributor (ACPI 5.0) */
935 
936 typedef struct acpi_madt_generic_distributor
937 {
938     ACPI_SUBTABLE_HEADER    Header;
939     UINT16                  Reserved;           /* Reserved - must be zero */
940     UINT32                  GicId;
941     UINT64                  BaseAddress;
942     UINT32                  GlobalIrqBase;
943     UINT32                  Reserved2;          /* Reserved - must be zero */
944 
945 } ACPI_MADT_GENERIC_DISTRIBUTOR;
946 
947 
948 /*
949  * Common flags fields for MADT subtables
950  */
951 
952 /* MADT Local APIC flags (LapicFlags) and GIC flags */
953 
954 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
955 
956 /* MADT MPS INTI flags (IntiFlags) */
957 
958 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
959 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
960 
961 /* Values for MPS INTI flags */
962 
963 #define ACPI_MADT_POLARITY_CONFORMS       0
964 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
965 #define ACPI_MADT_POLARITY_RESERVED       2
966 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
967 
968 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
969 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
970 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
971 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
972 
973 
974 /*******************************************************************************
975  *
976  * MSCT - Maximum System Characteristics Table (ACPI 4.0)
977  *        Version 1
978  *
979  ******************************************************************************/
980 
981 typedef struct acpi_table_msct
982 {
983     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
984     UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
985     UINT32                  MaxProximityDomains;/* Max number of proximity domains */
986     UINT32                  MaxClockDomains;    /* Max number of clock domains */
987     UINT64                  MaxAddress;         /* Max physical address in system */
988 
989 } ACPI_TABLE_MSCT;
990 
991 
992 /* Subtable - Maximum Proximity Domain Information. Version 1 */
993 
994 typedef struct acpi_msct_proximity
995 {
996     UINT8                   Revision;
997     UINT8                   Length;
998     UINT32                  RangeStart;         /* Start of domain range */
999     UINT32                  RangeEnd;           /* End of domain range */
1000     UINT32                  ProcessorCapacity;
1001     UINT64                  MemoryCapacity;     /* In bytes */
1002 
1003 } ACPI_MSCT_PROXIMITY;
1004 
1005 
1006 /*******************************************************************************
1007  *
1008  * SBST - Smart Battery Specification Table
1009  *        Version 1
1010  *
1011  ******************************************************************************/
1012 
1013 typedef struct acpi_table_sbst
1014 {
1015     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1016     UINT32                  WarningLevel;
1017     UINT32                  LowLevel;
1018     UINT32                  CriticalLevel;
1019 
1020 } ACPI_TABLE_SBST;
1021 
1022 
1023 /*******************************************************************************
1024  *
1025  * SLIT - System Locality Distance Information Table
1026  *        Version 1
1027  *
1028  ******************************************************************************/
1029 
1030 typedef struct acpi_table_slit
1031 {
1032     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1033     UINT64                  LocalityCount;
1034     UINT8                   Entry[1];           /* Real size = localities^2 */
1035 
1036 } ACPI_TABLE_SLIT;
1037 
1038 
1039 /*******************************************************************************
1040  *
1041  * SRAT - System Resource Affinity Table
1042  *        Version 3
1043  *
1044  ******************************************************************************/
1045 
1046 typedef struct acpi_table_srat
1047 {
1048     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1049     UINT32                  TableRevision;      /* Must be value '1' */
1050     UINT64                  Reserved;           /* Reserved, must be zero */
1051 
1052 } ACPI_TABLE_SRAT;
1053 
1054 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1055 
1056 enum AcpiSratType
1057 {
1058     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1059     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1060     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1061     ACPI_SRAT_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
1062 };
1063 
1064 /*
1065  * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
1066  */
1067 
1068 /* 0: Processor Local APIC/SAPIC Affinity */
1069 
1070 typedef struct acpi_srat_cpu_affinity
1071 {
1072     ACPI_SUBTABLE_HEADER    Header;
1073     UINT8                   ProximityDomainLo;
1074     UINT8                   ApicId;
1075     UINT32                  Flags;
1076     UINT8                   LocalSapicEid;
1077     UINT8                   ProximityDomainHi[3];
1078     UINT32                  Reserved;           /* Reserved, must be zero */
1079 
1080 } ACPI_SRAT_CPU_AFFINITY;
1081 
1082 /* Flags */
1083 
1084 #define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
1085 
1086 
1087 /* 1: Memory Affinity */
1088 
1089 typedef struct acpi_srat_mem_affinity
1090 {
1091     ACPI_SUBTABLE_HEADER    Header;
1092     UINT32                  ProximityDomain;
1093     UINT16                  Reserved;           /* Reserved, must be zero */
1094     UINT64                  BaseAddress;
1095     UINT64                  Length;
1096     UINT32                  Reserved1;
1097     UINT32                  Flags;
1098     UINT64                  Reserved2;          /* Reserved, must be zero */
1099 
1100 } ACPI_SRAT_MEM_AFFINITY;
1101 
1102 /* Flags */
1103 
1104 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1105 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1106 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1107 
1108 
1109 /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1110 
1111 typedef struct acpi_srat_x2apic_cpu_affinity
1112 {
1113     ACPI_SUBTABLE_HEADER    Header;
1114     UINT16                  Reserved;           /* Reserved, must be zero */
1115     UINT32                  ProximityDomain;
1116     UINT32                  ApicId;
1117     UINT32                  Flags;
1118     UINT32                  ClockDomain;
1119     UINT32                  Reserved2;
1120 
1121 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1122 
1123 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1124 
1125 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1126 
1127 
1128 /* Reset to default packing */
1129 
1130 #pragma pack()
1131 
1132 #endif /* __ACTBL1_H__ */
1133