1 /******************************************************************************
3 * Module Name: dttable1.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 A-I */
154 #include <contrib/dev/acpica/compiler/aslcompiler.h>
155 #include <contrib/dev/acpica/compiler/dtcompiler.h>
157 #define _COMPONENT DT_COMPILER
158 ACPI_MODULE_NAME ("dttable1")
161 static ACPI_DMTABLE_INFO TableInfoAsfAddress[] =
163 {ACPI_DMT_BUFFER, 0, "Addresses", 0},
164 {ACPI_DMT_EXIT, 0, NULL, 0}
167 static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] =
169 {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0},
170 {ACPI_DMT_EXIT, 0, NULL, 0}
174 /******************************************************************************
176 * FUNCTION: DtCompileAsf
178 * PARAMETERS: List - Current field list pointer
182 * DESCRIPTION: Compile ASF!.
184 *****************************************************************************/
190 ACPI_ASF_INFO *AsfTable;
191 DT_SUBTABLE *Subtable;
192 DT_SUBTABLE *ParentTable;
193 ACPI_DMTABLE_INFO *InfoTable;
194 ACPI_DMTABLE_INFO *DataInfoTable = NULL;
195 UINT32 DataCount = 0;
198 DT_FIELD **PFieldList = (DT_FIELD **) List;
199 DT_FIELD *SubtableStart;
204 SubtableStart = *PFieldList;
205 Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
207 if (ACPI_FAILURE (Status))
212 ParentTable = DtPeekSubtable ();
213 DtInsertSubtable (ParentTable, Subtable);
214 DtPushSubtable (Subtable);
216 AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
218 switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
220 case ACPI_ASF_TYPE_INFO:
222 InfoTable = AcpiDmTableInfoAsf0;
225 case ACPI_ASF_TYPE_ALERT:
227 InfoTable = AcpiDmTableInfoAsf1;
230 case ACPI_ASF_TYPE_CONTROL:
232 InfoTable = AcpiDmTableInfoAsf2;
235 case ACPI_ASF_TYPE_BOOT:
237 InfoTable = AcpiDmTableInfoAsf3;
240 case ACPI_ASF_TYPE_ADDRESS:
242 InfoTable = AcpiDmTableInfoAsf4;
247 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
251 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
252 if (ACPI_FAILURE (Status))
257 ParentTable = DtPeekSubtable ();
258 DtInsertSubtable (ParentTable, Subtable);
260 switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
262 case ACPI_ASF_TYPE_INFO:
264 DataInfoTable = NULL;
267 case ACPI_ASF_TYPE_ALERT:
269 DataInfoTable = AcpiDmTableInfoAsf1a;
270 DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
271 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
272 sizeof (ACPI_ASF_HEADER)))->Alerts;
275 case ACPI_ASF_TYPE_CONTROL:
277 DataInfoTable = AcpiDmTableInfoAsf2a;
278 DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
279 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
280 sizeof (ACPI_ASF_HEADER)))->Controls;
283 case ACPI_ASF_TYPE_BOOT:
285 DataInfoTable = NULL;
288 case ACPI_ASF_TYPE_ADDRESS:
290 DataInfoTable = TableInfoAsfAddress;
291 DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
292 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
293 sizeof (ACPI_ASF_HEADER)))->Devices;
298 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
304 switch (AsfTable->Header.Type & 0x7F)
306 case ACPI_ASF_TYPE_ADDRESS:
308 while (DataCount > 0)
310 Status = DtCompileTable (PFieldList, DataInfoTable,
312 if (ACPI_FAILURE (Status))
317 DtInsertSubtable (ParentTable, Subtable);
318 DataCount = DataCount - Subtable->Length;
324 for (i = 0; i < DataCount; i++)
326 Status = DtCompileTable (PFieldList, DataInfoTable,
328 if (ACPI_FAILURE (Status))
333 DtInsertSubtable (ParentTable, Subtable);
346 /******************************************************************************
348 * FUNCTION: DtCompileCpep
350 * PARAMETERS: List - Current field list pointer
354 * DESCRIPTION: Compile CPEP.
356 *****************************************************************************/
365 Status = DtCompileTwoSubtables (List,
366 AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
371 /******************************************************************************
373 * FUNCTION: DtCompileCsrt
375 * PARAMETERS: List - Current field list pointer
379 * DESCRIPTION: Compile CSRT.
381 *****************************************************************************/
387 ACPI_STATUS Status = AE_OK;
388 DT_SUBTABLE *Subtable;
389 DT_SUBTABLE *ParentTable;
390 DT_FIELD **PFieldList = (DT_FIELD **) List;
391 UINT32 DescriptorCount;
395 /* Subtables (Resource Groups) */
397 ParentTable = DtPeekSubtable ();
400 /* Resource group subtable */
402 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0,
404 if (ACPI_FAILURE (Status))
409 /* Compute the number of resource descriptors */
412 (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
413 Subtable->Buffer))->Length -
414 (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
415 Subtable->Buffer))->SharedInfoLength -
416 sizeof (ACPI_CSRT_GROUP);
418 DescriptorCount = (GroupLength /
419 sizeof (ACPI_CSRT_DESCRIPTOR));
421 DtInsertSubtable (ParentTable, Subtable);
422 DtPushSubtable (Subtable);
423 ParentTable = DtPeekSubtable ();
425 /* Shared info subtable (One per resource group) */
427 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1,
429 if (ACPI_FAILURE (Status))
434 DtInsertSubtable (ParentTable, Subtable);
436 /* Sub-Subtables (Resource Descriptors) */
438 while (*PFieldList && DescriptorCount)
441 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
443 if (ACPI_FAILURE (Status))
448 DtInsertSubtable (ParentTable, Subtable);
450 DtPushSubtable (Subtable);
451 ParentTable = DtPeekSubtable ();
454 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
456 if (ACPI_FAILURE (Status))
462 DtInsertSubtable (ParentTable, Subtable);
467 ParentTable = DtPeekSubtable ();
472 ParentTable = DtPeekSubtable ();
479 /******************************************************************************
481 * FUNCTION: DtCompileDbg2
483 * PARAMETERS: List - Current field list pointer
487 * DESCRIPTION: Compile DBG2.
489 *****************************************************************************/
496 DT_SUBTABLE *Subtable;
497 DT_SUBTABLE *ParentTable;
498 DT_FIELD **PFieldList = (DT_FIELD **) List;
499 UINT32 SubtableCount;
500 ACPI_DBG2_HEADER *Dbg2Header;
501 ACPI_DBG2_DEVICE *DeviceInfo;
502 UINT16 CurrentOffset;
508 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
509 if (ACPI_FAILURE (Status))
514 ParentTable = DtPeekSubtable ();
515 DtInsertSubtable (ParentTable, Subtable);
517 /* Main table fields */
519 Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
520 Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
521 ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
523 SubtableCount = Dbg2Header->InfoCount;
524 DtPushSubtable (Subtable);
526 /* Process all Device Information subtables (Count = InfoCount) */
528 while (*PFieldList && SubtableCount)
530 /* Subtable: Debug Device Information */
532 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
534 if (ACPI_FAILURE (Status))
539 DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
540 CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
542 ParentTable = DtPeekSubtable ();
543 DtInsertSubtable (ParentTable, Subtable);
544 DtPushSubtable (Subtable);
546 ParentTable = DtPeekSubtable ();
548 /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
550 DeviceInfo->BaseAddressOffset = CurrentOffset;
551 for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
553 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
555 if (ACPI_FAILURE (Status))
560 CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
561 DtInsertSubtable (ParentTable, Subtable);
564 /* AddressSize array (Required, size = RegisterCount) */
566 DeviceInfo->AddressSizeOffset = CurrentOffset;
567 for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
569 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
571 if (ACPI_FAILURE (Status))
576 CurrentOffset += (UINT16) sizeof (UINT32);
577 DtInsertSubtable (ParentTable, Subtable);
580 /* NamespaceString device identifier (Required, size = NamePathLength) */
582 DeviceInfo->NamepathOffset = CurrentOffset;
583 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
585 if (ACPI_FAILURE (Status))
590 /* Update the device info header */
592 DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
593 CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
594 DtInsertSubtable (ParentTable, Subtable);
596 /* OemData - Variable-length data (Optional, size = OemDataLength) */
598 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
600 if (ACPI_FAILURE (Status))
605 /* Update the device info header (zeros if no OEM data present) */
607 DeviceInfo->OemDataOffset = 0;
608 DeviceInfo->OemDataLength = 0;
610 /* Optional subtable (OemData) */
612 if (Subtable && Subtable->Length)
614 DeviceInfo->OemDataOffset = CurrentOffset;
615 DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
617 DtInsertSubtable (ParentTable, Subtable);
621 DtPopSubtable (); /* Get next Device Information subtable */
629 /******************************************************************************
631 * FUNCTION: DtCompileDmar
633 * PARAMETERS: List - Current field list pointer
637 * DESCRIPTION: Compile DMAR.
639 *****************************************************************************/
646 DT_SUBTABLE *Subtable;
647 DT_SUBTABLE *ParentTable;
648 DT_FIELD **PFieldList = (DT_FIELD **) List;
649 DT_FIELD *SubtableStart;
650 ACPI_DMTABLE_INFO *InfoTable;
651 ACPI_DMAR_HEADER *DmarHeader;
652 ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
653 UINT32 DeviceScopeLength;
654 UINT32 PciPathLength;
657 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
658 if (ACPI_FAILURE (Status))
663 ParentTable = DtPeekSubtable ();
664 DtInsertSubtable (ParentTable, Subtable);
665 DtPushSubtable (Subtable);
671 SubtableStart = *PFieldList;
672 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
674 if (ACPI_FAILURE (Status))
679 ParentTable = DtPeekSubtable ();
680 DtInsertSubtable (ParentTable, Subtable);
681 DtPushSubtable (Subtable);
683 DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
685 switch (DmarHeader->Type)
687 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
689 InfoTable = AcpiDmTableInfoDmar0;
692 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
694 InfoTable = AcpiDmTableInfoDmar1;
697 case ACPI_DMAR_TYPE_ROOT_ATS:
699 InfoTable = AcpiDmTableInfoDmar2;
702 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
704 InfoTable = AcpiDmTableInfoDmar3;
707 case ACPI_DMAR_TYPE_NAMESPACE:
709 InfoTable = AcpiDmTableInfoDmar4;
714 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
720 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
721 if (ACPI_FAILURE (Status))
726 ParentTable = DtPeekSubtable ();
727 DtInsertSubtable (ParentTable, Subtable);
730 * Optional Device Scope subtables
732 if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
733 (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
735 /* These types do not support device scopes */
741 DtPushSubtable (Subtable);
742 DeviceScopeLength = DmarHeader->Length - Subtable->Length -
744 while (DeviceScopeLength)
746 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
748 if (Status == AE_NOT_FOUND)
753 ParentTable = DtPeekSubtable ();
754 DtInsertSubtable (ParentTable, Subtable);
755 DtPushSubtable (Subtable);
757 DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
759 /* Optional PCI Paths */
761 PciPathLength = DmarDeviceScope->Length - Subtable->Length;
762 while (PciPathLength)
764 Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
766 if (Status == AE_NOT_FOUND)
772 ParentTable = DtPeekSubtable ();
773 DtInsertSubtable (ParentTable, Subtable);
774 PciPathLength -= Subtable->Length;
778 DeviceScopeLength -= DmarDeviceScope->Length;
789 /******************************************************************************
791 * FUNCTION: DtCompileDrtm
793 * PARAMETERS: List - Current field list pointer
797 * DESCRIPTION: Compile DRTM.
799 *****************************************************************************/
806 DT_SUBTABLE *Subtable;
807 DT_SUBTABLE *ParentTable;
808 DT_FIELD **PFieldList = (DT_FIELD **) List;
810 /* ACPI_TABLE_DRTM *Drtm; */
811 ACPI_DRTM_VTABLE_LIST *DrtmVtl;
812 ACPI_DRTM_RESOURCE_LIST *DrtmRl;
813 /* ACPI_DRTM_DPS_ID *DrtmDps; */
816 ParentTable = DtPeekSubtable ();
818 /* Compile DRTM header */
820 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm,
822 if (ACPI_FAILURE (Status))
826 DtInsertSubtable (ParentTable, Subtable);
829 * Using ACPI_SUB_PTR, We needn't define a seperate structure. Care
830 * should be taken to avoid accessing ACPI_TABLE_HADER fields.
833 Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM,
834 Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
838 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0,
840 if (ACPI_FAILURE (Status))
845 DtInsertSubtable (ParentTable, Subtable);
846 DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer);
848 DtPushSubtable (Subtable);
849 ParentTable = DtPeekSubtable ();
854 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a,
856 if (ACPI_FAILURE (Status))
864 DtInsertSubtable (ParentTable, Subtable);
868 DrtmVtl->ValidatedTableCount = Count;
870 ParentTable = DtPeekSubtable ();
874 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1,
876 if (ACPI_FAILURE (Status))
881 DtInsertSubtable (ParentTable, Subtable);
882 DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer);
884 DtPushSubtable (Subtable);
885 ParentTable = DtPeekSubtable ();
890 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a,
892 if (ACPI_FAILURE (Status))
902 DtInsertSubtable (ParentTable, Subtable);
906 DrtmRl->ResourceCount = Count;
908 ParentTable = DtPeekSubtable ();
912 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2,
914 if (ACPI_FAILURE (Status))
918 DtInsertSubtable (ParentTable, Subtable);
919 /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/
926 /******************************************************************************
928 * FUNCTION: DtCompileEinj
930 * PARAMETERS: List - Current field list pointer
934 * DESCRIPTION: Compile EINJ.
936 *****************************************************************************/
945 Status = DtCompileTwoSubtables (List,
946 AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
951 /******************************************************************************
953 * FUNCTION: DtCompileErst
955 * PARAMETERS: List - Current field list pointer
959 * DESCRIPTION: Compile ERST.
961 *****************************************************************************/
970 Status = DtCompileTwoSubtables (List,
971 AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
976 /******************************************************************************
978 * FUNCTION: DtCompileGtdt
980 * PARAMETERS: List - Current field list pointer
984 * DESCRIPTION: Compile GTDT.
986 *****************************************************************************/
993 DT_SUBTABLE *Subtable;
994 DT_SUBTABLE *ParentTable;
995 DT_FIELD **PFieldList = (DT_FIELD **) List;
996 DT_FIELD *SubtableStart;
997 ACPI_SUBTABLE_HEADER *GtdtHeader;
998 ACPI_DMTABLE_INFO *InfoTable;
1002 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
1004 if (ACPI_FAILURE (Status))
1009 ParentTable = DtPeekSubtable ();
1010 DtInsertSubtable (ParentTable, Subtable);
1014 SubtableStart = *PFieldList;
1015 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
1017 if (ACPI_FAILURE (Status))
1022 ParentTable = DtPeekSubtable ();
1023 DtInsertSubtable (ParentTable, Subtable);
1024 DtPushSubtable (Subtable);
1026 GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
1028 switch (GtdtHeader->Type)
1030 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1032 InfoTable = AcpiDmTableInfoGtdt0;
1035 case ACPI_GTDT_TYPE_WATCHDOG:
1037 InfoTable = AcpiDmTableInfoGtdt1;
1042 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
1046 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1047 if (ACPI_FAILURE (Status))
1052 ParentTable = DtPeekSubtable ();
1053 DtInsertSubtable (ParentTable, Subtable);
1056 * Additional GT block subtable data
1059 switch (GtdtHeader->Type)
1061 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1063 DtPushSubtable (Subtable);
1064 ParentTable = DtPeekSubtable ();
1066 GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
1067 Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
1071 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
1073 if (ACPI_FAILURE (Status))
1078 DtInsertSubtable (ParentTable, Subtable);
1097 /******************************************************************************
1099 * FUNCTION: DtCompileFpdt
1101 * PARAMETERS: List - Current field list pointer
1105 * DESCRIPTION: Compile FPDT.
1107 *****************************************************************************/
1114 ACPI_FPDT_HEADER *FpdtHeader;
1115 DT_SUBTABLE *Subtable;
1116 DT_SUBTABLE *ParentTable;
1117 ACPI_DMTABLE_INFO *InfoTable;
1118 DT_FIELD **PFieldList = (DT_FIELD **) List;
1119 DT_FIELD *SubtableStart;
1124 SubtableStart = *PFieldList;
1125 Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr,
1127 if (ACPI_FAILURE (Status))
1132 ParentTable = DtPeekSubtable ();
1133 DtInsertSubtable (ParentTable, Subtable);
1134 DtPushSubtable (Subtable);
1136 FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
1138 switch (FpdtHeader->Type)
1140 case ACPI_FPDT_TYPE_BOOT:
1142 InfoTable = AcpiDmTableInfoFpdt0;
1145 case ACPI_FPDT_TYPE_S3PERF:
1147 InfoTable = AcpiDmTableInfoFpdt1;
1152 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT");
1157 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1158 if (ACPI_FAILURE (Status))
1163 ParentTable = DtPeekSubtable ();
1164 DtInsertSubtable (ParentTable, Subtable);
1172 /******************************************************************************
1174 * FUNCTION: DtCompileHest
1176 * PARAMETERS: List - Current field list pointer
1180 * DESCRIPTION: Compile HEST.
1182 *****************************************************************************/
1189 DT_SUBTABLE *Subtable;
1190 DT_SUBTABLE *ParentTable;
1191 DT_FIELD **PFieldList = (DT_FIELD **) List;
1192 DT_FIELD *SubtableStart;
1193 ACPI_DMTABLE_INFO *InfoTable;
1198 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
1200 if (ACPI_FAILURE (Status))
1205 ParentTable = DtPeekSubtable ();
1206 DtInsertSubtable (ParentTable, Subtable);
1210 /* Get subtable type */
1212 SubtableStart = *PFieldList;
1213 DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
1217 case ACPI_HEST_TYPE_IA32_CHECK:
1219 InfoTable = AcpiDmTableInfoHest0;
1222 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1224 InfoTable = AcpiDmTableInfoHest1;
1227 case ACPI_HEST_TYPE_IA32_NMI:
1229 InfoTable = AcpiDmTableInfoHest2;
1232 case ACPI_HEST_TYPE_AER_ROOT_PORT:
1234 InfoTable = AcpiDmTableInfoHest6;
1237 case ACPI_HEST_TYPE_AER_ENDPOINT:
1239 InfoTable = AcpiDmTableInfoHest7;
1242 case ACPI_HEST_TYPE_AER_BRIDGE:
1244 InfoTable = AcpiDmTableInfoHest8;
1247 case ACPI_HEST_TYPE_GENERIC_ERROR:
1249 InfoTable = AcpiDmTableInfoHest9;
1252 case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
1254 InfoTable = AcpiDmTableInfoHest10;
1257 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1259 InfoTable = AcpiDmTableInfoHest11;
1264 /* Cannot continue on unknown type */
1266 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
1270 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1271 if (ACPI_FAILURE (Status))
1276 DtInsertSubtable (ParentTable, Subtable);
1279 * Additional subtable data - IA32 Error Bank(s)
1284 case ACPI_HEST_TYPE_IA32_CHECK:
1286 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
1287 Subtable->Buffer))->NumHardwareBanks;
1290 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1292 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
1293 Subtable->Buffer))->NumHardwareBanks;
1296 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1298 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
1299 Subtable->Buffer))->NumHardwareBanks;
1309 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
1311 if (ACPI_FAILURE (Status))
1316 DtInsertSubtable (ParentTable, Subtable);
1325 /******************************************************************************
1327 * FUNCTION: DtCompileHmat
1329 * PARAMETERS: List - Current field list pointer
1333 * DESCRIPTION: Compile HMAT.
1335 *****************************************************************************/
1342 DT_SUBTABLE *Subtable;
1343 DT_SUBTABLE *ParentTable;
1344 DT_FIELD **PFieldList = (DT_FIELD **) List;
1345 DT_FIELD *SubtableStart;
1346 DT_FIELD *EntryStart;
1347 ACPI_HMAT_STRUCTURE *HmatStruct;
1348 ACPI_HMAT_LOCALITY *HmatLocality;
1349 ACPI_HMAT_CACHE *HmatCache;
1350 ACPI_DMTABLE_INFO *InfoTable;
1354 UINT16 SMBIOSHandleNumber;
1357 ParentTable = DtPeekSubtable ();
1359 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat,
1361 if (ACPI_FAILURE (Status))
1365 DtInsertSubtable (ParentTable, Subtable);
1369 /* Compile HMAT structure header */
1371 SubtableStart = *PFieldList;
1372 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmatHdr,
1374 if (ACPI_FAILURE (Status))
1378 DtInsertSubtable (ParentTable, Subtable);
1380 HmatStruct = ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE, Subtable->Buffer);
1381 HmatStruct->Length = Subtable->Length;
1383 /* Compile HMAT structure body */
1385 switch (HmatStruct->Type)
1387 case ACPI_HMAT_TYPE_ADDRESS_RANGE:
1389 InfoTable = AcpiDmTableInfoHmat0;
1392 case ACPI_HMAT_TYPE_LOCALITY:
1394 InfoTable = AcpiDmTableInfoHmat1;
1397 case ACPI_HMAT_TYPE_CACHE:
1399 InfoTable = AcpiDmTableInfoHmat2;
1404 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HMAT");
1408 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1409 if (ACPI_FAILURE (Status))
1413 DtInsertSubtable (ParentTable, Subtable);
1414 HmatStruct->Length += Subtable->Length;
1416 /* Compile HMAT structure additionals */
1418 switch (HmatStruct->Type)
1420 case ACPI_HMAT_TYPE_LOCALITY:
1422 HmatLocality = ACPI_SUB_PTR (ACPI_HMAT_LOCALITY,
1423 Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
1425 /* Compile initiator proximity domain list */
1430 Status = DtCompileTable (PFieldList,
1431 AcpiDmTableInfoHmat1a, &Subtable, TRUE);
1432 if (ACPI_FAILURE (Status))
1440 DtInsertSubtable (ParentTable, Subtable);
1441 HmatStruct->Length += Subtable->Length;
1444 HmatLocality->NumberOfInitiatorPDs = IntPDNumber;
1446 /* Compile target proximity domain list */
1451 Status = DtCompileTable (PFieldList,
1452 AcpiDmTableInfoHmat1b, &Subtable, TRUE);
1453 if (ACPI_FAILURE (Status))
1461 DtInsertSubtable (ParentTable, Subtable);
1462 HmatStruct->Length += Subtable->Length;
1465 HmatLocality->NumberOfTargetPDs = TgtPDNumber;
1467 /* Save start of the entries for reporting errors */
1469 EntryStart = *PFieldList;
1471 /* Compile latency/bandwidth entries */
1476 Status = DtCompileTable (PFieldList,
1477 AcpiDmTableInfoHmat1c, &Subtable, TRUE);
1478 if (ACPI_FAILURE (Status))
1486 DtInsertSubtable (ParentTable, Subtable);
1487 HmatStruct->Length += Subtable->Length;
1491 /* Validate number of entries */
1494 ((UINT64)IntPDNumber * (UINT64)TgtPDNumber))
1496 DtFatal (ASL_MSG_INVALID_EXPRESSION, EntryStart, "HMAT");
1501 case ACPI_HMAT_TYPE_CACHE:
1503 /* Compile SMBIOS handles */
1505 HmatCache = ACPI_SUB_PTR (ACPI_HMAT_CACHE,
1506 Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
1507 SMBIOSHandleNumber = 0;
1510 Status = DtCompileTable (PFieldList,
1511 AcpiDmTableInfoHmat2a, &Subtable, TRUE);
1512 if (ACPI_FAILURE (Status))
1520 DtInsertSubtable (ParentTable, Subtable);
1521 HmatStruct->Length += Subtable->Length;
1522 SMBIOSHandleNumber++;
1524 HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber;
1537 /******************************************************************************
1539 * FUNCTION: DtCompileIort
1541 * PARAMETERS: List - Current field list pointer
1545 * DESCRIPTION: Compile IORT.
1547 *****************************************************************************/
1554 DT_SUBTABLE *Subtable;
1555 DT_SUBTABLE *ParentTable;
1556 DT_FIELD **PFieldList = (DT_FIELD **) List;
1557 DT_FIELD *SubtableStart;
1558 ACPI_TABLE_IORT *Iort;
1559 ACPI_IORT_NODE *IortNode;
1560 ACPI_IORT_ITS_GROUP *IortItsGroup;
1561 ACPI_IORT_SMMU *IortSmmu;
1564 UINT32 IdMappingNumber;
1566 UINT32 ContextIrptNumber;
1567 UINT32 PmuIrptNumber;
1568 UINT32 PaddingLength;
1571 ParentTable = DtPeekSubtable ();
1573 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort,
1575 if (ACPI_FAILURE (Status))
1579 DtInsertSubtable (ParentTable, Subtable);
1582 * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
1583 * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
1585 Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
1586 Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
1589 * OptionalPadding - Variable-length data
1590 * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
1591 * Optionally allows the generic data types to be used for filling
1594 Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
1595 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
1597 if (ACPI_FAILURE (Status))
1603 DtInsertSubtable (ParentTable, Subtable);
1604 Iort->NodeOffset += Subtable->Length;
1608 Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList),
1609 AcpiDmTableInfoIortHdr[0].Name, &PaddingLength);
1610 if (ACPI_FAILURE (Status))
1614 Iort->NodeOffset += PaddingLength;
1620 SubtableStart = *PFieldList;
1621 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr,
1623 if (ACPI_FAILURE (Status))
1628 DtInsertSubtable (ParentTable, Subtable);
1629 IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer);
1630 NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
1632 DtPushSubtable (Subtable);
1633 ParentTable = DtPeekSubtable ();
1635 switch (IortNode->Type)
1637 case ACPI_IORT_NODE_ITS_GROUP:
1639 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0,
1641 if (ACPI_FAILURE (Status))
1646 DtInsertSubtable (ParentTable, Subtable);
1647 IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer);
1648 NodeLength += Subtable->Length;
1653 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a,
1655 if (ACPI_FAILURE (Status))
1664 DtInsertSubtable (ParentTable, Subtable);
1665 NodeLength += Subtable->Length;
1669 IortItsGroup->ItsCount = ItsNumber;
1672 case ACPI_IORT_NODE_NAMED_COMPONENT:
1674 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1,
1676 if (ACPI_FAILURE (Status))
1681 DtInsertSubtable (ParentTable, Subtable);
1682 NodeLength += Subtable->Length;
1685 * Padding - Variable-length data
1686 * Optionally allows the offset of the ID mappings to be used
1687 * for filling this field.
1689 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a,
1691 if (ACPI_FAILURE (Status))
1698 DtInsertSubtable (ParentTable, Subtable);
1699 NodeLength += Subtable->Length;
1703 if (NodeLength > IortNode->MappingOffset)
1705 return (AE_BAD_DATA);
1708 if (NodeLength < IortNode->MappingOffset)
1710 Status = DtCompilePadding (
1711 IortNode->MappingOffset - NodeLength,
1713 if (ACPI_FAILURE (Status))
1718 DtInsertSubtable (ParentTable, Subtable);
1719 NodeLength = IortNode->MappingOffset;
1724 case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
1726 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2,
1728 if (ACPI_FAILURE (Status))
1733 DtInsertSubtable (ParentTable, Subtable);
1734 NodeLength += Subtable->Length;
1737 case ACPI_IORT_NODE_SMMU:
1739 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3,
1741 if (ACPI_FAILURE (Status))
1746 DtInsertSubtable (ParentTable, Subtable);
1747 IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer);
1748 NodeLength += Subtable->Length;
1750 /* Compile global interrupt array */
1752 IortSmmu->GlobalInterruptOffset = NodeLength;
1753 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
1755 if (ACPI_FAILURE (Status))
1760 DtInsertSubtable (ParentTable, Subtable);
1761 NodeLength += Subtable->Length;
1763 /* Compile context interrupt array */
1765 ContextIrptNumber = 0;
1766 IortSmmu->ContextInterruptOffset = NodeLength;
1769 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
1771 if (ACPI_FAILURE (Status))
1781 DtInsertSubtable (ParentTable, Subtable);
1782 NodeLength += Subtable->Length;
1783 ContextIrptNumber++;
1786 IortSmmu->ContextInterruptCount = ContextIrptNumber;
1788 /* Compile PMU interrupt array */
1791 IortSmmu->PmuInterruptOffset = NodeLength;
1794 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
1796 if (ACPI_FAILURE (Status))
1806 DtInsertSubtable (ParentTable, Subtable);
1807 NodeLength += Subtable->Length;
1811 IortSmmu->PmuInterruptCount = PmuIrptNumber;
1814 case ACPI_IORT_NODE_SMMU_V3:
1816 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort4,
1818 if (ACPI_FAILURE (Status))
1823 DtInsertSubtable (ParentTable, Subtable);
1824 NodeLength += Subtable->Length;
1829 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
1833 /* Compile Array of ID mappings */
1835 IortNode->MappingOffset = NodeLength;
1836 IdMappingNumber = 0;
1839 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap,
1841 if (ACPI_FAILURE (Status))
1851 DtInsertSubtable (ParentTable, Subtable);
1852 NodeLength += sizeof (ACPI_IORT_ID_MAPPING);
1856 IortNode->MappingCount = IdMappingNumber;
1857 if (!IdMappingNumber)
1859 IortNode->MappingOffset = 0;
1863 * Node length can be determined by DT_LENGTH option
1864 * IortNode->Length = NodeLength;
1867 ParentTable = DtPeekSubtable ();
1871 Iort->NodeCount = NodeNumber;
1876 /******************************************************************************
1878 * FUNCTION: DtCompileIvrs
1880 * PARAMETERS: List - Current field list pointer
1884 * DESCRIPTION: Compile IVRS.
1886 *****************************************************************************/
1893 DT_SUBTABLE *Subtable;
1894 DT_SUBTABLE *ParentTable;
1895 DT_FIELD **PFieldList = (DT_FIELD **) List;
1896 DT_FIELD *SubtableStart;
1897 ACPI_DMTABLE_INFO *InfoTable;
1898 ACPI_IVRS_HEADER *IvrsHeader;
1902 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
1904 if (ACPI_FAILURE (Status))
1909 ParentTable = DtPeekSubtable ();
1910 DtInsertSubtable (ParentTable, Subtable);
1914 SubtableStart = *PFieldList;
1915 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
1917 if (ACPI_FAILURE (Status))
1922 ParentTable = DtPeekSubtable ();
1923 DtInsertSubtable (ParentTable, Subtable);
1924 DtPushSubtable (Subtable);
1926 IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
1928 switch (IvrsHeader->Type)
1930 case ACPI_IVRS_TYPE_HARDWARE:
1932 InfoTable = AcpiDmTableInfoIvrs0;
1935 case ACPI_IVRS_TYPE_MEMORY1:
1936 case ACPI_IVRS_TYPE_MEMORY2:
1937 case ACPI_IVRS_TYPE_MEMORY3:
1939 InfoTable = AcpiDmTableInfoIvrs1;
1944 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
1948 Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
1949 if (ACPI_FAILURE (Status))
1954 ParentTable = DtPeekSubtable ();
1955 DtInsertSubtable (ParentTable, Subtable);
1957 if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE)
1959 while (*PFieldList &&
1960 !strcmp ((*PFieldList)->Name, "Entry Type"))
1962 SubtableStart = *PFieldList;
1963 DtCompileInteger (&EntryType, *PFieldList, 1, 0);
1967 /* 4-byte device entries */
1969 case ACPI_IVRS_TYPE_PAD4:
1970 case ACPI_IVRS_TYPE_ALL:
1971 case ACPI_IVRS_TYPE_SELECT:
1972 case ACPI_IVRS_TYPE_START:
1973 case ACPI_IVRS_TYPE_END:
1975 InfoTable = AcpiDmTableInfoIvrs4;
1978 /* 8-byte entries, type A */
1980 case ACPI_IVRS_TYPE_ALIAS_SELECT:
1981 case ACPI_IVRS_TYPE_ALIAS_START:
1983 InfoTable = AcpiDmTableInfoIvrs8a;
1986 /* 8-byte entries, type B */
1988 case ACPI_IVRS_TYPE_PAD8:
1989 case ACPI_IVRS_TYPE_EXT_SELECT:
1990 case ACPI_IVRS_TYPE_EXT_START:
1992 InfoTable = AcpiDmTableInfoIvrs8b;
1995 /* 8-byte entries, type C */
1997 case ACPI_IVRS_TYPE_SPECIAL:
1999 InfoTable = AcpiDmTableInfoIvrs8c;
2004 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
2005 "IVRS Device Entry");
2009 Status = DtCompileTable (PFieldList, InfoTable,
2011 if (ACPI_FAILURE (Status))
2016 DtInsertSubtable (ParentTable, Subtable);