1 /******************************************************************************
3 * Module Name: dttable1.c - handling for specific ACPI tables
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2020, 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 "aslcompiler.h"
156 #define _COMPONENT DT_COMPILER
157 ACPI_MODULE_NAME ("dttable1")
160 static ACPI_DMTABLE_INFO TableInfoAsfAddress[] =
162 {ACPI_DMT_BUFFER, 0, "Addresses", 0},
163 {ACPI_DMT_EXIT, 0, NULL, 0}
166 static ACPI_DMTABLE_INFO TableInfoDmarPciPath[] =
168 {ACPI_DMT_PCI_PATH, 0, "PCI Path", 0},
169 {ACPI_DMT_EXIT, 0, NULL, 0}
173 /******************************************************************************
175 * FUNCTION: DtCompileAsf
177 * PARAMETERS: List - Current field list pointer
181 * DESCRIPTION: Compile ASF!.
183 *****************************************************************************/
189 ACPI_ASF_INFO *AsfTable;
190 DT_SUBTABLE *Subtable;
191 DT_SUBTABLE *ParentTable;
192 ACPI_DMTABLE_INFO *InfoTable;
193 ACPI_DMTABLE_INFO *DataInfoTable = NULL;
194 UINT32 DataCount = 0;
197 DT_FIELD **PFieldList = (DT_FIELD **) List;
198 DT_FIELD *SubtableStart;
203 SubtableStart = *PFieldList;
204 Status = DtCompileTable (PFieldList, AcpiDmTableInfoAsfHdr,
206 if (ACPI_FAILURE (Status))
211 ParentTable = DtPeekSubtable ();
212 DtInsertSubtable (ParentTable, Subtable);
213 DtPushSubtable (Subtable);
215 AsfTable = ACPI_CAST_PTR (ACPI_ASF_INFO, Subtable->Buffer);
217 switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
219 case ACPI_ASF_TYPE_INFO:
221 InfoTable = AcpiDmTableInfoAsf0;
224 case ACPI_ASF_TYPE_ALERT:
226 InfoTable = AcpiDmTableInfoAsf1;
229 case ACPI_ASF_TYPE_CONTROL:
231 InfoTable = AcpiDmTableInfoAsf2;
234 case ACPI_ASF_TYPE_BOOT:
236 InfoTable = AcpiDmTableInfoAsf3;
239 case ACPI_ASF_TYPE_ADDRESS:
241 InfoTable = AcpiDmTableInfoAsf4;
246 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
250 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
251 if (ACPI_FAILURE (Status))
256 ParentTable = DtPeekSubtable ();
257 DtInsertSubtable (ParentTable, Subtable);
259 switch (AsfTable->Header.Type & 0x7F) /* Mask off top bit */
261 case ACPI_ASF_TYPE_INFO:
263 DataInfoTable = NULL;
266 case ACPI_ASF_TYPE_ALERT:
268 DataInfoTable = AcpiDmTableInfoAsf1a;
269 DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT,
270 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
271 sizeof (ACPI_ASF_HEADER)))->Alerts;
274 case ACPI_ASF_TYPE_CONTROL:
276 DataInfoTable = AcpiDmTableInfoAsf2a;
277 DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE,
278 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
279 sizeof (ACPI_ASF_HEADER)))->Controls;
282 case ACPI_ASF_TYPE_BOOT:
284 DataInfoTable = NULL;
287 case ACPI_ASF_TYPE_ADDRESS:
289 DataInfoTable = TableInfoAsfAddress;
290 DataCount = ACPI_CAST_PTR (ACPI_ASF_ADDRESS,
291 ACPI_SUB_PTR (UINT8, Subtable->Buffer,
292 sizeof (ACPI_ASF_HEADER)))->Devices;
297 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "ASF!");
303 switch (AsfTable->Header.Type & 0x7F)
305 case ACPI_ASF_TYPE_ADDRESS:
307 while (DataCount > 0)
309 Status = DtCompileTable (PFieldList, DataInfoTable,
311 if (ACPI_FAILURE (Status))
316 DtInsertSubtable (ParentTable, Subtable);
317 DataCount = DataCount - Subtable->Length;
323 for (i = 0; i < DataCount; i++)
325 Status = DtCompileTable (PFieldList, DataInfoTable,
327 if (ACPI_FAILURE (Status))
332 DtInsertSubtable (ParentTable, Subtable);
345 /******************************************************************************
347 * FUNCTION: DtCompileCpep
349 * PARAMETERS: List - Current field list pointer
353 * DESCRIPTION: Compile CPEP.
355 *****************************************************************************/
364 Status = DtCompileTwoSubtables (List,
365 AcpiDmTableInfoCpep, AcpiDmTableInfoCpep0);
370 /******************************************************************************
372 * FUNCTION: DtCompileCsrt
374 * PARAMETERS: List - Current field list pointer
378 * DESCRIPTION: Compile CSRT.
380 *****************************************************************************/
386 ACPI_STATUS Status = AE_OK;
387 DT_SUBTABLE *Subtable;
388 DT_SUBTABLE *ParentTable;
389 DT_FIELD **PFieldList = (DT_FIELD **) List;
390 UINT32 DescriptorCount;
394 /* Subtables (Resource Groups) */
396 ParentTable = DtPeekSubtable ();
399 /* Resource group subtable */
401 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt0,
403 if (ACPI_FAILURE (Status))
408 /* Compute the number of resource descriptors */
411 (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
412 Subtable->Buffer))->Length -
413 (ACPI_CAST_PTR (ACPI_CSRT_GROUP,
414 Subtable->Buffer))->SharedInfoLength -
415 sizeof (ACPI_CSRT_GROUP);
417 DescriptorCount = (GroupLength /
418 sizeof (ACPI_CSRT_DESCRIPTOR));
420 DtInsertSubtable (ParentTable, Subtable);
421 DtPushSubtable (Subtable);
422 ParentTable = DtPeekSubtable ();
424 /* Shared info subtable (One per resource group) */
426 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt1,
428 if (ACPI_FAILURE (Status))
433 DtInsertSubtable (ParentTable, Subtable);
435 /* Sub-Subtables (Resource Descriptors) */
437 while (*PFieldList && DescriptorCount)
440 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2,
442 if (ACPI_FAILURE (Status))
447 DtInsertSubtable (ParentTable, Subtable);
449 DtPushSubtable (Subtable);
450 ParentTable = DtPeekSubtable ();
453 Status = DtCompileTable (PFieldList, AcpiDmTableInfoCsrt2a,
455 if (ACPI_FAILURE (Status))
461 DtInsertSubtable (ParentTable, Subtable);
466 ParentTable = DtPeekSubtable ();
471 ParentTable = DtPeekSubtable ();
478 /******************************************************************************
480 * FUNCTION: DtCompileDbg2
482 * PARAMETERS: List - Current field list pointer
486 * DESCRIPTION: Compile DBG2.
488 *****************************************************************************/
495 DT_SUBTABLE *Subtable;
496 DT_SUBTABLE *ParentTable;
497 DT_FIELD **PFieldList = (DT_FIELD **) List;
498 UINT32 SubtableCount;
499 ACPI_DBG2_HEADER *Dbg2Header;
500 ACPI_DBG2_DEVICE *DeviceInfo;
501 UINT16 CurrentOffset;
507 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable);
508 if (ACPI_FAILURE (Status))
513 ParentTable = DtPeekSubtable ();
514 DtInsertSubtable (ParentTable, Subtable);
516 /* Main table fields */
518 Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
519 Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
520 ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
522 SubtableCount = Dbg2Header->InfoCount;
523 DtPushSubtable (Subtable);
525 /* Process all Device Information subtables (Count = InfoCount) */
527 while (*PFieldList && SubtableCount)
529 /* Subtable: Debug Device Information */
531 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
533 if (ACPI_FAILURE (Status))
538 DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
539 CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
541 ParentTable = DtPeekSubtable ();
542 DtInsertSubtable (ParentTable, Subtable);
543 DtPushSubtable (Subtable);
545 ParentTable = DtPeekSubtable ();
547 /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
549 DeviceInfo->BaseAddressOffset = CurrentOffset;
550 for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
552 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
554 if (ACPI_FAILURE (Status))
559 CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
560 DtInsertSubtable (ParentTable, Subtable);
563 /* AddressSize array (Required, size = RegisterCount) */
565 DeviceInfo->AddressSizeOffset = CurrentOffset;
566 for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
568 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
570 if (ACPI_FAILURE (Status))
575 CurrentOffset += (UINT16) sizeof (UINT32);
576 DtInsertSubtable (ParentTable, Subtable);
579 /* NamespaceString device identifier (Required, size = NamePathLength) */
581 DeviceInfo->NamepathOffset = CurrentOffset;
582 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
584 if (ACPI_FAILURE (Status))
589 /* Update the device info header */
591 DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
592 CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
593 DtInsertSubtable (ParentTable, Subtable);
595 /* OemData - Variable-length data (Optional, size = OemDataLength) */
597 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
599 if (Status == AE_END_OF_TABLE)
601 /* optional field was not found and we're at the end of the file */
605 else if (ACPI_FAILURE (Status))
610 /* Update the device info header (zeros if no OEM data present) */
612 DeviceInfo->OemDataOffset = 0;
613 DeviceInfo->OemDataLength = 0;
615 /* Optional subtable (OemData) */
617 if (Subtable && Subtable->Length)
619 DeviceInfo->OemDataOffset = CurrentOffset;
620 DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
622 DtInsertSubtable (ParentTable, Subtable);
626 DtPopSubtable (); /* Get next Device Information subtable */
634 /******************************************************************************
636 * FUNCTION: DtCompileDmar
638 * PARAMETERS: List - Current field list pointer
642 * DESCRIPTION: Compile DMAR.
644 *****************************************************************************/
651 DT_SUBTABLE *Subtable;
652 DT_SUBTABLE *ParentTable;
653 DT_FIELD **PFieldList = (DT_FIELD **) List;
654 DT_FIELD *SubtableStart;
655 ACPI_DMTABLE_INFO *InfoTable;
656 ACPI_DMAR_HEADER *DmarHeader;
657 ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
658 UINT32 DeviceScopeLength;
659 UINT32 PciPathLength;
662 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable);
663 if (ACPI_FAILURE (Status))
668 ParentTable = DtPeekSubtable ();
669 DtInsertSubtable (ParentTable, Subtable);
670 DtPushSubtable (Subtable);
676 SubtableStart = *PFieldList;
677 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarHdr,
679 if (ACPI_FAILURE (Status))
684 ParentTable = DtPeekSubtable ();
685 DtInsertSubtable (ParentTable, Subtable);
686 DtPushSubtable (Subtable);
688 DmarHeader = ACPI_CAST_PTR (ACPI_DMAR_HEADER, Subtable->Buffer);
690 switch (DmarHeader->Type)
692 case ACPI_DMAR_TYPE_HARDWARE_UNIT:
694 InfoTable = AcpiDmTableInfoDmar0;
697 case ACPI_DMAR_TYPE_RESERVED_MEMORY:
699 InfoTable = AcpiDmTableInfoDmar1;
702 case ACPI_DMAR_TYPE_ROOT_ATS:
704 InfoTable = AcpiDmTableInfoDmar2;
707 case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
709 InfoTable = AcpiDmTableInfoDmar3;
712 case ACPI_DMAR_TYPE_NAMESPACE:
714 InfoTable = AcpiDmTableInfoDmar4;
719 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "DMAR");
725 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
726 if (ACPI_FAILURE (Status))
731 ParentTable = DtPeekSubtable ();
732 DtInsertSubtable (ParentTable, Subtable);
735 * Optional Device Scope subtables
737 if ((DmarHeader->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
738 (DmarHeader->Type == ACPI_DMAR_TYPE_NAMESPACE))
740 /* These types do not support device scopes */
746 DtPushSubtable (Subtable);
747 DeviceScopeLength = DmarHeader->Length - Subtable->Length -
749 while (DeviceScopeLength)
751 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
753 if (Status == AE_NOT_FOUND)
758 ParentTable = DtPeekSubtable ();
759 DtInsertSubtable (ParentTable, Subtable);
760 DtPushSubtable (Subtable);
762 DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
764 /* Optional PCI Paths */
766 PciPathLength = DmarDeviceScope->Length - Subtable->Length;
767 while (PciPathLength)
769 Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
771 if (Status == AE_NOT_FOUND)
777 ParentTable = DtPeekSubtable ();
778 DtInsertSubtable (ParentTable, Subtable);
779 PciPathLength -= Subtable->Length;
783 DeviceScopeLength -= DmarDeviceScope->Length;
794 /******************************************************************************
796 * FUNCTION: DtCompileDrtm
798 * PARAMETERS: List - Current field list pointer
802 * DESCRIPTION: Compile DRTM.
804 *****************************************************************************/
811 DT_SUBTABLE *Subtable;
812 DT_SUBTABLE *ParentTable;
813 DT_FIELD **PFieldList = (DT_FIELD **) List;
815 /* ACPI_TABLE_DRTM *Drtm; */
816 ACPI_DRTM_VTABLE_LIST *DrtmVtl;
817 ACPI_DRTM_RESOURCE_LIST *DrtmRl;
818 /* ACPI_DRTM_DPS_ID *DrtmDps; */
821 ParentTable = DtPeekSubtable ();
823 /* Compile DRTM header */
825 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm,
827 if (ACPI_FAILURE (Status))
831 DtInsertSubtable (ParentTable, Subtable);
834 * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
835 * should be taken to avoid accessing ACPI_TABLE_HADER fields.
838 Drtm = ACPI_SUB_PTR (ACPI_TABLE_DRTM,
839 Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
843 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0,
845 if (ACPI_FAILURE (Status))
850 DtInsertSubtable (ParentTable, Subtable);
851 DrtmVtl = ACPI_CAST_PTR (ACPI_DRTM_VTABLE_LIST, Subtable->Buffer);
853 DtPushSubtable (Subtable);
854 ParentTable = DtPeekSubtable ();
859 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm0a,
861 if (ACPI_FAILURE (Status))
869 DtInsertSubtable (ParentTable, Subtable);
873 DrtmVtl->ValidatedTableCount = Count;
875 ParentTable = DtPeekSubtable ();
879 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1,
881 if (ACPI_FAILURE (Status))
886 DtInsertSubtable (ParentTable, Subtable);
887 DrtmRl = ACPI_CAST_PTR (ACPI_DRTM_RESOURCE_LIST, Subtable->Buffer);
889 DtPushSubtable (Subtable);
890 ParentTable = DtPeekSubtable ();
895 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm1a,
897 if (ACPI_FAILURE (Status))
907 DtInsertSubtable (ParentTable, Subtable);
911 DrtmRl->ResourceCount = Count;
913 ParentTable = DtPeekSubtable ();
917 Status = DtCompileTable (PFieldList, AcpiDmTableInfoDrtm2,
919 if (ACPI_FAILURE (Status))
923 DtInsertSubtable (ParentTable, Subtable);
924 /* DrtmDps = ACPI_CAST_PTR (ACPI_DRTM_DPS_ID, Subtable->Buffer);*/
931 /******************************************************************************
933 * FUNCTION: DtCompileEinj
935 * PARAMETERS: List - Current field list pointer
939 * DESCRIPTION: Compile EINJ.
941 *****************************************************************************/
950 Status = DtCompileTwoSubtables (List,
951 AcpiDmTableInfoEinj, AcpiDmTableInfoEinj0);
956 /******************************************************************************
958 * FUNCTION: DtCompileErst
960 * PARAMETERS: List - Current field list pointer
964 * DESCRIPTION: Compile ERST.
966 *****************************************************************************/
975 Status = DtCompileTwoSubtables (List,
976 AcpiDmTableInfoErst, AcpiDmTableInfoEinj0);
981 /******************************************************************************
983 * FUNCTION: DtCompileGtdt
985 * PARAMETERS: List - Current field list pointer
989 * DESCRIPTION: Compile GTDT.
991 *****************************************************************************/
998 DT_SUBTABLE *Subtable;
999 DT_SUBTABLE *ParentTable;
1000 DT_FIELD **PFieldList = (DT_FIELD **) List;
1001 DT_FIELD *SubtableStart;
1002 ACPI_SUBTABLE_HEADER *GtdtHeader;
1003 ACPI_DMTABLE_INFO *InfoTable;
1005 ACPI_TABLE_HEADER *Header;
1008 ParentTable = DtPeekSubtable ();
1010 Header = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ParentTable->Buffer);
1012 /* Compile the main table */
1014 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt,
1016 if (ACPI_FAILURE (Status))
1021 /* GTDT revision 3 later contains 2 extra fields before subtables */
1023 if (Header->Revision > 2)
1025 ParentTable = DtPeekSubtable ();
1026 DtInsertSubtable (ParentTable, Subtable);
1028 Status = DtCompileTable (PFieldList,
1029 AcpiDmTableInfoGtdtEl2, &Subtable);
1030 if (ACPI_FAILURE (Status))
1036 ParentTable = DtPeekSubtable ();
1037 DtInsertSubtable (ParentTable, Subtable);
1041 SubtableStart = *PFieldList;
1042 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdtHdr,
1044 if (ACPI_FAILURE (Status))
1049 ParentTable = DtPeekSubtable ();
1050 DtInsertSubtable (ParentTable, Subtable);
1051 DtPushSubtable (Subtable);
1053 GtdtHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
1055 switch (GtdtHeader->Type)
1057 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1059 InfoTable = AcpiDmTableInfoGtdt0;
1062 case ACPI_GTDT_TYPE_WATCHDOG:
1064 InfoTable = AcpiDmTableInfoGtdt1;
1069 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "GTDT");
1073 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
1074 if (ACPI_FAILURE (Status))
1079 ParentTable = DtPeekSubtable ();
1080 DtInsertSubtable (ParentTable, Subtable);
1083 * Additional GT block subtable data
1086 switch (GtdtHeader->Type)
1088 case ACPI_GTDT_TYPE_TIMER_BLOCK:
1090 DtPushSubtable (Subtable);
1091 ParentTable = DtPeekSubtable ();
1093 GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
1094 Subtable->Buffer - sizeof(ACPI_GTDT_HEADER)))->TimerCount;
1098 Status = DtCompileTable (PFieldList, AcpiDmTableInfoGtdt0a,
1100 if (ACPI_FAILURE (Status))
1105 DtInsertSubtable (ParentTable, Subtable);
1124 /******************************************************************************
1126 * FUNCTION: DtCompileFpdt
1128 * PARAMETERS: List - Current field list pointer
1132 * DESCRIPTION: Compile FPDT.
1134 *****************************************************************************/
1141 ACPI_FPDT_HEADER *FpdtHeader;
1142 DT_SUBTABLE *Subtable;
1143 DT_SUBTABLE *ParentTable;
1144 ACPI_DMTABLE_INFO *InfoTable;
1145 DT_FIELD **PFieldList = (DT_FIELD **) List;
1146 DT_FIELD *SubtableStart;
1151 SubtableStart = *PFieldList;
1152 Status = DtCompileTable (PFieldList, AcpiDmTableInfoFpdtHdr,
1154 if (ACPI_FAILURE (Status))
1159 ParentTable = DtPeekSubtable ();
1160 DtInsertSubtable (ParentTable, Subtable);
1161 DtPushSubtable (Subtable);
1163 FpdtHeader = ACPI_CAST_PTR (ACPI_FPDT_HEADER, Subtable->Buffer);
1165 switch (FpdtHeader->Type)
1167 case ACPI_FPDT_TYPE_BOOT:
1169 InfoTable = AcpiDmTableInfoFpdt0;
1172 case ACPI_FPDT_TYPE_S3PERF:
1174 InfoTable = AcpiDmTableInfoFpdt1;
1179 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "FPDT");
1184 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
1185 if (ACPI_FAILURE (Status))
1190 ParentTable = DtPeekSubtable ();
1191 DtInsertSubtable (ParentTable, Subtable);
1199 /******************************************************************************
1201 * FUNCTION: DtCompileHest
1203 * PARAMETERS: List - Current field list pointer
1207 * DESCRIPTION: Compile HEST.
1209 *****************************************************************************/
1216 DT_SUBTABLE *Subtable;
1217 DT_SUBTABLE *ParentTable;
1218 DT_FIELD **PFieldList = (DT_FIELD **) List;
1219 DT_FIELD *SubtableStart;
1220 ACPI_DMTABLE_INFO *InfoTable;
1225 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHest,
1227 if (ACPI_FAILURE (Status))
1232 ParentTable = DtPeekSubtable ();
1233 DtInsertSubtable (ParentTable, Subtable);
1237 /* Get subtable type */
1239 SubtableStart = *PFieldList;
1240 DtCompileInteger ((UINT8 *) &Type, *PFieldList, 2, 0);
1244 case ACPI_HEST_TYPE_IA32_CHECK:
1246 InfoTable = AcpiDmTableInfoHest0;
1249 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1251 InfoTable = AcpiDmTableInfoHest1;
1254 case ACPI_HEST_TYPE_IA32_NMI:
1256 InfoTable = AcpiDmTableInfoHest2;
1259 case ACPI_HEST_TYPE_AER_ROOT_PORT:
1261 InfoTable = AcpiDmTableInfoHest6;
1264 case ACPI_HEST_TYPE_AER_ENDPOINT:
1266 InfoTable = AcpiDmTableInfoHest7;
1269 case ACPI_HEST_TYPE_AER_BRIDGE:
1271 InfoTable = AcpiDmTableInfoHest8;
1274 case ACPI_HEST_TYPE_GENERIC_ERROR:
1276 InfoTable = AcpiDmTableInfoHest9;
1279 case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
1281 InfoTable = AcpiDmTableInfoHest10;
1284 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1286 InfoTable = AcpiDmTableInfoHest11;
1291 /* Cannot continue on unknown type */
1293 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HEST");
1297 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
1298 if (ACPI_FAILURE (Status))
1303 DtInsertSubtable (ParentTable, Subtable);
1306 * Additional subtable data - IA32 Error Bank(s)
1311 case ACPI_HEST_TYPE_IA32_CHECK:
1313 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
1314 Subtable->Buffer))->NumHardwareBanks;
1317 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
1319 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
1320 Subtable->Buffer))->NumHardwareBanks;
1323 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
1325 BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
1326 Subtable->Buffer))->NumHardwareBanks;
1336 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHestBank,
1338 if (ACPI_FAILURE (Status))
1343 DtInsertSubtable (ParentTable, Subtable);
1352 /******************************************************************************
1354 * FUNCTION: DtCompileHmat
1356 * PARAMETERS: List - Current field list pointer
1360 * DESCRIPTION: Compile HMAT.
1362 *****************************************************************************/
1369 DT_SUBTABLE *Subtable;
1370 DT_SUBTABLE *ParentTable;
1371 DT_FIELD **PFieldList = (DT_FIELD **) List;
1372 DT_FIELD *SubtableStart;
1373 DT_FIELD *EntryStart;
1374 ACPI_HMAT_STRUCTURE *HmatStruct;
1375 ACPI_HMAT_LOCALITY *HmatLocality;
1376 ACPI_HMAT_CACHE *HmatCache;
1377 ACPI_DMTABLE_INFO *InfoTable;
1381 UINT16 SMBIOSHandleNumber;
1384 ParentTable = DtPeekSubtable ();
1386 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmat,
1388 if (ACPI_FAILURE (Status))
1392 DtInsertSubtable (ParentTable, Subtable);
1396 /* Compile HMAT structure header */
1398 SubtableStart = *PFieldList;
1399 Status = DtCompileTable (PFieldList, AcpiDmTableInfoHmatHdr,
1401 if (ACPI_FAILURE (Status))
1405 DtInsertSubtable (ParentTable, Subtable);
1407 HmatStruct = ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE, Subtable->Buffer);
1408 HmatStruct->Length = Subtable->Length;
1410 /* Compile HMAT structure body */
1412 switch (HmatStruct->Type)
1414 case ACPI_HMAT_TYPE_ADDRESS_RANGE:
1416 InfoTable = AcpiDmTableInfoHmat0;
1419 case ACPI_HMAT_TYPE_LOCALITY:
1421 InfoTable = AcpiDmTableInfoHmat1;
1424 case ACPI_HMAT_TYPE_CACHE:
1426 InfoTable = AcpiDmTableInfoHmat2;
1431 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "HMAT");
1435 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
1436 if (ACPI_FAILURE (Status))
1440 DtInsertSubtable (ParentTable, Subtable);
1441 HmatStruct->Length += Subtable->Length;
1443 /* Compile HMAT structure additionals */
1445 switch (HmatStruct->Type)
1447 case ACPI_HMAT_TYPE_LOCALITY:
1449 HmatLocality = ACPI_SUB_PTR (ACPI_HMAT_LOCALITY,
1450 Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
1452 /* Compile initiator proximity domain list */
1457 Status = DtCompileTable (PFieldList,
1458 AcpiDmTableInfoHmat1a, &Subtable);
1459 if (ACPI_FAILURE (Status))
1467 DtInsertSubtable (ParentTable, Subtable);
1468 HmatStruct->Length += Subtable->Length;
1471 HmatLocality->NumberOfInitiatorPDs = IntPDNumber;
1473 /* Compile target proximity domain list */
1478 Status = DtCompileTable (PFieldList,
1479 AcpiDmTableInfoHmat1b, &Subtable);
1480 if (ACPI_FAILURE (Status))
1488 DtInsertSubtable (ParentTable, Subtable);
1489 HmatStruct->Length += Subtable->Length;
1492 HmatLocality->NumberOfTargetPDs = TgtPDNumber;
1494 /* Save start of the entries for reporting errors */
1496 EntryStart = *PFieldList;
1498 /* Compile latency/bandwidth entries */
1503 Status = DtCompileTable (PFieldList,
1504 AcpiDmTableInfoHmat1c, &Subtable);
1505 if (ACPI_FAILURE (Status))
1513 DtInsertSubtable (ParentTable, Subtable);
1514 HmatStruct->Length += Subtable->Length;
1518 /* Validate number of entries */
1521 ((UINT64)IntPDNumber * (UINT64)TgtPDNumber))
1523 DtFatal (ASL_MSG_INVALID_EXPRESSION, EntryStart, "HMAT");
1528 case ACPI_HMAT_TYPE_CACHE:
1530 /* Compile SMBIOS handles */
1532 HmatCache = ACPI_SUB_PTR (ACPI_HMAT_CACHE,
1533 Subtable->Buffer, sizeof (ACPI_HMAT_STRUCTURE));
1534 SMBIOSHandleNumber = 0;
1537 Status = DtCompileTable (PFieldList,
1538 AcpiDmTableInfoHmat2a, &Subtable);
1539 if (ACPI_FAILURE (Status))
1547 DtInsertSubtable (ParentTable, Subtable);
1548 HmatStruct->Length += Subtable->Length;
1549 SMBIOSHandleNumber++;
1551 HmatCache->NumberOfSMBIOSHandles = SMBIOSHandleNumber;
1564 /******************************************************************************
1566 * FUNCTION: DtCompileIort
1568 * PARAMETERS: List - Current field list pointer
1572 * DESCRIPTION: Compile IORT.
1574 *****************************************************************************/
1581 DT_SUBTABLE *Subtable;
1582 DT_SUBTABLE *ParentTable;
1583 DT_FIELD **PFieldList = (DT_FIELD **) List;
1584 DT_FIELD *SubtableStart;
1585 ACPI_TABLE_IORT *Iort;
1586 ACPI_IORT_NODE *IortNode;
1587 ACPI_IORT_ITS_GROUP *IortItsGroup;
1588 ACPI_IORT_SMMU *IortSmmu;
1591 UINT32 IdMappingNumber;
1593 UINT32 ContextIrptNumber;
1594 UINT32 PmuIrptNumber;
1595 UINT32 PaddingLength;
1598 ParentTable = DtPeekSubtable ();
1600 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort,
1602 if (ACPI_FAILURE (Status))
1606 DtInsertSubtable (ParentTable, Subtable);
1609 * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
1610 * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
1612 Iort = ACPI_SUB_PTR (ACPI_TABLE_IORT,
1613 Subtable->Buffer, sizeof (ACPI_TABLE_HEADER));
1616 * OptionalPadding - Variable-length data
1617 * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
1618 * Optionally allows the generic data types to be used for filling
1621 Iort->NodeOffset = sizeof (ACPI_TABLE_IORT);
1622 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortPad,
1624 if (ACPI_FAILURE (Status))
1630 DtInsertSubtable (ParentTable, Subtable);
1631 Iort->NodeOffset += Subtable->Length;
1635 Status = DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList),
1636 AcpiDmTableInfoIortHdr[0].Name, &PaddingLength);
1637 if (ACPI_FAILURE (Status))
1641 Iort->NodeOffset += PaddingLength;
1647 SubtableStart = *PFieldList;
1648 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortHdr,
1650 if (ACPI_FAILURE (Status))
1655 DtInsertSubtable (ParentTable, Subtable);
1656 IortNode = ACPI_CAST_PTR (ACPI_IORT_NODE, Subtable->Buffer);
1657 NodeLength = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
1659 DtPushSubtable (Subtable);
1660 ParentTable = DtPeekSubtable ();
1662 switch (IortNode->Type)
1664 case ACPI_IORT_NODE_ITS_GROUP:
1666 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0,
1668 if (ACPI_FAILURE (Status))
1673 DtInsertSubtable (ParentTable, Subtable);
1674 IortItsGroup = ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP, Subtable->Buffer);
1675 NodeLength += Subtable->Length;
1680 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort0a,
1682 if (ACPI_FAILURE (Status))
1691 DtInsertSubtable (ParentTable, Subtable);
1692 NodeLength += Subtable->Length;
1696 IortItsGroup->ItsCount = ItsNumber;
1699 case ACPI_IORT_NODE_NAMED_COMPONENT:
1701 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1,
1703 if (ACPI_FAILURE (Status))
1708 DtInsertSubtable (ParentTable, Subtable);
1709 NodeLength += Subtable->Length;
1712 * Padding - Variable-length data
1713 * Optionally allows the offset of the ID mappings to be used
1714 * for filling this field.
1716 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort1a,
1718 if (ACPI_FAILURE (Status))
1725 DtInsertSubtable (ParentTable, Subtable);
1726 NodeLength += Subtable->Length;
1730 if (NodeLength > IortNode->MappingOffset)
1732 return (AE_BAD_DATA);
1735 if (NodeLength < IortNode->MappingOffset)
1737 Status = DtCompilePadding (
1738 IortNode->MappingOffset - NodeLength,
1740 if (ACPI_FAILURE (Status))
1745 DtInsertSubtable (ParentTable, Subtable);
1746 NodeLength = IortNode->MappingOffset;
1751 case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
1753 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort2,
1755 if (ACPI_FAILURE (Status))
1760 DtInsertSubtable (ParentTable, Subtable);
1761 NodeLength += Subtable->Length;
1764 case ACPI_IORT_NODE_SMMU:
1766 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3,
1768 if (ACPI_FAILURE (Status))
1773 DtInsertSubtable (ParentTable, Subtable);
1774 IortSmmu = ACPI_CAST_PTR (ACPI_IORT_SMMU, Subtable->Buffer);
1775 NodeLength += Subtable->Length;
1777 /* Compile global interrupt array */
1779 IortSmmu->GlobalInterruptOffset = NodeLength;
1780 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3a,
1782 if (ACPI_FAILURE (Status))
1787 DtInsertSubtable (ParentTable, Subtable);
1788 NodeLength += Subtable->Length;
1790 /* Compile context interrupt array */
1792 ContextIrptNumber = 0;
1793 IortSmmu->ContextInterruptOffset = NodeLength;
1796 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3b,
1798 if (ACPI_FAILURE (Status))
1808 DtInsertSubtable (ParentTable, Subtable);
1809 NodeLength += Subtable->Length;
1810 ContextIrptNumber++;
1813 IortSmmu->ContextInterruptCount = ContextIrptNumber;
1815 /* Compile PMU interrupt array */
1818 IortSmmu->PmuInterruptOffset = NodeLength;
1821 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort3c,
1823 if (ACPI_FAILURE (Status))
1833 DtInsertSubtable (ParentTable, Subtable);
1834 NodeLength += Subtable->Length;
1838 IortSmmu->PmuInterruptCount = PmuIrptNumber;
1841 case ACPI_IORT_NODE_SMMU_V3:
1843 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort4,
1845 if (ACPI_FAILURE (Status))
1850 DtInsertSubtable (ParentTable, Subtable);
1851 NodeLength += Subtable->Length;
1854 case ACPI_IORT_NODE_PMCG:
1856 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIort5,
1858 if (ACPI_FAILURE (Status))
1863 DtInsertSubtable (ParentTable, Subtable);
1864 NodeLength += Subtable->Length;
1869 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IORT");
1873 /* Compile Array of ID mappings */
1875 IortNode->MappingOffset = NodeLength;
1876 IdMappingNumber = 0;
1879 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIortMap,
1881 if (ACPI_FAILURE (Status))
1891 DtInsertSubtable (ParentTable, Subtable);
1892 NodeLength += sizeof (ACPI_IORT_ID_MAPPING);
1896 IortNode->MappingCount = IdMappingNumber;
1897 if (!IdMappingNumber)
1899 IortNode->MappingOffset = 0;
1903 * Node length can be determined by DT_LENGTH option
1904 * IortNode->Length = NodeLength;
1907 ParentTable = DtPeekSubtable ();
1911 Iort->NodeCount = NodeNumber;
1916 /******************************************************************************
1918 * FUNCTION: DtCompileIvrs
1920 * PARAMETERS: List - Current field list pointer
1924 * DESCRIPTION: Compile IVRS.
1926 *****************************************************************************/
1933 DT_SUBTABLE *Subtable;
1934 DT_SUBTABLE *ParentTable;
1935 DT_FIELD **PFieldList = (DT_FIELD **) List;
1936 DT_FIELD *SubtableStart;
1937 ACPI_DMTABLE_INFO *InfoTable;
1938 ACPI_IVRS_HEADER *IvrsHeader;
1942 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrs,
1944 if (ACPI_FAILURE (Status))
1949 ParentTable = DtPeekSubtable ();
1950 DtInsertSubtable (ParentTable, Subtable);
1954 SubtableStart = *PFieldList;
1955 Status = DtCompileTable (PFieldList, AcpiDmTableInfoIvrsHdr,
1957 if (ACPI_FAILURE (Status))
1962 ParentTable = DtPeekSubtable ();
1963 DtInsertSubtable (ParentTable, Subtable);
1964 DtPushSubtable (Subtable);
1966 IvrsHeader = ACPI_CAST_PTR (ACPI_IVRS_HEADER, Subtable->Buffer);
1968 switch (IvrsHeader->Type)
1970 case ACPI_IVRS_TYPE_HARDWARE1:
1972 InfoTable = AcpiDmTableInfoIvrs0;
1975 case ACPI_IVRS_TYPE_HARDWARE2:
1977 InfoTable = AcpiDmTableInfoIvrs01;
1980 case ACPI_IVRS_TYPE_MEMORY1:
1981 case ACPI_IVRS_TYPE_MEMORY2:
1982 case ACPI_IVRS_TYPE_MEMORY3:
1984 InfoTable = AcpiDmTableInfoIvrs1;
1989 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "IVRS");
1993 Status = DtCompileTable (PFieldList, InfoTable, &Subtable);
1994 if (ACPI_FAILURE (Status))
1999 ParentTable = DtPeekSubtable ();
2000 DtInsertSubtable (ParentTable, Subtable);
2002 if (IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE1 ||
2003 IvrsHeader->Type == ACPI_IVRS_TYPE_HARDWARE2)
2005 while (*PFieldList &&
2006 !strcmp ((*PFieldList)->Name, "Entry Type"))
2008 SubtableStart = *PFieldList;
2009 DtCompileInteger (&EntryType, *PFieldList, 1, 0);
2013 /* 4-byte device entries */
2015 case ACPI_IVRS_TYPE_PAD4:
2016 case ACPI_IVRS_TYPE_ALL:
2017 case ACPI_IVRS_TYPE_SELECT:
2018 case ACPI_IVRS_TYPE_START:
2019 case ACPI_IVRS_TYPE_END:
2021 InfoTable = AcpiDmTableInfoIvrs4;
2024 /* 8-byte entries, type A */
2026 case ACPI_IVRS_TYPE_ALIAS_SELECT:
2027 case ACPI_IVRS_TYPE_ALIAS_START:
2029 InfoTable = AcpiDmTableInfoIvrs8a;
2032 /* 8-byte entries, type B */
2034 case ACPI_IVRS_TYPE_PAD8:
2035 case ACPI_IVRS_TYPE_EXT_SELECT:
2036 case ACPI_IVRS_TYPE_EXT_START:
2038 InfoTable = AcpiDmTableInfoIvrs8b;
2041 /* 8-byte entries, type C */
2043 case ACPI_IVRS_TYPE_SPECIAL:
2045 InfoTable = AcpiDmTableInfoIvrs8c;
2050 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart,
2051 "IVRS Device Entry");
2055 Status = DtCompileTable (PFieldList, InfoTable,
2057 if (ACPI_FAILURE (Status))
2062 DtInsertSubtable (ParentTable, Subtable);