xref: /freebsd/sys/contrib/dev/acpica/include/actbl3.h (revision 193d9e768ba63fcfb187cfd17f461f7d41345048)
1 /******************************************************************************
2  *
3  * Name: actbl3.h - ACPI Table Definitions
4  *
5  *****************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2017, 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  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #ifndef __ACTBL3_H__
153 #define __ACTBL3_H__
154 
155 
156 /*******************************************************************************
157  *
158  * Additional ACPI Tables (3)
159  *
160  * These tables are not consumed directly by the ACPICA subsystem, but are
161  * included here to support device drivers and the AML disassembler.
162  *
163  * In general, the tables in this file are fully defined within the ACPI
164  * specification.
165  *
166  ******************************************************************************/
167 
168 
169 /*
170  * Values for description table header signatures for tables defined in this
171  * file. Useful because they make it more difficult to inadvertently type in
172  * the wrong signature.
173  */
174 #define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
175 #define ACPI_SIG_DRTM           "DRTM"      /* Dynamic Root of Trust for Measurement table */
176 #define ACPI_SIG_FPDT           "FPDT"      /* Firmware Performance Data Table */
177 #define ACPI_SIG_GTDT           "GTDT"      /* Generic Timer Description Table */
178 #define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
179 #define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
180 #define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
181 #define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
182 #define ACPI_SIG_STAO           "STAO"      /* Status Override table */
183 #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
184 #define ACPI_SIG_XENV           "XENV"      /* Xen Environment table */
185 
186 #define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
187 #define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
188 
189 /* Reserved table signatures */
190 
191 #define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
192 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
193 
194 /*
195  * All tables must be byte-packed to match the ACPI specification, since
196  * the tables are provided by the system BIOS.
197  */
198 #pragma pack(1)
199 
200 /*
201  * Note: C bitfields are not used for this reason:
202  *
203  * "Bitfields are great and easy to read, but unfortunately the C language
204  * does not specify the layout of bitfields in memory, which means they are
205  * essentially useless for dealing with packed data in on-disk formats or
206  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
207  * this decision was a design error in C. Ritchie could have picked an order
208  * and stuck with it." Norman Ramsey.
209  * See http://stackoverflow.com/a/1053662/41661
210  */
211 
212 
213 /*******************************************************************************
214  *
215  * BGRT - Boot Graphics Resource Table (ACPI 5.0)
216  *        Version 1
217  *
218  ******************************************************************************/
219 
220 typedef struct acpi_table_bgrt
221 {
222     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
223     UINT16                  Version;
224     UINT8                   Status;
225     UINT8                   ImageType;
226     UINT64                  ImageAddress;
227     UINT32                  ImageOffsetX;
228     UINT32                  ImageOffsetY;
229 
230 } ACPI_TABLE_BGRT;
231 
232 
233 /*******************************************************************************
234  *
235  * DRTM - Dynamic Root of Trust for Measurement table
236  * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
237  * Table version 1
238  *
239  ******************************************************************************/
240 
241 typedef struct acpi_table_drtm
242 {
243     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
244     UINT64                  EntryBaseAddress;
245     UINT64                  EntryLength;
246     UINT32                  EntryAddress32;
247     UINT64                  EntryAddress64;
248     UINT64                  ExitAddress;
249     UINT64                  LogAreaAddress;
250     UINT32                  LogAreaLength;
251     UINT64                  ArchDependentAddress;
252     UINT32                  Flags;
253 
254 } ACPI_TABLE_DRTM;
255 
256 /* Flag Definitions for above */
257 
258 #define ACPI_DRTM_ACCESS_ALLOWED            (1)
259 #define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
260 #define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
261 #define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
262 
263 
264 /* 1) Validated Tables List (64-bit addresses) */
265 
266 typedef struct acpi_drtm_vtable_list
267 {
268     UINT32                  ValidatedTableCount;
269     UINT64                  ValidatedTables[1];
270 
271 } ACPI_DRTM_VTABLE_LIST;
272 
273 /* 2) Resources List (of Resource Descriptors) */
274 
275 /* Resource Descriptor */
276 
277 typedef struct acpi_drtm_resource
278 {
279     UINT8                   Size[7];
280     UINT8                   Type;
281     UINT64                  Address;
282 
283 } ACPI_DRTM_RESOURCE;
284 
285 typedef struct acpi_drtm_resource_list
286 {
287     UINT32                  ResourceCount;
288     ACPI_DRTM_RESOURCE      Resources[1];
289 
290 } ACPI_DRTM_RESOURCE_LIST;
291 
292 /* 3) Platform-specific Identifiers List */
293 
294 typedef struct acpi_drtm_dps_id
295 {
296     UINT32                  DpsIdLength;
297     UINT8                   DpsId[16];
298 
299 } ACPI_DRTM_DPS_ID;
300 
301 
302 /*******************************************************************************
303  *
304  * FPDT - Firmware Performance Data Table (ACPI 5.0)
305  *        Version 1
306  *
307  ******************************************************************************/
308 
309 typedef struct acpi_table_fpdt
310 {
311     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
312 
313 } ACPI_TABLE_FPDT;
314 
315 
316 /* FPDT subtable header (Performance Record Structure) */
317 
318 typedef struct acpi_fpdt_header
319 {
320     UINT16                  Type;
321     UINT8                   Length;
322     UINT8                   Revision;
323 
324 } ACPI_FPDT_HEADER;
325 
326 /* Values for Type field above */
327 
328 enum AcpiFpdtType
329 {
330     ACPI_FPDT_TYPE_BOOT                 = 0,
331     ACPI_FPDT_TYPE_S3PERF               = 1
332 };
333 
334 
335 /*
336  * FPDT subtables
337  */
338 
339 /* 0: Firmware Basic Boot Performance Record */
340 
341 typedef struct acpi_fpdt_boot_pointer
342 {
343     ACPI_FPDT_HEADER        Header;
344     UINT8                   Reserved[4];
345     UINT64                  Address;
346 
347 } ACPI_FPDT_BOOT_POINTER;
348 
349 
350 /* 1: S3 Performance Table Pointer Record */
351 
352 typedef struct acpi_fpdt_s3pt_pointer
353 {
354     ACPI_FPDT_HEADER        Header;
355     UINT8                   Reserved[4];
356     UINT64                  Address;
357 
358 } ACPI_FPDT_S3PT_POINTER;
359 
360 
361 /*
362  * S3PT - S3 Performance Table. This table is pointed to by the
363  * S3 Pointer Record above.
364  */
365 typedef struct acpi_table_s3pt
366 {
367     UINT8                   Signature[4]; /* "S3PT" */
368     UINT32                  Length;
369 
370 } ACPI_TABLE_S3PT;
371 
372 
373 /*
374  * S3PT Subtables (Not part of the actual FPDT)
375  */
376 
377 /* Values for Type field in S3PT header */
378 
379 enum AcpiS3ptType
380 {
381     ACPI_S3PT_TYPE_RESUME               = 0,
382     ACPI_S3PT_TYPE_SUSPEND              = 1,
383     ACPI_FPDT_BOOT_PERFORMANCE          = 2
384 };
385 
386 typedef struct acpi_s3pt_resume
387 {
388     ACPI_FPDT_HEADER        Header;
389     UINT32                  ResumeCount;
390     UINT64                  FullResume;
391     UINT64                  AverageResume;
392 
393 } ACPI_S3PT_RESUME;
394 
395 typedef struct acpi_s3pt_suspend
396 {
397     ACPI_FPDT_HEADER        Header;
398     UINT64                  SuspendStart;
399     UINT64                  SuspendEnd;
400 
401 } ACPI_S3PT_SUSPEND;
402 
403 
404 /*
405  * FPDT Boot Performance Record (Not part of the actual FPDT)
406  */
407 typedef struct acpi_fpdt_boot
408 {
409     ACPI_FPDT_HEADER        Header;
410     UINT8                   Reserved[4];
411     UINT64                  ResetEnd;
412     UINT64                  LoadStart;
413     UINT64                  StartupStart;
414     UINT64                  ExitServicesEntry;
415     UINT64                  ExitServicesExit;
416 
417 } ACPI_FPDT_BOOT;
418 
419 
420 /*******************************************************************************
421  *
422  * GTDT - Generic Timer Description Table (ACPI 5.1)
423  *        Version 2
424  *
425  ******************************************************************************/
426 
427 typedef struct acpi_table_gtdt
428 {
429     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
430     UINT64                  CounterBlockAddresss;
431     UINT32                  Reserved;
432     UINT32                  SecureEl1Interrupt;
433     UINT32                  SecureEl1Flags;
434     UINT32                  NonSecureEl1Interrupt;
435     UINT32                  NonSecureEl1Flags;
436     UINT32                  VirtualTimerInterrupt;
437     UINT32                  VirtualTimerFlags;
438     UINT32                  NonSecureEl2Interrupt;
439     UINT32                  NonSecureEl2Flags;
440     UINT64                  CounterReadBlockAddress;
441     UINT32                  PlatformTimerCount;
442     UINT32                  PlatformTimerOffset;
443 
444 } ACPI_TABLE_GTDT;
445 
446 /* Flag Definitions: Timer Block Physical Timers and Virtual timers */
447 
448 #define ACPI_GTDT_INTERRUPT_MODE        (1)
449 #define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
450 #define ACPI_GTDT_ALWAYS_ON             (1<<2)
451 
452 
453 /* Common GTDT subtable header */
454 
455 typedef struct acpi_gtdt_header
456 {
457     UINT8                   Type;
458     UINT16                  Length;
459 
460 } ACPI_GTDT_HEADER;
461 
462 /* Values for GTDT subtable type above */
463 
464 enum AcpiGtdtType
465 {
466     ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
467     ACPI_GTDT_TYPE_WATCHDOG         = 1,
468     ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
469 };
470 
471 
472 /* GTDT Subtables, correspond to Type in acpi_gtdt_header */
473 
474 /* 0: Generic Timer Block */
475 
476 typedef struct acpi_gtdt_timer_block
477 {
478     ACPI_GTDT_HEADER        Header;
479     UINT8                   Reserved;
480     UINT64                  BlockAddress;
481     UINT32                  TimerCount;
482     UINT32                  TimerOffset;
483 
484 } ACPI_GTDT_TIMER_BLOCK;
485 
486 /* Timer Sub-Structure, one per timer */
487 
488 typedef struct acpi_gtdt_timer_entry
489 {
490     UINT8                   FrameNumber;
491     UINT8                   Reserved[3];
492     UINT64                  BaseAddress;
493     UINT64                  El0BaseAddress;
494     UINT32                  TimerInterrupt;
495     UINT32                  TimerFlags;
496     UINT32                  VirtualTimerInterrupt;
497     UINT32                  VirtualTimerFlags;
498     UINT32                  CommonFlags;
499 
500 } ACPI_GTDT_TIMER_ENTRY;
501 
502 /* Flag Definitions: TimerFlags and VirtualTimerFlags above */
503 
504 #define ACPI_GTDT_GT_IRQ_MODE               (1)
505 #define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
506 
507 /* Flag Definitions: CommonFlags above */
508 
509 #define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
510 #define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
511 
512 
513 /* 1: SBSA Generic Watchdog Structure */
514 
515 typedef struct acpi_gtdt_watchdog
516 {
517     ACPI_GTDT_HEADER        Header;
518     UINT8                   Reserved;
519     UINT64                  RefreshFrameAddress;
520     UINT64                  ControlFrameAddress;
521     UINT32                  TimerInterrupt;
522     UINT32                  TimerFlags;
523 
524 } ACPI_GTDT_WATCHDOG;
525 
526 /* Flag Definitions: TimerFlags above */
527 
528 #define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
529 #define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
530 #define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
531 
532 
533 /*******************************************************************************
534  *
535  * MPST - Memory Power State Table (ACPI 5.0)
536  *        Version 1
537  *
538  ******************************************************************************/
539 
540 #define ACPI_MPST_CHANNEL_INFO \
541     UINT8                   ChannelId; \
542     UINT8                   Reserved1[3]; \
543     UINT16                  PowerNodeCount; \
544     UINT16                  Reserved2;
545 
546 /* Main table */
547 
548 typedef struct acpi_table_mpst
549 {
550     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
551     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
552 
553 } ACPI_TABLE_MPST;
554 
555 
556 /* Memory Platform Communication Channel Info */
557 
558 typedef struct acpi_mpst_channel
559 {
560     ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
561 
562 } ACPI_MPST_CHANNEL;
563 
564 
565 /* Memory Power Node Structure */
566 
567 typedef struct acpi_mpst_power_node
568 {
569     UINT8                   Flags;
570     UINT8                   Reserved1;
571     UINT16                  NodeId;
572     UINT32                  Length;
573     UINT64                  RangeAddress;
574     UINT64                  RangeLength;
575     UINT32                  NumPowerStates;
576     UINT32                  NumPhysicalComponents;
577 
578 } ACPI_MPST_POWER_NODE;
579 
580 /* Values for Flags field above */
581 
582 #define ACPI_MPST_ENABLED               1
583 #define ACPI_MPST_POWER_MANAGED         2
584 #define ACPI_MPST_HOT_PLUG_CAPABLE      4
585 
586 
587 /* Memory Power State Structure (follows POWER_NODE above) */
588 
589 typedef struct acpi_mpst_power_state
590 {
591     UINT8                   PowerState;
592     UINT8                   InfoIndex;
593 
594 } ACPI_MPST_POWER_STATE;
595 
596 
597 /* Physical Component ID Structure (follows POWER_STATE above) */
598 
599 typedef struct acpi_mpst_component
600 {
601     UINT16                  ComponentId;
602 
603 } ACPI_MPST_COMPONENT;
604 
605 
606 /* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
607 
608 typedef struct acpi_mpst_data_hdr
609 {
610     UINT16                  CharacteristicsCount;
611     UINT16                  Reserved;
612 
613 } ACPI_MPST_DATA_HDR;
614 
615 typedef struct acpi_mpst_power_data
616 {
617     UINT8                   StructureId;
618     UINT8                   Flags;
619     UINT16                  Reserved1;
620     UINT32                  AveragePower;
621     UINT32                  PowerSaving;
622     UINT64                  ExitLatency;
623     UINT64                  Reserved2;
624 
625 } ACPI_MPST_POWER_DATA;
626 
627 /* Values for Flags field above */
628 
629 #define ACPI_MPST_PRESERVE              1
630 #define ACPI_MPST_AUTOENTRY             2
631 #define ACPI_MPST_AUTOEXIT              4
632 
633 
634 /* Shared Memory Region (not part of an ACPI table) */
635 
636 typedef struct acpi_mpst_shared
637 {
638     UINT32                  Signature;
639     UINT16                  PccCommand;
640     UINT16                  PccStatus;
641     UINT32                  CommandRegister;
642     UINT32                  StatusRegister;
643     UINT32                  PowerStateId;
644     UINT32                  PowerNodeId;
645     UINT64                  EnergyConsumed;
646     UINT64                  AveragePower;
647 
648 } ACPI_MPST_SHARED;
649 
650 
651 /*******************************************************************************
652  *
653  * PCCT - Platform Communications Channel Table (ACPI 5.0)
654  *        Version 1
655  *
656  ******************************************************************************/
657 
658 typedef struct acpi_table_pcct
659 {
660     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
661     UINT32                  Flags;
662     UINT64                  Reserved;
663 
664 } ACPI_TABLE_PCCT;
665 
666 /* Values for Flags field above */
667 
668 #define ACPI_PCCT_DOORBELL              1
669 
670 /* Values for subtable type in ACPI_SUBTABLE_HEADER */
671 
672 enum AcpiPcctType
673 {
674     ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
675     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
676     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
677     ACPI_PCCT_TYPE_RESERVED                     = 3     /* 3 and greater are reserved */
678 };
679 
680 /*
681  * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
682  */
683 
684 /* 0: Generic Communications Subspace */
685 
686 typedef struct acpi_pcct_subspace
687 {
688     ACPI_SUBTABLE_HEADER    Header;
689     UINT8                   Reserved[6];
690     UINT64                  BaseAddress;
691     UINT64                  Length;
692     ACPI_GENERIC_ADDRESS    DoorbellRegister;
693     UINT64                  PreserveMask;
694     UINT64                  WriteMask;
695     UINT32                  Latency;
696     UINT32                  MaxAccessRate;
697     UINT16                  MinTurnaroundTime;
698 
699 } ACPI_PCCT_SUBSPACE;
700 
701 
702 /* 1: HW-reduced Communications Subspace (ACPI 5.1) */
703 
704 typedef struct acpi_pcct_hw_reduced
705 {
706     ACPI_SUBTABLE_HEADER    Header;
707     UINT32                  DoorbellInterrupt;
708     UINT8                   Flags;
709     UINT8                   Reserved;
710     UINT64                  BaseAddress;
711     UINT64                  Length;
712     ACPI_GENERIC_ADDRESS    DoorbellRegister;
713     UINT64                  PreserveMask;
714     UINT64                  WriteMask;
715     UINT32                  Latency;
716     UINT32                  MaxAccessRate;
717     UINT16                  MinTurnaroundTime;
718 
719 } ACPI_PCCT_HW_REDUCED;
720 
721 
722 /* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
723 
724 typedef struct acpi_pcct_hw_reduced_type2
725 {
726     ACPI_SUBTABLE_HEADER    Header;
727     UINT32                  DoorbellInterrupt;
728     UINT8                   Flags;
729     UINT8                   Reserved;
730     UINT64                  BaseAddress;
731     UINT64                  Length;
732     ACPI_GENERIC_ADDRESS    DoorbellRegister;
733     UINT64                  PreserveMask;
734     UINT64                  WriteMask;
735     UINT32                  Latency;
736     UINT32                  MaxAccessRate;
737     UINT16                  MinTurnaroundTime;
738     ACPI_GENERIC_ADDRESS    DoorbellAckRegister;
739     UINT64                  AckPreserveMask;
740     UINT64                  AckWriteMask;
741 
742 } ACPI_PCCT_HW_REDUCED_TYPE2;
743 
744 
745 /* Values for doorbell flags above */
746 
747 #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
748 #define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
749 
750 
751 /*
752  * PCC memory structures (not part of the ACPI table)
753  */
754 
755 /* Shared Memory Region */
756 
757 typedef struct acpi_pcct_shared_memory
758 {
759     UINT32                  Signature;
760     UINT16                  Command;
761     UINT16                  Status;
762 
763 } ACPI_PCCT_SHARED_MEMORY;
764 
765 
766 /*******************************************************************************
767  *
768  * PMTT - Platform Memory Topology Table (ACPI 5.0)
769  *        Version 1
770  *
771  ******************************************************************************/
772 
773 typedef struct acpi_table_pmtt
774 {
775     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
776     UINT32                  Reserved;
777 
778 } ACPI_TABLE_PMTT;
779 
780 
781 /* Common header for PMTT subtables that follow main table */
782 
783 typedef struct acpi_pmtt_header
784 {
785     UINT8                   Type;
786     UINT8                   Reserved1;
787     UINT16                  Length;
788     UINT16                  Flags;
789     UINT16                  Reserved2;
790 
791 } ACPI_PMTT_HEADER;
792 
793 /* Values for Type field above */
794 
795 #define ACPI_PMTT_TYPE_SOCKET           0
796 #define ACPI_PMTT_TYPE_CONTROLLER       1
797 #define ACPI_PMTT_TYPE_DIMM             2
798 #define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
799 
800 /* Values for Flags field above */
801 
802 #define ACPI_PMTT_TOP_LEVEL             0x0001
803 #define ACPI_PMTT_PHYSICAL              0x0002
804 #define ACPI_PMTT_MEMORY_TYPE           0x000C
805 
806 
807 /*
808  * PMTT subtables, correspond to Type in acpi_pmtt_header
809  */
810 
811 
812 /* 0: Socket Structure */
813 
814 typedef struct acpi_pmtt_socket
815 {
816     ACPI_PMTT_HEADER        Header;
817     UINT16                  SocketId;
818     UINT16                  Reserved;
819 
820 } ACPI_PMTT_SOCKET;
821 
822 
823 /* 1: Memory Controller subtable */
824 
825 typedef struct acpi_pmtt_controller
826 {
827     ACPI_PMTT_HEADER        Header;
828     UINT32                  ReadLatency;
829     UINT32                  WriteLatency;
830     UINT32                  ReadBandwidth;
831     UINT32                  WriteBandwidth;
832     UINT16                  AccessWidth;
833     UINT16                  Alignment;
834     UINT16                  Reserved;
835     UINT16                  DomainCount;
836 
837 } ACPI_PMTT_CONTROLLER;
838 
839 /* 1a: Proximity Domain substructure */
840 
841 typedef struct acpi_pmtt_domain
842 {
843     UINT32                  ProximityDomain;
844 
845 } ACPI_PMTT_DOMAIN;
846 
847 
848 /* 2: Physical Component Identifier (DIMM) */
849 
850 typedef struct acpi_pmtt_physical_component
851 {
852     ACPI_PMTT_HEADER        Header;
853     UINT16                  ComponentId;
854     UINT16                  Reserved;
855     UINT32                  MemorySize;
856     UINT32                  BiosHandle;
857 
858 } ACPI_PMTT_PHYSICAL_COMPONENT;
859 
860 
861 /*******************************************************************************
862  *
863  * RASF - RAS Feature Table (ACPI 5.0)
864  *        Version 1
865  *
866  ******************************************************************************/
867 
868 typedef struct acpi_table_rasf
869 {
870     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
871     UINT8                   ChannelId[12];
872 
873 } ACPI_TABLE_RASF;
874 
875 /* RASF Platform Communication Channel Shared Memory Region */
876 
877 typedef struct acpi_rasf_shared_memory
878 {
879     UINT32                  Signature;
880     UINT16                  Command;
881     UINT16                  Status;
882     UINT16                  Version;
883     UINT8                   Capabilities[16];
884     UINT8                   SetCapabilities[16];
885     UINT16                  NumParameterBlocks;
886     UINT32                  SetCapabilitiesStatus;
887 
888 } ACPI_RASF_SHARED_MEMORY;
889 
890 /* RASF Parameter Block Structure Header */
891 
892 typedef struct acpi_rasf_parameter_block
893 {
894     UINT16                  Type;
895     UINT16                  Version;
896     UINT16                  Length;
897 
898 } ACPI_RASF_PARAMETER_BLOCK;
899 
900 /* RASF Parameter Block Structure for PATROL_SCRUB */
901 
902 typedef struct acpi_rasf_patrol_scrub_parameter
903 {
904     ACPI_RASF_PARAMETER_BLOCK   Header;
905     UINT16                      PatrolScrubCommand;
906     UINT64                      RequestedAddressRange[2];
907     UINT64                      ActualAddressRange[2];
908     UINT16                      Flags;
909     UINT8                       RequestedSpeed;
910 
911 } ACPI_RASF_PATROL_SCRUB_PARAMETER;
912 
913 /* Masks for Flags and Speed fields above */
914 
915 #define ACPI_RASF_SCRUBBER_RUNNING      1
916 #define ACPI_RASF_SPEED                 (7<<1)
917 #define ACPI_RASF_SPEED_SLOW            (0<<1)
918 #define ACPI_RASF_SPEED_MEDIUM          (4<<1)
919 #define ACPI_RASF_SPEED_FAST            (7<<1)
920 
921 /* Channel Commands */
922 
923 enum AcpiRasfCommands
924 {
925     ACPI_RASF_EXECUTE_RASF_COMMAND      = 1
926 };
927 
928 /* Platform RAS Capabilities */
929 
930 enum AcpiRasfCapabiliities
931 {
932     ACPI_HW_PATROL_SCRUB_SUPPORTED      = 0,
933     ACPI_SW_PATROL_SCRUB_EXPOSED        = 1
934 };
935 
936 /* Patrol Scrub Commands */
937 
938 enum AcpiRasfPatrolScrubCommands
939 {
940     ACPI_RASF_GET_PATROL_PARAMETERS     = 1,
941     ACPI_RASF_START_PATROL_SCRUBBER     = 2,
942     ACPI_RASF_STOP_PATROL_SCRUBBER      = 3
943 };
944 
945 /* Channel Command flags */
946 
947 #define ACPI_RASF_GENERATE_SCI          (1<<15)
948 
949 /* Status values */
950 
951 enum AcpiRasfStatus
952 {
953     ACPI_RASF_SUCCESS                   = 0,
954     ACPI_RASF_NOT_VALID                 = 1,
955     ACPI_RASF_NOT_SUPPORTED             = 2,
956     ACPI_RASF_BUSY                      = 3,
957     ACPI_RASF_FAILED                    = 4,
958     ACPI_RASF_ABORTED                   = 5,
959     ACPI_RASF_INVALID_DATA              = 6
960 };
961 
962 /* Status flags */
963 
964 #define ACPI_RASF_COMMAND_COMPLETE      (1)
965 #define ACPI_RASF_SCI_DOORBELL          (1<<1)
966 #define ACPI_RASF_ERROR                 (1<<2)
967 #define ACPI_RASF_STATUS                (0x1F<<3)
968 
969 
970 /*******************************************************************************
971  *
972  * STAO - Status Override Table (_STA override) - ACPI 6.0
973  *        Version 1
974  *
975  * Conforms to "ACPI Specification for Status Override Table"
976  * 6 January 2015
977  *
978  ******************************************************************************/
979 
980 typedef struct acpi_table_stao
981 {
982     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
983     UINT8                   IgnoreUart;
984 
985 } ACPI_TABLE_STAO;
986 
987 
988 /*******************************************************************************
989  *
990  * WPBT - Windows Platform Environment Table (ACPI 6.0)
991  *        Version 1
992  *
993  * Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
994  *
995  ******************************************************************************/
996 
997 typedef struct acpi_table_wpbt
998 {
999     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1000     UINT32                  HandoffSize;
1001     UINT64                  HandoffAddress;
1002     UINT8                   Layout;
1003     UINT8                   Type;
1004     UINT16                  ArgumentsLength;
1005 
1006 } ACPI_TABLE_WPBT;
1007 
1008 
1009 /*******************************************************************************
1010  *
1011  * XENV - Xen Environment Table (ACPI 6.0)
1012  *        Version 1
1013  *
1014  * Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
1015  *
1016  ******************************************************************************/
1017 
1018 typedef struct acpi_table_xenv
1019 {
1020     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
1021     UINT64                  GrantTableAddress;
1022     UINT64                  GrantTableSize;
1023     UINT32                  EventInterrupt;
1024     UINT8                   EventFlags;
1025 
1026 } ACPI_TABLE_XENV;
1027 
1028 
1029 /* Reset to default packing */
1030 
1031 #pragma pack()
1032 
1033 #endif /* __ACTBL3_H__ */
1034