xref: /illumos-gate/usr/src/uts/intel/sys/acpi/actbl1.h (revision 10115c80ec7040cb0f5be39c544c4febb00369ee)
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 - 2009, 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
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  ******************************************************************************/
128 
129 
130 /*
131  * Values for description table header signatures. Useful because they make
132  * it more difficult to inadvertently type in the wrong signature.
133  */
134 #define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
135 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
136 #define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
137 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
138 #define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
139 #define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
140 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
141 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
142 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
143 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
144 #define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
145 #define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
146 #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
147 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
148 #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
149 #define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
150 #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
151 #define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
152 #define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
153 #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
154 #define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
155 #define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
156 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
157 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
158 
159 
160 /*
161  * All tables must be byte-packed to match the ACPI specification, since
162  * the tables are provided by the system BIOS.
163  */
164 #pragma pack(1)
165 
166 /*
167  * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
168  * This is the only type that is even remotely portable. Anything else is not
169  * portable, so do not use any other bitfield types.
170  */
171 
172 
173 /* Common Subtable header (used in MADT, SRAT, etc.) */
174 
175 typedef struct acpi_subtable_header
176 {
177     UINT8                   Type;
178     UINT8                   Length;
179 
180 } ACPI_SUBTABLE_HEADER;
181 
182 
183 /* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
184 
185 typedef struct acpi_whea_header
186 {
187     UINT8                   Action;
188     UINT8                   Instruction;
189     UINT8                   Flags;
190     UINT8                   Reserved;
191     ACPI_GENERIC_ADDRESS    RegisterRegion;
192     UINT64                  Value;              /* Value used with Read/Write register */
193     UINT64                  Mask;               /* Bitmask required for this register instruction */
194 
195 } ACPI_WHEA_HEADER;
196 
197 
198 /*******************************************************************************
199  *
200  * ASF - Alert Standard Format table (Signature "ASF!")
201  *
202  * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
203  *
204  ******************************************************************************/
205 
206 typedef struct acpi_table_asf
207 {
208     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
209 
210 } ACPI_TABLE_ASF;
211 
212 
213 /* ASF subtable header */
214 
215 typedef struct acpi_asf_header
216 {
217     UINT8                   Type;
218     UINT8                   Reserved;
219     UINT16                  Length;
220 
221 } ACPI_ASF_HEADER;
222 
223 
224 /* Values for Type field above */
225 
226 enum AcpiAsfType
227 {
228     ACPI_ASF_TYPE_INFO          = 0,
229     ACPI_ASF_TYPE_ALERT         = 1,
230     ACPI_ASF_TYPE_CONTROL       = 2,
231     ACPI_ASF_TYPE_BOOT          = 3,
232     ACPI_ASF_TYPE_ADDRESS       = 4,
233     ACPI_ASF_TYPE_RESERVED      = 5
234 };
235 
236 /*
237  * ASF subtables
238  */
239 
240 /* 0: ASF Information */
241 
242 typedef struct acpi_asf_info
243 {
244     ACPI_ASF_HEADER         Header;
245     UINT8                   MinResetValue;
246     UINT8                   MinPollInterval;
247     UINT16                  SystemId;
248     UINT32                  MfgId;
249     UINT8                   Flags;
250     UINT8                   Reserved2[3];
251 
252 } ACPI_ASF_INFO;
253 
254 /* 1: ASF Alerts */
255 
256 typedef struct acpi_asf_alert
257 {
258     ACPI_ASF_HEADER         Header;
259     UINT8                   AssertMask;
260     UINT8                   DeassertMask;
261     UINT8                   Alerts;
262     UINT8                   DataLength;
263 
264 } ACPI_ASF_ALERT;
265 
266 typedef struct acpi_asf_alert_data
267 {
268     UINT8                   Address;
269     UINT8                   Command;
270     UINT8                   Mask;
271     UINT8                   Value;
272     UINT8                   SensorType;
273     UINT8                   Type;
274     UINT8                   Offset;
275     UINT8                   SourceType;
276     UINT8                   Severity;
277     UINT8                   SensorNumber;
278     UINT8                   Entity;
279     UINT8                   Instance;
280 
281 } ACPI_ASF_ALERT_DATA;
282 
283 /* 2: ASF Remote Control */
284 
285 typedef struct acpi_asf_remote
286 {
287     ACPI_ASF_HEADER         Header;
288     UINT8                   Controls;
289     UINT8                   DataLength;
290     UINT16                  Reserved2;
291 
292 } ACPI_ASF_REMOTE;
293 
294 typedef struct acpi_asf_control_data
295 {
296     UINT8                   Function;
297     UINT8                   Address;
298     UINT8                   Command;
299     UINT8                   Value;
300 
301 } ACPI_ASF_CONTROL_DATA;
302 
303 /* 3: ASF RMCP Boot Options */
304 
305 typedef struct acpi_asf_rmcp
306 {
307     ACPI_ASF_HEADER         Header;
308     UINT8                   Capabilities[7];
309     UINT8                   CompletionCode;
310     UINT32                  EnterpriseId;
311     UINT8                   Command;
312     UINT16                  Parameter;
313     UINT16                  BootOptions;
314     UINT16                  OemParameters;
315 
316 } ACPI_ASF_RMCP;
317 
318 /* 4: ASF Address */
319 
320 typedef struct acpi_asf_address
321 {
322     ACPI_ASF_HEADER         Header;
323     UINT8                   EpromAddress;
324     UINT8                   Devices;
325 
326 } ACPI_ASF_ADDRESS;
327 
328 
329 /*******************************************************************************
330  *
331  * BERT - Boot Error Record Table
332  *
333  ******************************************************************************/
334 
335 typedef struct acpi_table_bert
336 {
337     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
338     UINT32                  RegionLength;       /* Length of the boot error region */
339     UINT64                  Address;            /* Physical addresss of the error region */
340 
341 } ACPI_TABLE_BERT;
342 
343 
344 /* Boot Error Region */
345 
346 typedef struct acpi_bert_region
347 {
348     UINT32                  BlockStatus;
349     UINT32                  RawDataOffset;
350     UINT32                  RawDataLength;
351     UINT32                  DataLength;
352     UINT32                  ErrorSeverity;
353 
354 } ACPI_BERT_REGION;
355 
356 /* BlockStatus Flags */
357 
358 #define ACPI_BERT_UNCORRECTABLE             (1)
359 #define ACPI_BERT_CORRECTABLE               (2)
360 #define ACPI_BERT_MULTIPLE_UNCORRECTABLE    (4)
361 #define ACPI_BERT_MULTIPLE_CORRECTABLE      (8)
362 
363 
364 /*******************************************************************************
365  *
366  * BOOT - Simple Boot Flag Table
367  *
368  ******************************************************************************/
369 
370 typedef struct acpi_table_boot
371 {
372     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
373     UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
374     UINT8                   Reserved[3];
375 
376 } ACPI_TABLE_BOOT;
377 
378 
379 /*******************************************************************************
380  *
381  * CPEP - Corrected Platform Error Polling table
382  *
383  ******************************************************************************/
384 
385 typedef struct acpi_table_cpep
386 {
387     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
388     UINT64                  Reserved;
389 
390 } ACPI_TABLE_CPEP;
391 
392 
393 /* Subtable */
394 
395 typedef struct acpi_cpep_polling
396 {
397     UINT8                   Type;
398     UINT8                   Length;
399     UINT8                   Id;                 /* Processor ID */
400     UINT8                   Eid;                /* Processor EID */
401     UINT32                  Interval;           /* Polling interval (msec) */
402 
403 } ACPI_CPEP_POLLING;
404 
405 
406 /*******************************************************************************
407  *
408  * DBGP - Debug Port table
409  *
410  ******************************************************************************/
411 
412 typedef struct acpi_table_dbgp
413 {
414     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
415     UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
416     UINT8                   Reserved[3];
417     ACPI_GENERIC_ADDRESS    DebugPort;
418 
419 } ACPI_TABLE_DBGP;
420 
421 
422 /*******************************************************************************
423  *
424  * DMAR - DMA Remapping table
425  *        From "Intel Virtualization Technology for Directed I/O", Sept. 2007
426  *
427  ******************************************************************************/
428 
429 typedef struct acpi_table_dmar
430 {
431     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
432     UINT8                   Width;              /* Host Address Width */
433     UINT8                   Flags;
434     UINT8                   Reserved[10];
435 
436 } ACPI_TABLE_DMAR;
437 
438 /* Flags */
439 
440 #define ACPI_DMAR_INTR_REMAP        (1)
441 
442 /* DMAR subtable header */
443 
444 typedef struct acpi_dmar_header
445 {
446     UINT16                  Type;
447     UINT16                  Length;
448 
449 } ACPI_DMAR_HEADER;
450 
451 /* Values for subtable type in ACPI_DMAR_HEADER */
452 
453 enum AcpiDmarType
454 {
455     ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
456     ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
457     ACPI_DMAR_TYPE_ATSR                 = 2,
458     ACPI_DMAR_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
459 };
460 
461 typedef struct acpi_dmar_device_scope
462 {
463     UINT8                   EntryType;
464     UINT8                   Length;
465     UINT16                  Reserved;
466     UINT8                   EnumerationId;
467     UINT8                   Bus;
468 
469 } ACPI_DMAR_DEVICE_SCOPE;
470 
471 /* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
472 
473 enum AcpiDmarScopeType
474 {
475     ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
476     ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
477     ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
478     ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
479     ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
480     ACPI_DMAR_SCOPE_TYPE_RESERVED       = 5     /* 5 and greater are reserved */
481 };
482 
483 typedef struct acpi_dmar_pci_path
484 {
485     UINT8                   Device;
486     UINT8                   Function;
487 
488 } ACPI_DMAR_PCI_PATH;
489 
490 /*
491  * DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
492  */
493 
494 /* 0: Hardware Unit Definition */
495 
496 typedef struct acpi_dmar_hardware_unit
497 {
498     ACPI_DMAR_HEADER        Header;
499     UINT8                   Flags;
500     UINT8                   Reserved;
501     UINT16                  Segment;
502     UINT64                  Address;            /* Register Base Address */
503 
504 } ACPI_DMAR_HARDWARE_UNIT;
505 
506 /* Flags */
507 
508 #define ACPI_DMAR_INCLUDE_ALL       (1)
509 
510 /* 1: Reserved Memory Defininition */
511 
512 typedef struct acpi_dmar_reserved_memory
513 {
514     ACPI_DMAR_HEADER        Header;
515     UINT16                  Reserved;
516     UINT16                  Segment;
517     UINT64                  BaseAddress;        /* 4K aligned base address */
518     UINT64                  EndAddress;         /* 4K aligned limit address */
519 
520 } ACPI_DMAR_RESERVED_MEMORY;
521 
522 /* Flags */
523 
524 #define ACPI_DMAR_ALLOW_ALL         (1)
525 
526 /* 2: Root Port ATS Capability Reporting Structure */
527 
528 typedef struct acpi_dmar_atsr
529 {
530     ACPI_DMAR_HEADER        Header;
531     UINT8                   Flags;
532     UINT8                   Reserved;
533     UINT16                  Segment;
534 
535 } ACPI_DMAR_ATSR;
536 
537 /* Flags */
538 
539 #define ACPI_DMAR_ALL_PORTS         (1)
540 
541 
542 /*******************************************************************************
543  *
544  * ECDT - Embedded Controller Boot Resources Table
545  *
546  ******************************************************************************/
547 
548 typedef struct acpi_table_ecdt
549 {
550     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
551     ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
552     ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
553     UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
554     UINT8                   Gpe;                /* The GPE for the EC */
555     UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
556 
557 } ACPI_TABLE_ECDT;
558 
559 
560 /*******************************************************************************
561  *
562  * EINJ - Error Injection Table
563  *
564  ******************************************************************************/
565 
566 typedef struct acpi_table_einj
567 {
568     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
569     UINT32                  HeaderLength;
570     UINT32                  Reserved;
571     UINT32                  Entries;
572 
573 } ACPI_TABLE_EINJ;
574 
575 /* EINJ Injection Instruction Entries (actions) */
576 
577 typedef struct acpi_einj_entry
578 {
579     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
580 
581 } ACPI_EINJ_ENTRY;
582 
583 /* Values for Action field above */
584 
585 enum AcpiEinjActions
586 {
587     ACPI_EINJ_BEGIN_OPERATION       = 0,
588     ACPI_EINJ_GET_TRIGGER_TABLE     = 1,
589     ACPI_EINJ_SET_ERROR_TYPE        = 2,
590     ACPI_EINJ_GET_ERROR_TYPE        = 3,
591     ACPI_EINJ_END_OPERATION         = 4,
592     ACPI_EINJ_EXECUTE_OPERATION     = 5,
593     ACPI_EINJ_CHECK_BUSY_STATUS     = 6,
594     ACPI_EINJ_GET_COMMAND_STATUS    = 7,
595     ACPI_EINJ_ACTION_RESERVED       = 8,     /* 8 and greater are reserved */
596     ACPI_EINJ_TRIGGER_ERROR         = 0xFF   /* Except for this value */
597 };
598 
599 /* Values for Instruction field above */
600 
601 enum AcpiEinjInstructions
602 {
603     ACPI_EINJ_READ_REGISTER         = 0,
604     ACPI_EINJ_READ_REGISTER_VALUE   = 1,
605     ACPI_EINJ_WRITE_REGISTER        = 2,
606     ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
607     ACPI_EINJ_NOOP                  = 4,
608     ACPI_EINJ_INSTRUCTION_RESERVED  = 5     /* 5 and greater are reserved */
609 };
610 
611 /* EINJ Trigger Error Action Table */
612 
613 typedef struct acpi_einj_trigger
614 {
615     UINT32                  HeaderSize;
616     UINT32                  Revision;
617     UINT32                  TableSize;
618     UINT32                  EntryCount;
619 
620 } ACPI_EINJ_TRIGGER;
621 
622 
623 /*******************************************************************************
624  *
625  * ERST - Error Record Serialization Table
626  *
627  ******************************************************************************/
628 
629 typedef struct acpi_table_erst
630 {
631     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
632     UINT32                  HeaderLength;
633     UINT32                  Reserved;
634     UINT32                  Entries;
635 
636 } ACPI_TABLE_ERST;
637 
638 /* ERST Serialization Entries (actions) */
639 
640 typedef struct acpi_erst_entry
641 {
642     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
643 
644 } ACPI_ERST_ENTRY;
645 
646 /* Values for Action field above */
647 
648 enum AcpiErstActions
649 {
650     ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
651     ACPI_ERST_BEGIN_READ_OPERATION  = 1,
652     ACPI_ERST_BETGIN_CLEAR_OPERATION= 2,
653     ACPI_ERST_END_OPERATION         = 3,
654     ACPI_ERST_SET_RECORD_OFFSET     = 4,
655     ACPI_ERST_EXECUTE_OPERATION     = 5,
656     ACPI_ERST_CHECK_BUSY_STATUS     = 6,
657     ACPI_ERST_GET_COMMAND_STATUS    = 7,
658     ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
659     ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
660     ACPI_ERST_GET_RECORD_COUNT      = 10,
661     ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
662     ACPI_ERST_NOT_USED              = 12,
663     ACPI_ERST_GET_ERROR_RANGE       = 13,
664     ACPI_ERST_GET_ERROR_LENGTH      = 14,
665     ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
666     ACPI_ERST_ACTION_RESERVED       = 16    /* 16 and greater are reserved */
667 };
668 
669 /* Values for Instruction field above */
670 
671 enum AcpiErstInstructions
672 {
673     ACPI_ERST_READ_REGISTER         = 0,
674     ACPI_ERST_READ_REGISTER_VALUE   = 1,
675     ACPI_ERST_WRITE_REGISTER        = 2,
676     ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
677     ACPI_ERST_NOOP                  = 4,
678     ACPI_ERST_LOAD_VAR1             = 5,
679     ACPI_ERST_LOAD_VAR2             = 6,
680     ACPI_ERST_STORE_VAR1            = 7,
681     ACPI_ERST_ADD                   = 8,
682     ACPI_ERST_SUBTRACT              = 9,
683     ACPI_ERST_ADD_VALUE             = 10,
684     ACPI_ERST_SUBTRACT_VALUE        = 11,
685     ACPI_ERST_STALL                 = 12,
686     ACPI_ERST_STALL_WHILE_TRUE      = 13,
687     ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
688     ACPI_ERST_GOTO                  = 15,
689     ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
690     ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
691     ACPI_ERST_MOVE_DATA             = 18,
692     ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
693 };
694 
695 
696 /*******************************************************************************
697  *
698  * HEST - Hardware Error Source Table
699  *
700  ******************************************************************************/
701 
702 typedef struct acpi_table_hest
703 {
704     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
705     UINT32                  ErrorSourceCount;
706 
707 } ACPI_TABLE_HEST;
708 
709 
710 /* HEST subtable header */
711 
712 typedef struct acpi_hest_header
713 {
714     UINT16                  Type;
715 
716 } ACPI_HEST_HEADER;
717 
718 
719 /* Values for Type field above for subtables */
720 
721 enum AcpiHestTypes
722 {
723     ACPI_HEST_TYPE_XPF_MACHINE_CHECK             = 0,
724     ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK   = 1,
725     ACPI_HEST_TYPE_XPF_UNUSED                    = 2,
726     ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT    = 3,
727     ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK   = 4,
728     ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR  = 5,
729     ACPI_HEST_TYPE_AER_ROOT_PORT                 = 6,
730     ACPI_HEST_TYPE_AER_ENDPOINT                  = 7,
731     ACPI_HEST_TYPE_AER_BRIDGE                    = 8,
732     ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9,
733     ACPI_HEST_TYPE_RESERVED                      = 10    /* 10 and greater are reserved */
734 };
735 
736 
737 /*
738  * HEST Sub-subtables
739  */
740 
741 /* XPF Machine Check Error Bank */
742 
743 typedef struct acpi_hest_xpf_error_bank
744 {
745     UINT8                   BankNumber;
746     UINT8                   ClearStatusOnInit;
747     UINT8                   StatusFormat;
748     UINT8                   ConfigWriteEnable;
749     UINT32                  ControlRegister;
750     UINT64                  ControlInitData;
751     UINT32                  StatusRegister;
752     UINT32                  AddressRegister;
753     UINT32                  MiscRegister;
754 
755 } ACPI_HEST_XPF_ERROR_BANK;
756 
757 
758 /* Generic Error Status */
759 
760 typedef struct acpi_hest_generic_status
761 {
762     UINT32                  BlockStatus;
763     UINT32                  RawDataOffset;
764     UINT32                  RawDataLength;
765     UINT32                  DataLength;
766     UINT32                  ErrorSeverity;
767 
768 } ACPI_HEST_GENERIC_STATUS;
769 
770 
771 /* Generic Error Data */
772 
773 typedef struct acpi_hest_generic_data
774 {
775     UINT8                   SectionType[16];
776     UINT32                  ErrorSeverity;
777     UINT16                  Revision;
778     UINT8                   ValidationBits;
779     UINT8                   Flags;
780     UINT32                  ErrorDataLength;
781     UINT8                   FruId[16];
782     UINT8                   FruText[20];
783 
784 } ACPI_HEST_GENERIC_DATA;
785 
786 
787 /* Common HEST structure for PCI/AER types below (6,7,8) */
788 
789 typedef struct acpi_hest_aer_common
790 {
791     UINT16                  SourceId;
792     UINT16                  ConfigWriteEnable;
793     UINT8                   Flags;
794     UINT8                   Enabled;
795     UINT32                  RecordsToPreAllocate;
796     UINT32                  MaxSectionsPerRecord;
797     UINT32                  Bus;
798     UINT16                  Device;
799     UINT16                  Function;
800     UINT16                  DeviceControl;
801     UINT16                  Reserved;
802     UINT32                  UncorrectableErrorMask;
803     UINT32                  UncorrectableErrorSeverity;
804     UINT32                  CorrectableErrorMask;
805     UINT32                  AdvancedErrorCapabilities;
806 
807 } ACPI_HEST_AER_COMMON;
808 
809 
810 /* Hardware Error Notification */
811 
812 typedef struct acpi_hest_notify
813 {
814     UINT8                   Type;
815     UINT8                   Length;
816     UINT16                  ConfigWriteEnable;
817     UINT32                  PollInterval;
818     UINT32                  Vector;
819     UINT32                  PollingThresholdValue;
820     UINT32                  PollingThresholdWindow;
821     UINT32                  ErrorThresholdValue;
822     UINT32                  ErrorThresholdWindow;
823 
824 } ACPI_HEST_NOTIFY;
825 
826 /* Values for Notify Type field above */
827 
828 enum AcpiHestNotifyTypes
829 {
830     ACPI_HEST_NOTIFY_POLLED     = 0,
831     ACPI_HEST_NOTIFY_EXTERNAL   = 1,
832     ACPI_HEST_NOTIFY_LOCAL      = 2,
833     ACPI_HEST_NOTIFY_SCI        = 3,
834     ACPI_HEST_NOTIFY_NMI        = 4,
835     ACPI_HEST_NOTIFY_RESERVED   = 5     /* 5 and greater are reserved */
836 };
837 
838 
839 /*
840  * HEST subtables
841  *
842  * From WHEA Design Document, 16 May 2007.
843  * Note: There is no subtable type 2 in this version of the document,
844  * and there are two different subtable type 3s.
845  */
846 
847  /* 0: XPF Machine Check Exception */
848 
849 typedef struct acpi_hest_xpf_machine_check
850 {
851     ACPI_HEST_HEADER        Header;
852     UINT16                  SourceId;
853     UINT16                  ConfigWriteEnable;
854     UINT8                   Flags;
855     UINT8                   Reserved1;
856     UINT32                  RecordsToPreAllocate;
857     UINT32                  MaxSectionsPerRecord;
858     UINT64                  GlobalCapabilityData;
859     UINT64                  GlobalControlData;
860     UINT8                   NumHardwareBanks;
861     UINT8                   Reserved2[7];
862 
863 } ACPI_HEST_XPF_MACHINE_CHECK;
864 
865 
866 /* 1: XPF Corrected Machine Check */
867 
868 typedef struct acpi_table_hest_xpf_corrected
869 {
870     ACPI_HEST_HEADER        Header;
871     UINT16                  SourceId;
872     UINT16                  ConfigWriteEnable;
873     UINT8                   Flags;
874     UINT8                   Enabled;
875     UINT32                  RecordsToPreAllocate;
876     UINT32                  MaxSectionsPerRecord;
877     ACPI_HEST_NOTIFY        Notify;
878     UINT8                   NumHardwareBanks;
879     UINT8                   Reserved[3];
880 
881 } ACPI_HEST_XPF_CORRECTED;
882 
883 
884 /* 3: XPF Non-Maskable Interrupt */
885 
886 typedef struct acpi_hest_xpf_nmi
887 {
888     ACPI_HEST_HEADER        Header;
889     UINT16                  SourceId;
890     UINT32                  Reserved;
891     UINT32                  RecordsToPreAllocate;
892     UINT32                  MaxSectionsPerRecord;
893     UINT32                  MaxRawDataLength;
894 
895 } ACPI_HEST_XPF_NMI;
896 
897 
898 /* 4: IPF Corrected Machine Check */
899 
900 typedef struct acpi_hest_ipf_corrected
901 {
902     ACPI_HEST_HEADER        Header;
903     UINT8                   Enabled;
904     UINT8                   Reserved;
905 
906 } ACPI_HEST_IPF_CORRECTED;
907 
908 
909 /* 5: IPF Corrected Platform Error */
910 
911 typedef struct acpi_hest_ipf_corrected_platform
912 {
913     ACPI_HEST_HEADER        Header;
914     UINT8                   Enabled;
915     UINT8                   Reserved;
916 
917 } ACPI_HEST_IPF_CORRECTED_PLATFORM;
918 
919 
920 /* 6: PCI Express Root Port AER */
921 
922 typedef struct acpi_hest_aer_root
923 {
924     ACPI_HEST_HEADER        Header;
925     ACPI_HEST_AER_COMMON    Aer;
926     UINT32                  RootErrorCommand;
927 
928 } ACPI_HEST_AER_ROOT;
929 
930 
931 /* 7: PCI Express AER (AER Endpoint) */
932 
933 typedef struct acpi_hest_aer
934 {
935     ACPI_HEST_HEADER        Header;
936     ACPI_HEST_AER_COMMON    Aer;
937 
938 } ACPI_HEST_AER;
939 
940 
941 /* 8: PCI Express/PCI-X Bridge AER */
942 
943 typedef struct acpi_hest_aer_bridge
944 {
945     ACPI_HEST_HEADER        Header;
946     ACPI_HEST_AER_COMMON    Aer;
947     UINT32                  SecondaryUncorrectableErrorMask;
948     UINT32                  SecondaryUncorrectableErrorSeverity;
949     UINT32                  SecondaryAdvancedCapabilities;
950 
951 } ACPI_HEST_AER_BRIDGE;
952 
953 
954 /* 9: Generic Hardware Error Source */
955 
956 typedef struct acpi_hest_generic
957 {
958     ACPI_HEST_HEADER        Header;
959     UINT16                  SourceId;
960     UINT16                  RelatedSourceId;
961     UINT8                   ConfigWriteEnable;
962     UINT8                   Enabled;
963     UINT32                  RecordsToPreAllocate;
964     UINT32                  MaxSectionsPerRecord;
965     UINT32                  MaxRawDataLength;
966     ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
967     ACPI_HEST_NOTIFY        Notify;
968     UINT32                  ErrorStatusBlockLength;
969 
970 } ACPI_HEST_GENERIC;
971 
972 
973 /*******************************************************************************
974  *
975  * HPET - High Precision Event Timer table
976  *
977  ******************************************************************************/
978 
979 typedef struct acpi_table_hpet
980 {
981     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
982     UINT32                  Id;                 /* Hardware ID of event timer block */
983     ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
984     UINT8                   Sequence;           /* HPET sequence number */
985     UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
986     UINT8                   Flags;
987 
988 } ACPI_TABLE_HPET;
989 
990 /*! Flags */
991 
992 #define ACPI_HPET_PAGE_PROTECT      (1)         /* 00: No page protection */
993 #define ACPI_HPET_PAGE_PROTECT_4    (1<<1)      /* 01: 4KB page protected */
994 #define ACPI_HPET_PAGE_PROTECT_64   (1<<2)      /* 02: 64KB page protected */
995 
996 /*! [End] no source code translation !*/
997 
998 
999 /*******************************************************************************
1000  *
1001  * IBFT - Boot Firmware Table
1002  *
1003  ******************************************************************************/
1004 
1005 typedef struct acpi_table_ibft
1006 {
1007     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1008     UINT8                   Reserved[12];
1009 
1010 } ACPI_TABLE_IBFT;
1011 
1012 
1013 /* IBFT common subtable header */
1014 
1015 typedef struct acpi_ibft_header
1016 {
1017     UINT8                   Type;
1018     UINT8                   Version;
1019     UINT16                  Length;
1020     UINT8                   Index;
1021     UINT8                   Flags;
1022 
1023 } ACPI_IBFT_HEADER;
1024 
1025 
1026 /* Values for Type field above */
1027 
1028 enum AcpiIbftType
1029 {
1030     ACPI_IBFT_TYPE_NOT_USED         = 0,
1031     ACPI_IBFT_TYPE_CONTROL          = 1,
1032     ACPI_IBFT_TYPE_INITIATOR        = 2,
1033     ACPI_IBFT_TYPE_NIC              = 3,
1034     ACPI_IBFT_TYPE_TARGET           = 4,
1035     ACPI_IBFT_TYPE_EXTENSIONS       = 5,
1036     ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
1037 };
1038 
1039 
1040 /* IBFT subtables */
1041 
1042 typedef struct acpi_ibft_control
1043 {
1044     ACPI_IBFT_HEADER        Header;
1045     UINT16                  Extensions;
1046     UINT16                  InitiatorOffset;
1047     UINT16                  Nic0Offset;
1048     UINT16                  Target0Offset;
1049     UINT16                  Nic1Offset;
1050     UINT16                  Target1Offset;
1051 
1052 } ACPI_IBFT_CONTROL;
1053 
1054 typedef struct acpi_ibft_initiator
1055 {
1056     ACPI_IBFT_HEADER        Header;
1057     UINT8                   SnsServer[16];
1058     UINT8                   SlpServer[16];
1059     UINT8                   PrimaryServer[16];
1060     UINT8                   SecondaryServer[16];
1061     UINT16                  NameLength;
1062     UINT16                  NameOffset;
1063 
1064 } ACPI_IBFT_INITIATOR;
1065 
1066 typedef struct acpi_ibft_nic
1067 {
1068     ACPI_IBFT_HEADER        Header;
1069     UINT8                   IpAddress[16];
1070     UINT8                   SubnetMaskPrefix;
1071     UINT8                   Origin;
1072     UINT8                   Gateway[16];
1073     UINT8                   PrimaryDns[16];
1074     UINT8                   SecondaryDns[16];
1075     UINT8                   Dhcp[16];
1076     UINT16                  Vlan;
1077     UINT8                   MacAddress[6];
1078     UINT16                  PciAddress;
1079     UINT16                  NameLength;
1080     UINT16                  NameOffset;
1081 
1082 } ACPI_IBFT_NIC;
1083 
1084 typedef struct acpi_ibft_target
1085 {
1086     ACPI_IBFT_HEADER        Header;
1087     UINT8                   TargetIpAddress[16];
1088     UINT16                  TargetIpSocket;
1089     UINT8                   TargetBootLun[8];
1090     UINT8                   ChapType;
1091     UINT8                   NicAssociation;
1092     UINT16                  TargetNameLength;
1093     UINT16                  TargetNameOffset;
1094     UINT16                  ChapNameLength;
1095     UINT16                  ChapNameOffset;
1096     UINT16                  ChapSecretLength;
1097     UINT16                  ChapSecretOffset;
1098     UINT16                  ReverseChapNameLength;
1099     UINT16                  ReverseChapNameOffset;
1100     UINT16                  ReverseChapSecretLength;
1101     UINT16                  ReverseChapSecretOffset;
1102 
1103 } ACPI_IBFT_TARGET;
1104 
1105 
1106 /*******************************************************************************
1107  *
1108  * MADT - Multiple APIC Description Table
1109  *
1110  ******************************************************************************/
1111 
1112 typedef struct acpi_table_madt
1113 {
1114     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1115     UINT32                  Address;            /* Physical address of local APIC */
1116     UINT32                  Flags;
1117 
1118 } ACPI_TABLE_MADT;
1119 
1120 /* Flags */
1121 
1122 #define ACPI_MADT_PCAT_COMPAT       (1)         /* 00:    System also has dual 8259s */
1123 
1124 /* Values for PCATCompat flag */
1125 
1126 #define ACPI_MADT_DUAL_PIC          0
1127 #define ACPI_MADT_MULTIPLE_APIC     1
1128 
1129 
1130 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1131 
1132 enum AcpiMadtType
1133 {
1134     ACPI_MADT_TYPE_LOCAL_APIC           = 0,
1135     ACPI_MADT_TYPE_IO_APIC              = 1,
1136     ACPI_MADT_TYPE_INTERRUPT_OVERRIDE   = 2,
1137     ACPI_MADT_TYPE_NMI_SOURCE           = 3,
1138     ACPI_MADT_TYPE_LOCAL_APIC_NMI       = 4,
1139     ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE  = 5,
1140     ACPI_MADT_TYPE_IO_SAPIC             = 6,
1141     ACPI_MADT_TYPE_LOCAL_SAPIC          = 7,
1142     ACPI_MADT_TYPE_INTERRUPT_SOURCE     = 8,
1143     ACPI_MADT_TYPE_LOCAL_X2APIC         = 9,
1144     ACPI_MADT_TYPE_LOCAL_X2APIC_NMI     = 10,
1145     ACPI_MADT_TYPE_RESERVED             = 11    /* 11 and greater are reserved */
1146 };
1147 
1148 
1149 /*
1150  * MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
1151  */
1152 
1153 /* 0: Processor Local APIC */
1154 
1155 typedef struct acpi_madt_local_apic
1156 {
1157     ACPI_SUBTABLE_HEADER    Header;
1158     UINT8                   ProcessorId;        /* ACPI processor id */
1159     UINT8                   Id;                 /* Processor's local APIC id */
1160     UINT32                  LapicFlags;
1161 
1162 } ACPI_MADT_LOCAL_APIC;
1163 
1164 /* 1: IO APIC */
1165 
1166 typedef struct acpi_madt_io_apic
1167 {
1168     ACPI_SUBTABLE_HEADER    Header;
1169     UINT8                   Id;                 /* I/O APIC ID */
1170     UINT8                   Reserved;           /* Reserved - must be zero */
1171     UINT32                  Address;            /* APIC physical address */
1172     UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
1173 
1174 } ACPI_MADT_IO_APIC;
1175 
1176 /* 2: Interrupt Override */
1177 
1178 typedef struct acpi_madt_interrupt_override
1179 {
1180     ACPI_SUBTABLE_HEADER    Header;
1181     UINT8                   Bus;                /* 0 - ISA */
1182     UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
1183     UINT32                  GlobalIrq;          /* Global system interrupt */
1184     UINT16                  IntiFlags;
1185 
1186 } ACPI_MADT_INTERRUPT_OVERRIDE;
1187 
1188 /* 3: NMI Source */
1189 
1190 typedef struct acpi_madt_nmi_source
1191 {
1192     ACPI_SUBTABLE_HEADER    Header;
1193     UINT16                  IntiFlags;
1194     UINT32                  GlobalIrq;          /* Global system interrupt */
1195 
1196 } ACPI_MADT_NMI_SOURCE;
1197 
1198 /* 4: Local APIC NMI */
1199 
1200 typedef struct acpi_madt_local_apic_nmi
1201 {
1202     ACPI_SUBTABLE_HEADER    Header;
1203     UINT8                   ProcessorId;        /* ACPI processor id */
1204     UINT16                  IntiFlags;
1205     UINT8                   Lint;               /* LINTn to which NMI is connected */
1206 
1207 } ACPI_MADT_LOCAL_APIC_NMI;
1208 
1209 /* 5: Address Override */
1210 
1211 typedef struct acpi_madt_local_apic_override
1212 {
1213     ACPI_SUBTABLE_HEADER    Header;
1214     UINT16                  Reserved;           /* Reserved, must be zero */
1215     UINT64                  Address;            /* APIC physical address */
1216 
1217 } ACPI_MADT_LOCAL_APIC_OVERRIDE;
1218 
1219 /* 6: I/O Sapic */
1220 
1221 typedef struct acpi_madt_io_sapic
1222 {
1223     ACPI_SUBTABLE_HEADER    Header;
1224     UINT8                   Id;                 /* I/O SAPIC ID */
1225     UINT8                   Reserved;           /* Reserved, must be zero */
1226     UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
1227     UINT64                  Address;            /* SAPIC physical address */
1228 
1229 } ACPI_MADT_IO_SAPIC;
1230 
1231 /* 7: Local Sapic */
1232 
1233 typedef struct acpi_madt_local_sapic
1234 {
1235     ACPI_SUBTABLE_HEADER    Header;
1236     UINT8                   ProcessorId;        /* ACPI processor id */
1237     UINT8                   Id;                 /* SAPIC ID */
1238     UINT8                   Eid;                /* SAPIC EID */
1239     UINT8                   Reserved[3];        /* Reserved, must be zero */
1240     UINT32                  LapicFlags;
1241     UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
1242     char                    UidString[1];       /* String UID  - ACPI 3.0 */
1243 
1244 } ACPI_MADT_LOCAL_SAPIC;
1245 
1246 /* 8: Platform Interrupt Source */
1247 
1248 typedef struct acpi_madt_interrupt_source
1249 {
1250     ACPI_SUBTABLE_HEADER    Header;
1251     UINT16                  IntiFlags;
1252     UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
1253     UINT8                   Id;                 /* Processor ID */
1254     UINT8                   Eid;                /* Processor EID */
1255     UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
1256     UINT32                  GlobalIrq;          /* Global system interrupt */
1257     UINT32                  Flags;              /* Interrupt Source Flags */
1258 
1259 } ACPI_MADT_INTERRUPT_SOURCE;
1260 
1261 /* Flags field above */
1262 
1263 #define ACPI_MADT_CPEI_OVERRIDE     (1)
1264 
1265 /* 9: Processor Local X2APIC (07/2008) */
1266 
1267 typedef struct acpi_madt_local_x2apic
1268 {
1269     ACPI_SUBTABLE_HEADER    Header;
1270     UINT16                  Reserved;           /* Reserved - must be zero */
1271     UINT32                  LocalApicId;        /* Processor x2APIC ID  */
1272     UINT32                  LapicFlags;
1273     UINT32                  Uid;                /* ACPI processor UID */
1274 
1275 } ACPI_MADT_LOCAL_X2APIC;
1276 
1277 /* 10: Local X2APIC NMI (07/2008) */
1278 
1279 typedef struct acpi_madt_local_x2apic_nmi
1280 {
1281     ACPI_SUBTABLE_HEADER    Header;
1282     UINT16                  IntiFlags;
1283     UINT32                  Uid;                /* ACPI processor UID */
1284     UINT8                   Lint;               /* LINTn to which NMI is connected */
1285     UINT8                   Reserved[3];        /* Reserved - must be zero */
1286 
1287 } ACPI_MADT_LOCAL_X2APIC_NMI;
1288 
1289 
1290 /*
1291  * Common flags fields for MADT subtables
1292  */
1293 
1294 /* MADT Local APIC flags (LapicFlags) */
1295 
1296 #define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
1297 
1298 /* MADT MPS INTI flags (IntiFlags) */
1299 
1300 #define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
1301 #define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
1302 
1303 /* Values for MPS INTI flags */
1304 
1305 #define ACPI_MADT_POLARITY_CONFORMS       0
1306 #define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
1307 #define ACPI_MADT_POLARITY_RESERVED       2
1308 #define ACPI_MADT_POLARITY_ACTIVE_LOW     3
1309 
1310 #define ACPI_MADT_TRIGGER_CONFORMS        (0)
1311 #define ACPI_MADT_TRIGGER_EDGE            (1<<2)
1312 #define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
1313 #define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
1314 
1315 
1316 /*******************************************************************************
1317  *
1318  * MCFG - PCI Memory Mapped Configuration table and sub-table
1319  *
1320  ******************************************************************************/
1321 
1322 typedef struct acpi_table_mcfg
1323 {
1324     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1325     UINT8                   Reserved[8];
1326 
1327 } ACPI_TABLE_MCFG;
1328 
1329 
1330 /* Subtable */
1331 
1332 typedef struct acpi_mcfg_allocation
1333 {
1334     UINT64                  Address;            /* Base address, processor-relative */
1335     UINT16                  PciSegment;         /* PCI segment group number */
1336     UINT8                   StartBusNumber;     /* Starting PCI Bus number */
1337     UINT8                   EndBusNumber;       /* Final PCI Bus number */
1338     UINT32                  Reserved;
1339 
1340 } ACPI_MCFG_ALLOCATION;
1341 
1342 
1343 /*******************************************************************************
1344  *
1345  * SBST - Smart Battery Specification Table
1346  *
1347  ******************************************************************************/
1348 
1349 typedef struct acpi_table_sbst
1350 {
1351     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1352     UINT32                  WarningLevel;
1353     UINT32                  LowLevel;
1354     UINT32                  CriticalLevel;
1355 
1356 } ACPI_TABLE_SBST;
1357 
1358 
1359 /*******************************************************************************
1360  *
1361  * SLIT - System Locality Distance Information Table
1362  *
1363  ******************************************************************************/
1364 
1365 typedef struct acpi_table_slit
1366 {
1367     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1368     UINT64                  LocalityCount;
1369     UINT8                   Entry[1];           /* Real size = localities^2 */
1370 
1371 } ACPI_TABLE_SLIT;
1372 
1373 
1374 /*******************************************************************************
1375  *
1376  * SPCR - Serial Port Console Redirection table
1377  *
1378  ******************************************************************************/
1379 
1380 typedef struct acpi_table_spcr
1381 {
1382     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1383     UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
1384     UINT8                   Reserved[3];
1385     ACPI_GENERIC_ADDRESS    SerialPort;
1386     UINT8                   InterruptType;
1387     UINT8                   PcInterrupt;
1388     UINT32                  Interrupt;
1389     UINT8                   BaudRate;
1390     UINT8                   Parity;
1391     UINT8                   StopBits;
1392     UINT8                   FlowControl;
1393     UINT8                   TerminalType;
1394     UINT8                   Reserved1;
1395     UINT16                  PciDeviceId;
1396     UINT16                  PciVendorId;
1397     UINT8                   PciBus;
1398     UINT8                   PciDevice;
1399     UINT8                   PciFunction;
1400     UINT32                  PciFlags;
1401     UINT8                   PciSegment;
1402     UINT32                  Reserved2;
1403 
1404 } ACPI_TABLE_SPCR;
1405 
1406 
1407 /*******************************************************************************
1408  *
1409  * SPMI - Server Platform Management Interface table
1410  *
1411  ******************************************************************************/
1412 
1413 typedef struct acpi_table_spmi
1414 {
1415     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1416     UINT8                   Reserved;
1417     UINT8                   InterfaceType;
1418     UINT16                  SpecRevision;       /* Version of IPMI */
1419     UINT8                   InterruptType;
1420     UINT8                   GpeNumber;          /* GPE assigned */
1421     UINT8                   Reserved1;
1422     UINT8                   PciDeviceFlag;
1423     UINT32                  Interrupt;
1424     ACPI_GENERIC_ADDRESS    IpmiRegister;
1425     UINT8                   PciSegment;
1426     UINT8                   PciBus;
1427     UINT8                   PciDevice;
1428     UINT8                   PciFunction;
1429 
1430 } ACPI_TABLE_SPMI;
1431 
1432 
1433 /*******************************************************************************
1434  *
1435  * SRAT - System Resource Affinity Table
1436  *
1437  ******************************************************************************/
1438 
1439 typedef struct acpi_table_srat
1440 {
1441     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1442     UINT32                  TableRevision;      /* Must be value '1' */
1443     UINT64                  Reserved;           /* Reserved, must be zero */
1444 
1445 } ACPI_TABLE_SRAT;
1446 
1447 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
1448 
1449 enum AcpiSratType
1450 {
1451     ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
1452     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
1453     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
1454     ACPI_SRAT_TYPE_RESERVED             = 3     /* 3 and greater are reserved */
1455 };
1456 
1457 /*
1458  * SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
1459  */
1460 
1461 /* 0: Processor Local APIC/SAPIC Affinity */
1462 
1463 typedef struct acpi_srat_cpu_affinity
1464 {
1465     ACPI_SUBTABLE_HEADER    Header;
1466     UINT8                   ProximityDomainLo;
1467     UINT8                   ApicId;
1468     UINT32                  Flags;
1469     UINT8                   LocalSapicEid;
1470     UINT8                   ProximityDomainHi[3];
1471     UINT32                  Reserved;           /* Reserved, must be zero */
1472 
1473 } ACPI_SRAT_CPU_AFFINITY;
1474 
1475 /* 1: Memory Affinity */
1476 
1477 typedef struct acpi_srat_mem_affinity
1478 {
1479     ACPI_SUBTABLE_HEADER    Header;
1480     UINT32                  ProximityDomain;
1481     UINT16                  Reserved;           /* Reserved, must be zero */
1482     UINT64                  BaseAddress;
1483     UINT64                  Length;
1484     UINT32                  Reserved1;
1485     UINT32                  Flags;
1486     UINT64                  Reserved2;          /* Reserved, must be zero */
1487 
1488 } ACPI_SRAT_MEM_AFFINITY;
1489 
1490 /* Flags */
1491 
1492 #define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
1493 #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
1494 #define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
1495 
1496 /* 2: Processor Local X2_APIC Affinity (07/2008) */
1497 
1498 typedef struct acpi_srat_x2apic_cpu_affinity
1499 {
1500     ACPI_SUBTABLE_HEADER    Header;
1501     UINT16                  Reserved;           /* Reserved, must be zero */
1502     UINT32                  ProximityDomain;
1503     UINT32                  ApicId;
1504     UINT32                  Flags;
1505 
1506 } ACPI_SRAT_X2APIC_CPU_AFFINITY;
1507 
1508 /* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1509 
1510 #define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
1511 
1512 
1513 /*******************************************************************************
1514  *
1515  * TCPA - Trusted Computing Platform Alliance table
1516  *
1517  ******************************************************************************/
1518 
1519 typedef struct acpi_table_tcpa
1520 {
1521     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1522     UINT16                  Reserved;
1523     UINT32                  MaxLogLength;       /* Maximum length for the event log area */
1524     UINT64                  LogAddress;         /* Address of the event log area */
1525 
1526 } ACPI_TABLE_TCPA;
1527 
1528 
1529 /*******************************************************************************
1530  *
1531  * UEFI - UEFI Boot optimization Table
1532  *
1533  ******************************************************************************/
1534 
1535 typedef struct acpi_table_uefi
1536 {
1537     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1538     UINT8                   Identifier[16];     /* UUID identifier */
1539     UINT16                  DataOffset;         /* Offset of remaining data in table */
1540     UINT8                   Data;
1541 
1542 } ACPI_TABLE_UEFI;
1543 
1544 
1545 /*******************************************************************************
1546  *
1547  * WDAT - Watchdog Action Table
1548  *
1549  ******************************************************************************/
1550 
1551 typedef struct acpi_table_wdat
1552 {
1553     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1554     UINT32                  HeaderLength;       /* Watchdog Header Length */
1555     UINT16                  PciSegment;         /* PCI Segment number */
1556     UINT8                   PciBus;             /* PCI Bus number */
1557     UINT8                   PciDevice;          /* PCI Device number */
1558     UINT8                   PciFunction;        /* PCI Function number */
1559     UINT8                   Reserved[3];
1560     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1561     UINT32                  MaxCount;           /* Maximum counter value supported */
1562     UINT32                  MinCount;           /* Minimum counter value */
1563     UINT8                   Flags;
1564     UINT8                   Reserved2[3];
1565     UINT32                  Entries;            /* Number of watchdog entries that follow */
1566 
1567 } ACPI_TABLE_WDAT;
1568 
1569 /* WDAT Instruction Entries (actions) */
1570 
1571 typedef struct acpi_wdat_entry
1572 {
1573     ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
1574 
1575 } ACPI_WDAT_ENTRY;
1576 
1577 /* Values for Action field above */
1578 
1579 enum AcpiWdatActions
1580 {
1581     ACPI_WDAT_RESET                 = 1,
1582     ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1583     ACPI_WDAT_GET_COUNTDOWN         = 5,
1584     ACPI_WDAT_SET_COUNTDOWN         = 6,
1585     ACPI_WDAT_GET_RUNNING_STATE     = 8,
1586     ACPI_WDAT_SET_RUNNING_STATE     = 9,
1587     ACPI_WDAT_GET_STOPPED_STATE     = 10,
1588     ACPI_WDAT_SET_STOPPED_STATE     = 11,
1589     ACPI_WDAT_GET_REBOOT            = 16,
1590     ACPI_WDAT_SET_REBOOT            = 17,
1591     ACPI_WDAT_GET_SHUTDOWN          = 18,
1592     ACPI_WDAT_SET_SHUTDOWN          = 19,
1593     ACPI_WDAT_GET_STATUS            = 32,
1594     ACPI_WDAT_SET_STATUS            = 33,
1595     ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
1596 };
1597 
1598 /* Values for Instruction field above */
1599 
1600 enum AcpiWdatInstructions
1601 {
1602     ACPI_WDAT_READ_VALUE            = 0,
1603     ACPI_WDAT_READ_COUNTDOWN        = 1,
1604     ACPI_WDAT_WRITE_VALUE           = 2,
1605     ACPI_WDAT_WRITE_COUNTDOWN       = 3,
1606     ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
1607     ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
1608 };
1609 
1610 
1611 /*******************************************************************************
1612  *
1613  * WDRT - Watchdog Resource Table
1614  *
1615  ******************************************************************************/
1616 
1617 typedef struct acpi_table_wdrt
1618 {
1619     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1620     UINT32                  HeaderLength;       /* Watchdog Header Length */
1621     UINT8                   PciSegment;         /* PCI Segment number */
1622     UINT8                   PciBus;             /* PCI Bus number */
1623     UINT8                   PciDevice;          /* PCI Device number */
1624     UINT8                   PciFunction;        /* PCI Function number */
1625     UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
1626     UINT32                  MaxCount;           /* Maximum counter value supported */
1627     UINT32                  MinCount;           /* Minimum counter value */
1628     UINT8                   Flags;
1629     UINT8                   Reserved[3];
1630     UINT32                  Entries;            /* Number of watchdog entries that follow */
1631 
1632 } ACPI_TABLE_WDRT;
1633 
1634 /* Flags */
1635 
1636 #define ACPI_WDRT_TIMER_ENABLED     (1)         /* 00: Timer enabled */
1637 
1638 
1639 /* Reset to default packing */
1640 
1641 #pragma pack()
1642 
1643 #endif /* __ACTBL1_H__ */
1644