1 /******************************************************************************
3 * Module Name: dttable2.c - handling for specific ACPI tables
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
12 * All rights reserved.
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
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
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;
37 * The above copyright and patent license is granted only if the following
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.
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
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
72 * 3.4. Intel retains all right, title, and interest in and to the Original
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.
80 * 4. Disclaimer and Export Compliance
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
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
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.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
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.
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.
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.
150 *****************************************************************************/
152 /* Compile all complex data tables, signatures starting with L-Z */
154 #include <contrib/dev/acpica/compiler/aslcompiler.h>
156 #define _COMPONENT DT_COMPILER
157 ACPI_MODULE_NAME ("dttable2")
160 /******************************************************************************
162 * FUNCTION: DtCompileLpit
164 * PARAMETERS: List - Current field list pointer
168 * DESCRIPTION: Compile LPIT.
170 *****************************************************************************/
177 DT_SUBTABLE *Subtable;
178 DT_SUBTABLE *ParentTable;
179 DT_FIELD **PFieldList = (DT_FIELD **) List;
180 DT_FIELD *SubtableStart;
181 ACPI_DMTABLE_INFO *InfoTable;
182 ACPI_LPIT_HEADER *LpitHeader;
185 /* Note: Main table consists only of the standard ACPI table header */
189 SubtableStart = *PFieldList;
191 /* LPIT Subtable header */
193 Status = DtCompileTable (PFieldList, AcpiDmTableInfoLpitHdr,
195 if (ACPI_FAILURE (Status))
200 ParentTable = DtPeekSubtable ();
201 DtInsertSubtable (ParentTable, Subtable);
202 DtPushSubtable (Subtable);
204 LpitHeader = ACPI_CAST_PTR (ACPI_LPIT_HEADER, Subtable->Buffer);
206 switch (LpitHeader->Type)
208 case ACPI_LPIT_TYPE_NATIVE_CSTATE:
210 InfoTable = AcpiDmTableInfoLpit0;
215 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "LPIT");
221 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
222 if (ACPI_FAILURE (Status))
227 ParentTable = DtPeekSubtable ();
228 DtInsertSubtable (ParentTable, Subtable);
236 /******************************************************************************
238 * FUNCTION: DtCompileMadt
240 * PARAMETERS: List - Current field list pointer
244 * DESCRIPTION: Compile MADT.
246 *****************************************************************************/
253 DT_SUBTABLE *Subtable;
254 DT_SUBTABLE *ParentTable;
255 DT_FIELD **PFieldList = (DT_FIELD **) List;
256 DT_FIELD *SubtableStart;
257 ACPI_SUBTABLE_HEADER *MadtHeader;
258 ACPI_DMTABLE_INFO *InfoTable;
261 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadt,
263 if (ACPI_FAILURE (Status))
268 ParentTable = DtPeekSubtable ();
269 DtInsertSubtable (ParentTable, Subtable);
273 SubtableStart = *PFieldList;
274 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMadtHdr,
276 if (ACPI_FAILURE (Status))
281 ParentTable = DtPeekSubtable ();
282 DtInsertSubtable (ParentTable, Subtable);
283 DtPushSubtable (Subtable);
285 MadtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
287 switch (MadtHeader->Type)
289 case ACPI_MADT_TYPE_LOCAL_APIC:
291 InfoTable = AcpiDmTableInfoMadt0;
294 case ACPI_MADT_TYPE_IO_APIC:
296 InfoTable = AcpiDmTableInfoMadt1;
299 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
301 InfoTable = AcpiDmTableInfoMadt2;
304 case ACPI_MADT_TYPE_NMI_SOURCE:
306 InfoTable = AcpiDmTableInfoMadt3;
309 case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
311 InfoTable = AcpiDmTableInfoMadt4;
314 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
316 InfoTable = AcpiDmTableInfoMadt5;
319 case ACPI_MADT_TYPE_IO_SAPIC:
321 InfoTable = AcpiDmTableInfoMadt6;
324 case ACPI_MADT_TYPE_LOCAL_SAPIC:
326 InfoTable = AcpiDmTableInfoMadt7;
329 case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
331 InfoTable = AcpiDmTableInfoMadt8;
334 case ACPI_MADT_TYPE_LOCAL_X2APIC:
336 InfoTable = AcpiDmTableInfoMadt9;
339 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
341 InfoTable = AcpiDmTableInfoMadt10;
344 case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
346 InfoTable = AcpiDmTableInfoMadt11;
349 case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
351 InfoTable = AcpiDmTableInfoMadt12;
354 case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
356 InfoTable = AcpiDmTableInfoMadt13;
359 case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
361 InfoTable = AcpiDmTableInfoMadt14;
364 case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
366 InfoTable = AcpiDmTableInfoMadt15;
371 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "MADT");
375 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
376 if (ACPI_FAILURE (Status))
381 ParentTable = DtPeekSubtable ();
382 DtInsertSubtable (ParentTable, Subtable);
390 /******************************************************************************
392 * FUNCTION: DtCompileMcfg
394 * PARAMETERS: List - Current field list pointer
398 * DESCRIPTION: Compile MCFG.
400 *****************************************************************************/
409 Status = DtCompileTwoSubtables (List,
410 AcpiDmTableInfoMcfg, AcpiDmTableInfoMcfg0);
415 /******************************************************************************
417 * FUNCTION: DtCompileMpst
419 * PARAMETERS: List - Current field list pointer
423 * DESCRIPTION: Compile MPST.
425 *****************************************************************************/
432 DT_SUBTABLE *Subtable;
433 DT_SUBTABLE *ParentTable;
434 DT_FIELD **PFieldList = (DT_FIELD **) List;
435 ACPI_MPST_CHANNEL *MpstChannelInfo;
436 ACPI_MPST_POWER_NODE *MpstPowerNode;
437 ACPI_MPST_DATA_HDR *MpstDataHeader;
438 UINT16 SubtableCount;
439 UINT32 PowerStateCount;
440 UINT32 ComponentCount;
445 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst, &Subtable, TRUE);
446 if (ACPI_FAILURE (Status))
451 ParentTable = DtPeekSubtable ();
452 DtInsertSubtable (ParentTable, Subtable);
453 DtPushSubtable (Subtable);
455 MpstChannelInfo = ACPI_CAST_PTR (ACPI_MPST_CHANNEL, Subtable->Buffer);
456 SubtableCount = MpstChannelInfo->PowerNodeCount;
458 while (*PFieldList && SubtableCount)
460 /* Subtable: Memory Power Node(s) */
462 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0,
464 if (ACPI_FAILURE (Status))
469 ParentTable = DtPeekSubtable ();
470 DtInsertSubtable (ParentTable, Subtable);
471 DtPushSubtable (Subtable);
473 MpstPowerNode = ACPI_CAST_PTR (ACPI_MPST_POWER_NODE, Subtable->Buffer);
474 PowerStateCount = MpstPowerNode->NumPowerStates;
475 ComponentCount = MpstPowerNode->NumPhysicalComponents;
477 ParentTable = DtPeekSubtable ();
479 /* Sub-subtables - Memory Power State Structure(s) */
481 while (*PFieldList && PowerStateCount)
483 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0A,
485 if (ACPI_FAILURE (Status))
490 DtInsertSubtable (ParentTable, Subtable);
494 /* Sub-subtables - Physical Component ID Structure(s) */
496 while (*PFieldList && ComponentCount)
498 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst0B,
500 if (ACPI_FAILURE (Status))
505 DtInsertSubtable (ParentTable, Subtable);
513 /* Subtable: Count of Memory Power State Characteristic structures */
517 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst1, &Subtable, TRUE);
518 if (ACPI_FAILURE (Status))
523 ParentTable = DtPeekSubtable ();
524 DtInsertSubtable (ParentTable, Subtable);
525 DtPushSubtable (Subtable);
527 MpstDataHeader = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable->Buffer);
528 SubtableCount = MpstDataHeader->CharacteristicsCount;
530 ParentTable = DtPeekSubtable ();
532 /* Subtable: Memory Power State Characteristics structure(s) */
534 while (*PFieldList && SubtableCount)
536 Status = DtCompileTable (PFieldList, AcpiDmTableInfoMpst2,
538 if (ACPI_FAILURE (Status))
543 DtInsertSubtable (ParentTable, Subtable);
552 /******************************************************************************
554 * FUNCTION: DtCompileMsct
556 * PARAMETERS: List - Current field list pointer
560 * DESCRIPTION: Compile MSCT.
562 *****************************************************************************/
571 Status = DtCompileTwoSubtables (List,
572 AcpiDmTableInfoMsct, AcpiDmTableInfoMsct0);
577 /******************************************************************************
579 * FUNCTION: DtCompileMtmr
581 * PARAMETERS: List - Current field list pointer
585 * DESCRIPTION: Compile MTMR.
587 *****************************************************************************/
596 Status = DtCompileTwoSubtables (List,
597 AcpiDmTableInfoMtmr, AcpiDmTableInfoMtmr0);
602 /******************************************************************************
604 * FUNCTION: DtCompileNfit
606 * PARAMETERS: List - Current field list pointer
610 * DESCRIPTION: Compile NFIT.
612 *****************************************************************************/
619 DT_SUBTABLE *Subtable;
620 DT_SUBTABLE *ParentTable;
621 DT_FIELD **PFieldList = (DT_FIELD **) List;
622 DT_FIELD *SubtableStart;
623 ACPI_NFIT_HEADER *NfitHeader;
624 ACPI_DMTABLE_INFO *InfoTable;
626 ACPI_NFIT_INTERLEAVE *Interleave = NULL;
627 ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
632 Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit,
634 if (ACPI_FAILURE (Status))
639 ParentTable = DtPeekSubtable ();
640 DtInsertSubtable (ParentTable, Subtable);
641 DtPushSubtable (Subtable);
647 SubtableStart = *PFieldList;
648 Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfitHdr,
650 if (ACPI_FAILURE (Status))
655 ParentTable = DtPeekSubtable ();
656 DtInsertSubtable (ParentTable, Subtable);
657 DtPushSubtable (Subtable);
659 NfitHeader = ACPI_CAST_PTR (ACPI_NFIT_HEADER, Subtable->Buffer);
661 switch (NfitHeader->Type)
663 case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
665 InfoTable = AcpiDmTableInfoNfit0;
668 case ACPI_NFIT_TYPE_MEMORY_MAP:
670 InfoTable = AcpiDmTableInfoNfit1;
673 case ACPI_NFIT_TYPE_INTERLEAVE:
675 Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable->Buffer);
676 InfoTable = AcpiDmTableInfoNfit2;
679 case ACPI_NFIT_TYPE_SMBIOS:
681 InfoTable = AcpiDmTableInfoNfit3;
684 case ACPI_NFIT_TYPE_CONTROL_REGION:
686 InfoTable = AcpiDmTableInfoNfit4;
689 case ACPI_NFIT_TYPE_DATA_REGION:
691 InfoTable = AcpiDmTableInfoNfit5;
694 case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
696 Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable->Buffer);
697 InfoTable = AcpiDmTableInfoNfit6;
702 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "NFIT");
706 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
707 if (ACPI_FAILURE (Status))
712 ParentTable = DtPeekSubtable ();
713 DtInsertSubtable (ParentTable, Subtable);
716 switch (NfitHeader->Type)
718 case ACPI_NFIT_TYPE_INTERLEAVE:
721 DtPushSubtable (Subtable);
724 Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit2a,
726 if (ACPI_FAILURE (Status))
737 ParentTable = DtPeekSubtable ();
738 DtInsertSubtable (ParentTable, Subtable);
742 Interleave->LineCount = Count;
746 case ACPI_NFIT_TYPE_SMBIOS:
750 Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit3a,
752 if (ACPI_FAILURE (Status))
759 DtInsertSubtable (ParentTable, Subtable);
764 case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
767 DtPushSubtable (Subtable);
770 Status = DtCompileTable (PFieldList, AcpiDmTableInfoNfit6a,
772 if (ACPI_FAILURE (Status))
783 ParentTable = DtPeekSubtable ();
784 DtInsertSubtable (ParentTable, Subtable);
788 Hint->HintCount = (UINT16) Count;
801 /******************************************************************************
803 * FUNCTION: DtCompilePcct
805 * PARAMETERS: List - Current field list pointer
809 * DESCRIPTION: Compile PCCT.
811 *****************************************************************************/
818 DT_SUBTABLE *Subtable;
819 DT_SUBTABLE *ParentTable;
820 DT_FIELD **PFieldList = (DT_FIELD **) List;
821 DT_FIELD *SubtableStart;
822 ACPI_SUBTABLE_HEADER *PcctHeader;
823 ACPI_DMTABLE_INFO *InfoTable;
828 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
830 if (ACPI_FAILURE (Status))
835 ParentTable = DtPeekSubtable ();
836 DtInsertSubtable (ParentTable, Subtable);
842 SubtableStart = *PFieldList;
843 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
845 if (ACPI_FAILURE (Status))
850 ParentTable = DtPeekSubtable ();
851 DtInsertSubtable (ParentTable, Subtable);
852 DtPushSubtable (Subtable);
854 PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
856 switch (PcctHeader->Type)
858 case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
860 InfoTable = AcpiDmTableInfoPcct0;
863 case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
865 InfoTable = AcpiDmTableInfoPcct1;
868 case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2:
870 InfoTable = AcpiDmTableInfoPcct2;
873 case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE:
875 InfoTable = AcpiDmTableInfoPcct3;
878 case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE:
880 InfoTable = AcpiDmTableInfoPcct4;
885 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
889 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
890 if (ACPI_FAILURE (Status))
895 ParentTable = DtPeekSubtable ();
896 DtInsertSubtable (ParentTable, Subtable);
904 /******************************************************************************
906 * FUNCTION: DtCompilePdtt
908 * PARAMETERS: List - Current field list pointer
912 * DESCRIPTION: Compile PDTT.
914 *****************************************************************************/
921 DT_SUBTABLE *Subtable;
922 DT_SUBTABLE *ParentTable;
923 DT_FIELD **PFieldList = (DT_FIELD **) List;
924 ACPI_TABLE_PDTT *PdttHeader;
930 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPdtt, &Subtable, TRUE);
931 if (ACPI_FAILURE (Status))
936 ParentTable = DtPeekSubtable ();
937 DtInsertSubtable (ParentTable, Subtable);
939 PdttHeader = ACPI_CAST_PTR (ACPI_TABLE_PDTT, ParentTable->Buffer);
940 PdttHeader->ArrayOffset = sizeof (ACPI_TABLE_PDTT);
942 /* There is only one type of subtable at this time, no need to decode */
946 /* List of subchannel IDs, each 2 bytes */
948 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPdtt0,
950 if (ACPI_FAILURE (Status))
955 DtInsertSubtable (ParentTable, Subtable);
959 PdttHeader->TriggerCount = (UINT8) Count;
964 /******************************************************************************
966 * FUNCTION: DtCompilePmtt
968 * PARAMETERS: List - Current field list pointer
972 * DESCRIPTION: Compile PMTT.
974 *****************************************************************************/
981 DT_SUBTABLE *Subtable;
982 DT_SUBTABLE *ParentTable;
983 DT_FIELD **PFieldList = (DT_FIELD **) List;
984 DT_FIELD *SubtableStart;
985 ACPI_PMTT_HEADER *PmttHeader;
986 ACPI_PMTT_CONTROLLER *PmttController;
988 UINT8 PrevType = ACPI_PMTT_TYPE_SOCKET;
993 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt, &Subtable, TRUE);
994 if (ACPI_FAILURE (Status))
999 ParentTable = DtPeekSubtable ();
1000 DtInsertSubtable (ParentTable, Subtable);
1001 DtPushSubtable (Subtable);
1005 SubtableStart = *PFieldList;
1006 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmttHdr,
1008 if (ACPI_FAILURE (Status))
1013 PmttHeader = ACPI_CAST_PTR (ACPI_PMTT_HEADER, Subtable->Buffer);
1014 while (PrevType >= PmttHeader->Type)
1018 if (PrevType == ACPI_PMTT_TYPE_SOCKET)
1026 PrevType = PmttHeader->Type;
1028 ParentTable = DtPeekSubtable ();
1029 DtInsertSubtable (ParentTable, Subtable);
1030 DtPushSubtable (Subtable);
1032 switch (PmttHeader->Type)
1034 case ACPI_PMTT_TYPE_SOCKET:
1036 /* Subtable: Socket Structure */
1038 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt0,
1040 if (ACPI_FAILURE (Status))
1045 ParentTable = DtPeekSubtable ();
1046 DtInsertSubtable (ParentTable, Subtable);
1049 case ACPI_PMTT_TYPE_CONTROLLER:
1051 /* Subtable: Memory Controller Structure */
1053 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1,
1055 if (ACPI_FAILURE (Status))
1060 ParentTable = DtPeekSubtable ();
1061 DtInsertSubtable (ParentTable, Subtable);
1063 PmttController = ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER,
1064 (Subtable->Buffer - sizeof (ACPI_PMTT_HEADER)));
1065 DomainCount = PmttController->DomainCount;
1069 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt1a,
1071 if (ACPI_FAILURE (Status))
1076 DtInsertSubtable (ParentTable, Subtable);
1081 case ACPI_PMTT_TYPE_DIMM:
1083 /* Subtable: Physical Component Structure */
1085 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPmtt2,
1087 if (ACPI_FAILURE (Status))
1092 ParentTable = DtPeekSubtable ();
1093 DtInsertSubtable (ParentTable, Subtable);
1098 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PMTT");
1107 /******************************************************************************
1109 * FUNCTION: DtCompilePptt
1111 * PARAMETERS: List - Current field list pointer
1115 * DESCRIPTION: Compile PPTT.
1117 *****************************************************************************/
1124 ACPI_SUBTABLE_HEADER *PpttHeader;
1125 ACPI_PPTT_PROCESSOR *PpttProcessor = NULL;
1126 DT_SUBTABLE *Subtable;
1127 DT_SUBTABLE *ParentTable;
1128 ACPI_DMTABLE_INFO *InfoTable;
1129 DT_FIELD **PFieldList = (DT_FIELD **) List;
1130 DT_FIELD *SubtableStart;
1133 ParentTable = DtPeekSubtable ();
1136 SubtableStart = *PFieldList;
1138 /* Compile PPTT subtable header */
1140 Status = DtCompileTable (PFieldList, AcpiDmTableInfoPpttHdr,
1142 if (ACPI_FAILURE (Status))
1146 DtInsertSubtable (ParentTable, Subtable);
1147 PpttHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
1148 PpttHeader->Length = (UINT8)(Subtable->Length);
1150 switch (PpttHeader->Type)
1152 case ACPI_PPTT_TYPE_PROCESSOR:
1154 InfoTable = AcpiDmTableInfoPptt0;
1157 case ACPI_PPTT_TYPE_CACHE:
1159 InfoTable = AcpiDmTableInfoPptt1;
1162 case ACPI_PPTT_TYPE_ID:
1164 InfoTable = AcpiDmTableInfoPptt2;
1169 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PPTT");
1173 /* Compile PPTT subtable body */
1175 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1176 if (ACPI_FAILURE (Status))
1180 DtInsertSubtable (ParentTable, Subtable);
1181 PpttHeader->Length += (UINT8)(Subtable->Length);
1183 /* Compile PPTT subtable additionals */
1185 switch (PpttHeader->Type)
1187 case ACPI_PPTT_TYPE_PROCESSOR:
1189 PpttProcessor = ACPI_SUB_PTR (ACPI_PPTT_PROCESSOR,
1190 Subtable->Buffer, sizeof (ACPI_SUBTABLE_HEADER));
1193 /* Compile initiator proximity domain list */
1195 PpttProcessor->NumberOfPrivResources = 0;
1198 Status = DtCompileTable (PFieldList,
1199 AcpiDmTableInfoPptt0a, &Subtable, TRUE);
1200 if (ACPI_FAILURE (Status))
1209 DtInsertSubtable (ParentTable, Subtable);
1210 PpttHeader->Length += (UINT8)(Subtable->Length);
1211 PpttProcessor->NumberOfPrivResources++;
1226 /******************************************************************************
1228 * FUNCTION: DtCompileRsdt
1230 * PARAMETERS: List - Current field list pointer
1234 * DESCRIPTION: Compile RSDT.
1236 *****************************************************************************/
1242 DT_SUBTABLE *Subtable;
1243 DT_SUBTABLE *ParentTable;
1244 DT_FIELD *FieldList = *(DT_FIELD **) List;
1248 ParentTable = DtPeekSubtable ();
1252 DtCompileInteger ((UINT8 *) &Address, FieldList, 4, DT_NON_ZERO);
1254 DtCreateSubtable ((UINT8 *) &Address, 4, &Subtable);
1255 DtInsertSubtable (ParentTable, Subtable);
1256 FieldList = FieldList->Next;
1263 /******************************************************************************
1265 * FUNCTION: DtCompileS3pt
1267 * PARAMETERS: PFieldList - Current field list pointer
1271 * DESCRIPTION: Compile S3PT (Pointed to by FPDT)
1273 *****************************************************************************/
1277 DT_FIELD **PFieldList)
1280 ACPI_FPDT_HEADER *S3ptHeader;
1281 DT_SUBTABLE *Subtable;
1282 DT_SUBTABLE *ParentTable;
1283 ACPI_DMTABLE_INFO *InfoTable;
1284 DT_FIELD *SubtableStart;
1287 Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3pt,
1288 &Gbl_RootTable, TRUE);
1289 if (ACPI_FAILURE (Status))
1294 DtPushSubtable (Gbl_RootTable);
1298 SubtableStart = *PFieldList;
1299 Status = DtCompileTable (PFieldList, AcpiDmTableInfoS3ptHdr,
1301 if (ACPI_FAILURE (Status))
1306 ParentTable = DtPeekSubtable ();
1307 DtInsertSubtable (ParentTable, Subtable);
1308 DtPushSubtable (Subtable);
1310 S3ptHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
1312 switch (S3ptHeader->Type)
1314 case ACPI_S3PT_TYPE_RESUME:
1316 InfoTable = AcpiDmTableInfoS3pt0;
1319 case ACPI_S3PT_TYPE_SUSPEND:
1321 InfoTable = AcpiDmTableInfoS3pt1;
1326 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "S3PT");
1330 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1331 if (ACPI_FAILURE (Status))
1336 ParentTable = DtPeekSubtable ();
1337 DtInsertSubtable (ParentTable, Subtable);
1345 /******************************************************************************
1347 * FUNCTION: DtCompileSdev
1349 * PARAMETERS: List - Current field list pointer
1353 * DESCRIPTION: Compile SDEV.
1355 *****************************************************************************/
1362 ACPI_SDEV_HEADER *SdevHeader;
1363 DT_SUBTABLE *Subtable;
1364 DT_SUBTABLE *ParentTable;
1365 ACPI_DMTABLE_INFO *InfoTable;
1366 DT_FIELD **PFieldList = (DT_FIELD **) List;
1367 DT_FIELD *SubtableStart;
1368 ACPI_SDEV_PCIE *Pcie = NULL;
1369 ACPI_SDEV_NAMESPACE *Namesp = NULL;
1377 /* Compile common SDEV subtable header */
1379 SubtableStart = *PFieldList;
1380 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdevHdr,
1382 if (ACPI_FAILURE (Status))
1387 ParentTable = DtPeekSubtable ();
1388 DtInsertSubtable (ParentTable, Subtable);
1389 DtPushSubtable (Subtable);
1391 SdevHeader = ACPI_CAST_PTR (ACPI_SDEV_HEADER, Subtable->Buffer);
1392 SdevHeader->Length = (UINT8)(sizeof (ACPI_SDEV_HEADER));
1394 switch (SdevHeader->Type)
1396 case ACPI_SDEV_TYPE_NAMESPACE_DEVICE:
1398 InfoTable = AcpiDmTableInfoSdev0;
1399 Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable->Buffer);
1402 case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
1404 InfoTable = AcpiDmTableInfoSdev1;
1405 Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable->Buffer);
1410 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SDEV");
1414 /* Compile SDEV subtable body */
1416 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1417 if (ACPI_FAILURE (Status))
1422 ParentTable = DtPeekSubtable ();
1423 DtInsertSubtable (ParentTable, Subtable);
1425 /* Optional data fields are appended to the main subtable body */
1427 switch (SdevHeader->Type)
1429 case ACPI_SDEV_TYPE_NAMESPACE_DEVICE:
1431 /* Append DeviceId namespace string */
1433 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev0a,
1435 if (ACPI_FAILURE (Status))
1445 ParentTable = DtPeekSubtable ();
1446 DtInsertSubtable (ParentTable, Subtable);
1448 Namesp->DeviceIdOffset = sizeof (ACPI_SDEV_NAMESPACE);
1449 Namesp->DeviceIdLength = (UINT16) Subtable->Length;
1451 /* Append Vendor data */
1453 Namesp->VendorDataLength = 0;
1454 Namesp->VendorDataOffset = 0;
1458 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1b,
1460 if (ACPI_FAILURE (Status))
1467 ParentTable = DtPeekSubtable ();
1468 DtInsertSubtable (ParentTable, Subtable);
1470 Namesp->VendorDataOffset =
1471 Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
1472 Namesp->VendorDataLength =
1473 (UINT16) Subtable->Length;
1477 /* Final size of entire namespace structure */
1479 SdevHeader->Length = (UINT16) (sizeof (ACPI_SDEV_NAMESPACE) +
1480 Subtable->Length + Namesp->DeviceIdLength);
1483 case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
1485 /* Append the PCIe path info first */
1488 while (*PFieldList && !strcmp ((*PFieldList)->Name, "Device"))
1490 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1a,
1492 if (ACPI_FAILURE (Status))
1503 ParentTable = DtPeekSubtable ();
1504 DtInsertSubtable (ParentTable, Subtable);
1508 /* Path offset will point immediately after the main subtable */
1510 Pcie->PathOffset = sizeof (ACPI_SDEV_PCIE);
1511 Pcie->PathLength = (UINT16)
1512 (EntryCount * sizeof (ACPI_SDEV_PCIE_PATH));
1514 /* Append the Vendor Data last */
1516 Pcie->VendorDataLength = 0;
1517 Pcie->VendorDataOffset = 0;
1521 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSdev1b,
1523 if (ACPI_FAILURE (Status))
1530 ParentTable = DtPeekSubtable ();
1531 DtInsertSubtable (ParentTable, Subtable);
1533 Pcie->VendorDataOffset =
1534 Pcie->PathOffset + Pcie->PathLength;
1535 Pcie->VendorDataLength = (UINT16)
1540 SdevHeader->Length =
1541 sizeof (ACPI_SDEV_PCIE) +
1542 Pcie->PathLength + Pcie->VendorDataLength;
1547 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SDEV");
1558 /******************************************************************************
1560 * FUNCTION: DtCompileSlic
1562 * PARAMETERS: List - Current field list pointer
1566 * DESCRIPTION: Compile SLIC.
1568 *****************************************************************************/
1575 DT_SUBTABLE *Subtable;
1576 DT_SUBTABLE *ParentTable;
1577 DT_FIELD **PFieldList = (DT_FIELD **) List;
1582 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlic,
1584 if (ACPI_FAILURE (Status))
1589 ParentTable = DtPeekSubtable ();
1590 DtInsertSubtable (ParentTable, Subtable);
1591 DtPushSubtable (Subtable);
1599 /******************************************************************************
1601 * FUNCTION: DtCompileSlit
1603 * PARAMETERS: List - Current field list pointer
1607 * DESCRIPTION: Compile SLIT.
1609 *****************************************************************************/
1616 DT_SUBTABLE *Subtable;
1617 DT_SUBTABLE *ParentTable;
1618 DT_FIELD **PFieldList = (DT_FIELD **) List;
1619 DT_FIELD *FieldList;
1621 UINT8 *LocalityBuffer;
1624 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlit,
1626 if (ACPI_FAILURE (Status))
1631 ParentTable = DtPeekSubtable ();
1632 DtInsertSubtable (ParentTable, Subtable);
1634 Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
1635 LocalityBuffer = UtLocalCalloc (Localities);
1637 /* Compile each locality buffer */
1639 FieldList = *PFieldList;
1642 DtCompileBuffer (LocalityBuffer,
1643 FieldList->Value, FieldList, Localities);
1645 DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
1646 DtInsertSubtable (ParentTable, Subtable);
1647 FieldList = FieldList->Next;
1650 ACPI_FREE (LocalityBuffer);
1655 /******************************************************************************
1657 * FUNCTION: DtCompileSrat
1659 * PARAMETERS: List - Current field list pointer
1663 * DESCRIPTION: Compile SRAT.
1665 *****************************************************************************/
1672 DT_SUBTABLE *Subtable;
1673 DT_SUBTABLE *ParentTable;
1674 DT_FIELD **PFieldList = (DT_FIELD **) List;
1675 DT_FIELD *SubtableStart;
1676 ACPI_SUBTABLE_HEADER *SratHeader;
1677 ACPI_DMTABLE_INFO *InfoTable;
1680 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSrat,
1682 if (ACPI_FAILURE (Status))
1687 ParentTable = DtPeekSubtable ();
1688 DtInsertSubtable (ParentTable, Subtable);
1692 SubtableStart = *PFieldList;
1693 Status = DtCompileTable (PFieldList, AcpiDmTableInfoSratHdr,
1695 if (ACPI_FAILURE (Status))
1700 ParentTable = DtPeekSubtable ();
1701 DtInsertSubtable (ParentTable, Subtable);
1702 DtPushSubtable (Subtable);
1704 SratHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
1706 switch (SratHeader->Type)
1708 case ACPI_SRAT_TYPE_CPU_AFFINITY:
1710 InfoTable = AcpiDmTableInfoSrat0;
1713 case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
1715 InfoTable = AcpiDmTableInfoSrat1;
1718 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
1720 InfoTable = AcpiDmTableInfoSrat2;
1723 case ACPI_SRAT_TYPE_GICC_AFFINITY:
1725 InfoTable = AcpiDmTableInfoSrat3;
1728 case ACPI_SRAT_TYPE_GIC_ITS_AFFINITY:
1730 InfoTable = AcpiDmTableInfoSrat4;
1735 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SRAT");
1739 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1740 if (ACPI_FAILURE (Status))
1745 ParentTable = DtPeekSubtable ();
1746 DtInsertSubtable (ParentTable, Subtable);
1754 /******************************************************************************
1756 * FUNCTION: DtCompileStao
1758 * PARAMETERS: PFieldList - Current field list pointer
1762 * DESCRIPTION: Compile STAO.
1764 *****************************************************************************/
1770 DT_FIELD **PFieldList = (DT_FIELD **) List;
1771 DT_SUBTABLE *Subtable;
1772 DT_SUBTABLE *ParentTable;
1776 /* Compile the main table */
1778 Status = DtCompileTable (PFieldList, AcpiDmTableInfoStao,
1780 if (ACPI_FAILURE (Status))
1785 ParentTable = DtPeekSubtable ();
1786 DtInsertSubtable (ParentTable, Subtable);
1788 /* Compile each ASCII namestring as a subtable */
1792 Status = DtCompileTable (PFieldList, AcpiDmTableInfoStaoStr,
1794 if (ACPI_FAILURE (Status))
1799 ParentTable = DtPeekSubtable ();
1800 DtInsertSubtable (ParentTable, Subtable);
1807 /******************************************************************************
1809 * FUNCTION: DtCompileTcpa
1811 * PARAMETERS: PFieldList - Current field list pointer
1815 * DESCRIPTION: Compile TCPA.
1817 *****************************************************************************/
1823 DT_FIELD **PFieldList = (DT_FIELD **) List;
1824 DT_SUBTABLE *Subtable;
1825 ACPI_TABLE_TCPA_HDR *TcpaHeader;
1826 DT_SUBTABLE *ParentTable;
1830 /* Compile the main table */
1832 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaHdr,
1834 if (ACPI_FAILURE (Status))
1839 ParentTable = DtPeekSubtable ();
1840 DtInsertSubtable (ParentTable, Subtable);
1843 * Examine the PlatformClass field to determine the table type.
1844 * Either a client or server table. Only one.
1846 TcpaHeader = ACPI_CAST_PTR (ACPI_TABLE_TCPA_HDR, ParentTable->Buffer);
1848 switch (TcpaHeader->PlatformClass)
1850 case ACPI_TCPA_CLIENT_TABLE:
1852 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaClient,
1856 case ACPI_TCPA_SERVER_TABLE:
1858 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTcpaServer,
1864 AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
1865 TcpaHeader->PlatformClass);
1870 ParentTable = DtPeekSubtable ();
1871 DtInsertSubtable (ParentTable, Subtable);
1876 /******************************************************************************
1878 * FUNCTION: DtCompileTpm2
1880 * PARAMETERS: PFieldList - Current field list pointer
1884 * DESCRIPTION: Compile TPM2.
1886 *****************************************************************************/
1892 DT_FIELD **PFieldList = (DT_FIELD **) List;
1893 DT_SUBTABLE *Subtable;
1894 ACPI_TABLE_TPM2 *Tpm2Header;
1895 DT_SUBTABLE *ParentTable;
1896 ACPI_STATUS Status = AE_OK;
1899 /* Compile the main table */
1901 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm2,
1903 if (ACPI_FAILURE (Status))
1908 ParentTable = DtPeekSubtable ();
1909 DtInsertSubtable (ParentTable, Subtable);
1911 Tpm2Header = ACPI_CAST_PTR (ACPI_TABLE_TPM2, ParentTable->Buffer);
1913 /* Method parameters */
1914 /* Optional: Log area minimum length */
1915 /* Optional: Log area start address */
1916 /* TBD: Optional fields above not fully implemented (not optional at this time) */
1918 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm2a,
1920 if (ACPI_FAILURE (Status))
1925 ParentTable = DtPeekSubtable ();
1926 DtInsertSubtable (ParentTable, Subtable);
1929 /* Subtable type depends on the StartMethod */
1931 switch (Tpm2Header->StartMethod)
1933 case ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC:
1935 /* Subtable specific to to ARM_SMC */
1937 Status = DtCompileTable (PFieldList, AcpiDmTableInfoTpm211,
1939 if (ACPI_FAILURE (Status))
1944 ParentTable = DtPeekSubtable ();
1945 DtInsertSubtable (ParentTable, Subtable);
1948 case ACPI_TPM2_START_METHOD:
1949 case ACPI_TPM2_MEMORY_MAPPED:
1950 case ACPI_TPM2_COMMAND_BUFFER:
1951 case ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD:
1954 case ACPI_TPM2_RESERVED1:
1955 case ACPI_TPM2_RESERVED3:
1956 case ACPI_TPM2_RESERVED4:
1957 case ACPI_TPM2_RESERVED5:
1958 case ACPI_TPM2_RESERVED9:
1959 case ACPI_TPM2_RESERVED10:
1961 AcpiOsPrintf ("\n**** Reserved TPM2 Start Method type 0x%X\n",
1962 Tpm2Header->StartMethod);
1966 case ACPI_TPM2_NOT_ALLOWED:
1969 AcpiOsPrintf ("\n**** Unknown TPM2 Start Method type 0x%X\n",
1970 Tpm2Header->StartMethod);
1979 /******************************************************************************
1981 * FUNCTION: DtGetGenericTableInfo
1983 * PARAMETERS: Name - Generic type name
1985 * RETURN: Info entry
1987 * DESCRIPTION: Obtain table info for a generic name entry
1989 *****************************************************************************/
1992 DtGetGenericTableInfo (
1995 ACPI_DMTABLE_INFO *Info;
2004 /* Search info table for name match */
2008 Info = AcpiDmTableInfoGeneric[i];
2009 if (Info->Opcode == ACPI_DMT_EXIT)
2015 /* Use caseless compare for generic keywords */
2017 if (!AcpiUtStricmp (Name, Info->Name))
2027 /******************************************************************************
2029 * FUNCTION: DtCompileUefi
2031 * PARAMETERS: List - Current field list pointer
2035 * DESCRIPTION: Compile UEFI.
2037 *****************************************************************************/
2044 DT_SUBTABLE *Subtable;
2045 DT_SUBTABLE *ParentTable;
2046 DT_FIELD **PFieldList = (DT_FIELD **) List;
2050 /* Compile the predefined portion of the UEFI table */
2052 Status = DtCompileTable (PFieldList, AcpiDmTableInfoUefi,
2054 if (ACPI_FAILURE (Status))
2059 DataOffset = (UINT16 *) (Subtable->Buffer + 16);
2060 *DataOffset = sizeof (ACPI_TABLE_UEFI);
2062 ParentTable = DtPeekSubtable ();
2063 DtInsertSubtable (ParentTable, Subtable);
2066 * Compile the "generic" portion of the UEFI table. This
2067 * part of the table is not predefined and any of the generic
2068 * operators may be used.
2070 DtCompileGeneric ((void **) PFieldList, NULL, NULL);
2075 /******************************************************************************
2077 * FUNCTION: DtCompileVrtc
2079 * PARAMETERS: List - Current field list pointer
2083 * DESCRIPTION: Compile VRTC.
2085 *****************************************************************************/
2094 Status = DtCompileTwoSubtables (List,
2095 AcpiDmTableInfoVrtc, AcpiDmTableInfoVrtc0);
2100 /******************************************************************************
2102 * FUNCTION: DtCompileWdat
2104 * PARAMETERS: List - Current field list pointer
2108 * DESCRIPTION: Compile WDAT.
2110 *****************************************************************************/
2119 Status = DtCompileTwoSubtables (List,
2120 AcpiDmTableInfoWdat, AcpiDmTableInfoWdat0);
2125 /******************************************************************************
2127 * FUNCTION: DtCompileWpbt
2129 * PARAMETERS: List - Current field list pointer
2133 * DESCRIPTION: Compile WPBT.
2135 *****************************************************************************/
2141 DT_FIELD **PFieldList = (DT_FIELD **) List;
2142 DT_SUBTABLE *Subtable;
2143 DT_SUBTABLE *ParentTable;
2144 ACPI_TABLE_WPBT *Table;
2149 /* Compile the main table */
2151 Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt,
2153 if (ACPI_FAILURE (Status))
2158 ParentTable = DtPeekSubtable ();
2159 DtInsertSubtable (ParentTable, Subtable);
2161 /* Compile the argument list subtable */
2163 Status = DtCompileTable (PFieldList, AcpiDmTableInfoWpbt0,
2165 if (ACPI_FAILURE (Status))
2170 /* Extract the length of the Arguments buffer, insert into main table */
2172 Length = (UINT16) Subtable->TotalLength;
2173 Table = ACPI_CAST_PTR (ACPI_TABLE_WPBT, ParentTable->Buffer);
2174 Table->ArgumentsLength = Length;
2176 ParentTable = DtPeekSubtable ();
2177 DtInsertSubtable (ParentTable, Subtable);
2182 /******************************************************************************
2184 * FUNCTION: DtCompileXsdt
2186 * PARAMETERS: List - Current field list pointer
2190 * DESCRIPTION: Compile XSDT.
2192 *****************************************************************************/
2198 DT_SUBTABLE *Subtable;
2199 DT_SUBTABLE *ParentTable;
2200 DT_FIELD *FieldList = *(DT_FIELD **) List;
2204 ParentTable = DtPeekSubtable ();
2208 DtCompileInteger ((UINT8 *) &Address, FieldList, 8, DT_NON_ZERO);
2210 DtCreateSubtable ((UINT8 *) &Address, 8, &Subtable);
2211 DtInsertSubtable (ParentTable, Subtable);
2212 FieldList = FieldList->Next;
2219 /******************************************************************************
2221 * FUNCTION: DtCompileGeneric
2223 * PARAMETERS: List - Current field list pointer
2224 * Name - Field name to end generic compiling
2225 * Length - Compiled table length to return
2229 * DESCRIPTION: Compile generic unknown table.
2231 *****************************************************************************/
2240 DT_SUBTABLE *Subtable;
2241 DT_SUBTABLE *ParentTable;
2242 DT_FIELD **PFieldList = (DT_FIELD **) List;
2243 ACPI_DMTABLE_INFO *Info;
2246 ParentTable = DtPeekSubtable ();
2249 * Compile the "generic" portion of the table. This
2250 * part of the table is not predefined and any of the generic
2251 * operators may be used.
2254 /* Find any and all labels in the entire generic portion */
2256 DtDetectAllLabels (*PFieldList);
2258 /* Now we can actually compile the parse tree */
2260 if (Length && *Length)
2266 if (Name && !strcmp ((*PFieldList)->Name, Name))
2271 Info = DtGetGenericTableInfo ((*PFieldList)->Name);
2274 sprintf (MsgBuffer, "Generic data type \"%s\" not found",
2275 (*PFieldList)->Name);
2276 DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
2277 (*PFieldList), MsgBuffer);
2279 *PFieldList = (*PFieldList)->Next;
2283 Status = DtCompileTable (PFieldList, Info,
2285 if (ACPI_SUCCESS (Status))
2287 DtInsertSubtable (ParentTable, Subtable);
2290 *Length += Subtable->Length;
2295 *PFieldList = (*PFieldList)->Next;
2297 if (Status == AE_NOT_FOUND)
2299 sprintf (MsgBuffer, "Generic data type \"%s\" not found",
2300 (*PFieldList)->Name);
2301 DtNameError (ASL_ERROR, ASL_MSG_INVALID_FIELD_NAME,
2302 (*PFieldList), MsgBuffer);