1 /******************************************************************************
3 * Module Name: dttable1.c - handling for specific ACPI tables
5 *****************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, 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 seperate 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
;
1007 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoGtdt
,
1009 if (ACPI_FAILURE (Status
))
1014 ParentTable
= DtPeekSubtable ();
1015 DtInsertSubtable (ParentTable
, Subtable
);
1019 SubtableStart
= *PFieldList
;
1020 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoGtdtHdr
,
1022 if (ACPI_FAILURE (Status
))
1027 ParentTable
= DtPeekSubtable ();
1028 DtInsertSubtable (ParentTable
, Subtable
);
1029 DtPushSubtable (Subtable
);
1031 GtdtHeader
= ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER
, Subtable
->Buffer
);
1033 switch (GtdtHeader
->Type
)
1035 case ACPI_GTDT_TYPE_TIMER_BLOCK
:
1037 InfoTable
= AcpiDmTableInfoGtdt0
;
1040 case ACPI_GTDT_TYPE_WATCHDOG
:
1042 InfoTable
= AcpiDmTableInfoGtdt1
;
1047 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "GTDT");
1051 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
);
1052 if (ACPI_FAILURE (Status
))
1057 ParentTable
= DtPeekSubtable ();
1058 DtInsertSubtable (ParentTable
, Subtable
);
1061 * Additional GT block subtable data
1064 switch (GtdtHeader
->Type
)
1066 case ACPI_GTDT_TYPE_TIMER_BLOCK
:
1068 DtPushSubtable (Subtable
);
1069 ParentTable
= DtPeekSubtable ();
1071 GtCount
= (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK
,
1072 Subtable
->Buffer
- sizeof(ACPI_GTDT_HEADER
)))->TimerCount
;
1076 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoGtdt0a
,
1078 if (ACPI_FAILURE (Status
))
1083 DtInsertSubtable (ParentTable
, Subtable
);
1102 /******************************************************************************
1104 * FUNCTION: DtCompileFpdt
1106 * PARAMETERS: List - Current field list pointer
1110 * DESCRIPTION: Compile FPDT.
1112 *****************************************************************************/
1119 ACPI_FPDT_HEADER
*FpdtHeader
;
1120 DT_SUBTABLE
*Subtable
;
1121 DT_SUBTABLE
*ParentTable
;
1122 ACPI_DMTABLE_INFO
*InfoTable
;
1123 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1124 DT_FIELD
*SubtableStart
;
1129 SubtableStart
= *PFieldList
;
1130 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFpdtHdr
,
1132 if (ACPI_FAILURE (Status
))
1137 ParentTable
= DtPeekSubtable ();
1138 DtInsertSubtable (ParentTable
, Subtable
);
1139 DtPushSubtable (Subtable
);
1141 FpdtHeader
= ACPI_CAST_PTR (ACPI_FPDT_HEADER
, Subtable
->Buffer
);
1143 switch (FpdtHeader
->Type
)
1145 case ACPI_FPDT_TYPE_BOOT
:
1147 InfoTable
= AcpiDmTableInfoFpdt0
;
1150 case ACPI_FPDT_TYPE_S3PERF
:
1152 InfoTable
= AcpiDmTableInfoFpdt1
;
1157 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "FPDT");
1162 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
);
1163 if (ACPI_FAILURE (Status
))
1168 ParentTable
= DtPeekSubtable ();
1169 DtInsertSubtable (ParentTable
, Subtable
);
1177 /******************************************************************************
1179 * FUNCTION: DtCompileHest
1181 * PARAMETERS: List - Current field list pointer
1185 * DESCRIPTION: Compile HEST.
1187 *****************************************************************************/
1194 DT_SUBTABLE
*Subtable
;
1195 DT_SUBTABLE
*ParentTable
;
1196 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1197 DT_FIELD
*SubtableStart
;
1198 ACPI_DMTABLE_INFO
*InfoTable
;
1203 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHest
,
1205 if (ACPI_FAILURE (Status
))
1210 ParentTable
= DtPeekSubtable ();
1211 DtInsertSubtable (ParentTable
, Subtable
);
1215 /* Get subtable type */
1217 SubtableStart
= *PFieldList
;
1218 DtCompileInteger ((UINT8
*) &Type
, *PFieldList
, 2, 0);
1222 case ACPI_HEST_TYPE_IA32_CHECK
:
1224 InfoTable
= AcpiDmTableInfoHest0
;
1227 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
1229 InfoTable
= AcpiDmTableInfoHest1
;
1232 case ACPI_HEST_TYPE_IA32_NMI
:
1234 InfoTable
= AcpiDmTableInfoHest2
;
1237 case ACPI_HEST_TYPE_AER_ROOT_PORT
:
1239 InfoTable
= AcpiDmTableInfoHest6
;
1242 case ACPI_HEST_TYPE_AER_ENDPOINT
:
1244 InfoTable
= AcpiDmTableInfoHest7
;
1247 case ACPI_HEST_TYPE_AER_BRIDGE
:
1249 InfoTable
= AcpiDmTableInfoHest8
;
1252 case ACPI_HEST_TYPE_GENERIC_ERROR
:
1254 InfoTable
= AcpiDmTableInfoHest9
;
1257 case ACPI_HEST_TYPE_GENERIC_ERROR_V2
:
1259 InfoTable
= AcpiDmTableInfoHest10
;
1262 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK
:
1264 InfoTable
= AcpiDmTableInfoHest11
;
1269 /* Cannot continue on unknown type */
1271 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "HEST");
1275 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
);
1276 if (ACPI_FAILURE (Status
))
1281 DtInsertSubtable (ParentTable
, Subtable
);
1284 * Additional subtable data - IA32 Error Bank(s)
1289 case ACPI_HEST_TYPE_IA32_CHECK
:
1291 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK
,
1292 Subtable
->Buffer
))->NumHardwareBanks
;
1295 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
1297 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED
,
1298 Subtable
->Buffer
))->NumHardwareBanks
;
1301 case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK
:
1303 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK
,
1304 Subtable
->Buffer
))->NumHardwareBanks
;
1314 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHestBank
,
1316 if (ACPI_FAILURE (Status
))
1321 DtInsertSubtable (ParentTable
, Subtable
);
1330 /******************************************************************************
1332 * FUNCTION: DtCompileHmat
1334 * PARAMETERS: List - Current field list pointer
1338 * DESCRIPTION: Compile HMAT.
1340 *****************************************************************************/
1347 DT_SUBTABLE
*Subtable
;
1348 DT_SUBTABLE
*ParentTable
;
1349 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1350 DT_FIELD
*SubtableStart
;
1351 DT_FIELD
*EntryStart
;
1352 ACPI_HMAT_STRUCTURE
*HmatStruct
;
1353 ACPI_HMAT_LOCALITY
*HmatLocality
;
1354 ACPI_HMAT_CACHE
*HmatCache
;
1355 ACPI_DMTABLE_INFO
*InfoTable
;
1359 UINT16 SMBIOSHandleNumber
;
1362 ParentTable
= DtPeekSubtable ();
1364 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHmat
,
1366 if (ACPI_FAILURE (Status
))
1370 DtInsertSubtable (ParentTable
, Subtable
);
1374 /* Compile HMAT structure header */
1376 SubtableStart
= *PFieldList
;
1377 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHmatHdr
,
1379 if (ACPI_FAILURE (Status
))
1383 DtInsertSubtable (ParentTable
, Subtable
);
1385 HmatStruct
= ACPI_CAST_PTR (ACPI_HMAT_STRUCTURE
, Subtable
->Buffer
);
1386 HmatStruct
->Length
= Subtable
->Length
;
1388 /* Compile HMAT structure body */
1390 switch (HmatStruct
->Type
)
1392 case ACPI_HMAT_TYPE_ADDRESS_RANGE
:
1394 InfoTable
= AcpiDmTableInfoHmat0
;
1397 case ACPI_HMAT_TYPE_LOCALITY
:
1399 InfoTable
= AcpiDmTableInfoHmat1
;
1402 case ACPI_HMAT_TYPE_CACHE
:
1404 InfoTable
= AcpiDmTableInfoHmat2
;
1409 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "HMAT");
1413 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
);
1414 if (ACPI_FAILURE (Status
))
1418 DtInsertSubtable (ParentTable
, Subtable
);
1419 HmatStruct
->Length
+= Subtable
->Length
;
1421 /* Compile HMAT structure additionals */
1423 switch (HmatStruct
->Type
)
1425 case ACPI_HMAT_TYPE_LOCALITY
:
1427 HmatLocality
= ACPI_SUB_PTR (ACPI_HMAT_LOCALITY
,
1428 Subtable
->Buffer
, sizeof (ACPI_HMAT_STRUCTURE
));
1430 /* Compile initiator proximity domain list */
1435 Status
= DtCompileTable (PFieldList
,
1436 AcpiDmTableInfoHmat1a
, &Subtable
);
1437 if (ACPI_FAILURE (Status
))
1445 DtInsertSubtable (ParentTable
, Subtable
);
1446 HmatStruct
->Length
+= Subtable
->Length
;
1449 HmatLocality
->NumberOfInitiatorPDs
= IntPDNumber
;
1451 /* Compile target proximity domain list */
1456 Status
= DtCompileTable (PFieldList
,
1457 AcpiDmTableInfoHmat1b
, &Subtable
);
1458 if (ACPI_FAILURE (Status
))
1466 DtInsertSubtable (ParentTable
, Subtable
);
1467 HmatStruct
->Length
+= Subtable
->Length
;
1470 HmatLocality
->NumberOfTargetPDs
= TgtPDNumber
;
1472 /* Save start of the entries for reporting errors */
1474 EntryStart
= *PFieldList
;
1476 /* Compile latency/bandwidth entries */
1481 Status
= DtCompileTable (PFieldList
,
1482 AcpiDmTableInfoHmat1c
, &Subtable
);
1483 if (ACPI_FAILURE (Status
))
1491 DtInsertSubtable (ParentTable
, Subtable
);
1492 HmatStruct
->Length
+= Subtable
->Length
;
1496 /* Validate number of entries */
1499 ((UINT64
)IntPDNumber
* (UINT64
)TgtPDNumber
))
1501 DtFatal (ASL_MSG_INVALID_EXPRESSION
, EntryStart
, "HMAT");
1506 case ACPI_HMAT_TYPE_CACHE
:
1508 /* Compile SMBIOS handles */
1510 HmatCache
= ACPI_SUB_PTR (ACPI_HMAT_CACHE
,
1511 Subtable
->Buffer
, sizeof (ACPI_HMAT_STRUCTURE
));
1512 SMBIOSHandleNumber
= 0;
1515 Status
= DtCompileTable (PFieldList
,
1516 AcpiDmTableInfoHmat2a
, &Subtable
);
1517 if (ACPI_FAILURE (Status
))
1525 DtInsertSubtable (ParentTable
, Subtable
);
1526 HmatStruct
->Length
+= Subtable
->Length
;
1527 SMBIOSHandleNumber
++;
1529 HmatCache
->NumberOfSMBIOSHandles
= SMBIOSHandleNumber
;
1542 /******************************************************************************
1544 * FUNCTION: DtCompileIort
1546 * PARAMETERS: List - Current field list pointer
1550 * DESCRIPTION: Compile IORT.
1552 *****************************************************************************/
1559 DT_SUBTABLE
*Subtable
;
1560 DT_SUBTABLE
*ParentTable
;
1561 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1562 DT_FIELD
*SubtableStart
;
1563 ACPI_TABLE_IORT
*Iort
;
1564 ACPI_IORT_NODE
*IortNode
;
1565 ACPI_IORT_ITS_GROUP
*IortItsGroup
;
1566 ACPI_IORT_SMMU
*IortSmmu
;
1569 UINT32 IdMappingNumber
;
1571 UINT32 ContextIrptNumber
;
1572 UINT32 PmuIrptNumber
;
1573 UINT32 PaddingLength
;
1576 ParentTable
= DtPeekSubtable ();
1578 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort
,
1580 if (ACPI_FAILURE (Status
))
1584 DtInsertSubtable (ParentTable
, Subtable
);
1587 * Using ACPI_SUB_PTR, We needn't define a separate structure. Care
1588 * should be taken to avoid accessing ACPI_TABLE_HEADER fields.
1590 Iort
= ACPI_SUB_PTR (ACPI_TABLE_IORT
,
1591 Subtable
->Buffer
, sizeof (ACPI_TABLE_HEADER
));
1594 * OptionalPadding - Variable-length data
1595 * (Optional, size = OffsetToNodes - sizeof (ACPI_TABLE_IORT))
1596 * Optionally allows the generic data types to be used for filling
1599 Iort
->NodeOffset
= sizeof (ACPI_TABLE_IORT
);
1600 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIortPad
,
1602 if (ACPI_FAILURE (Status
))
1608 DtInsertSubtable (ParentTable
, Subtable
);
1609 Iort
->NodeOffset
+= Subtable
->Length
;
1613 Status
= DtCompileGeneric (ACPI_CAST_PTR (void *, PFieldList
),
1614 AcpiDmTableInfoIortHdr
[0].Name
, &PaddingLength
);
1615 if (ACPI_FAILURE (Status
))
1619 Iort
->NodeOffset
+= PaddingLength
;
1625 SubtableStart
= *PFieldList
;
1626 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIortHdr
,
1628 if (ACPI_FAILURE (Status
))
1633 DtInsertSubtable (ParentTable
, Subtable
);
1634 IortNode
= ACPI_CAST_PTR (ACPI_IORT_NODE
, Subtable
->Buffer
);
1635 NodeLength
= ACPI_OFFSET (ACPI_IORT_NODE
, NodeData
);
1637 DtPushSubtable (Subtable
);
1638 ParentTable
= DtPeekSubtable ();
1640 switch (IortNode
->Type
)
1642 case ACPI_IORT_NODE_ITS_GROUP
:
1644 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort0
,
1646 if (ACPI_FAILURE (Status
))
1651 DtInsertSubtable (ParentTable
, Subtable
);
1652 IortItsGroup
= ACPI_CAST_PTR (ACPI_IORT_ITS_GROUP
, Subtable
->Buffer
);
1653 NodeLength
+= Subtable
->Length
;
1658 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort0a
,
1660 if (ACPI_FAILURE (Status
))
1669 DtInsertSubtable (ParentTable
, Subtable
);
1670 NodeLength
+= Subtable
->Length
;
1674 IortItsGroup
->ItsCount
= ItsNumber
;
1677 case ACPI_IORT_NODE_NAMED_COMPONENT
:
1679 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort1
,
1681 if (ACPI_FAILURE (Status
))
1686 DtInsertSubtable (ParentTable
, Subtable
);
1687 NodeLength
+= Subtable
->Length
;
1690 * Padding - Variable-length data
1691 * Optionally allows the offset of the ID mappings to be used
1692 * for filling this field.
1694 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort1a
,
1696 if (ACPI_FAILURE (Status
))
1703 DtInsertSubtable (ParentTable
, Subtable
);
1704 NodeLength
+= Subtable
->Length
;
1708 if (NodeLength
> IortNode
->MappingOffset
)
1710 return (AE_BAD_DATA
);
1713 if (NodeLength
< IortNode
->MappingOffset
)
1715 Status
= DtCompilePadding (
1716 IortNode
->MappingOffset
- NodeLength
,
1718 if (ACPI_FAILURE (Status
))
1723 DtInsertSubtable (ParentTable
, Subtable
);
1724 NodeLength
= IortNode
->MappingOffset
;
1729 case ACPI_IORT_NODE_PCI_ROOT_COMPLEX
:
1731 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort2
,
1733 if (ACPI_FAILURE (Status
))
1738 DtInsertSubtable (ParentTable
, Subtable
);
1739 NodeLength
+= Subtable
->Length
;
1742 case ACPI_IORT_NODE_SMMU
:
1744 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort3
,
1746 if (ACPI_FAILURE (Status
))
1751 DtInsertSubtable (ParentTable
, Subtable
);
1752 IortSmmu
= ACPI_CAST_PTR (ACPI_IORT_SMMU
, Subtable
->Buffer
);
1753 NodeLength
+= Subtable
->Length
;
1755 /* Compile global interrupt array */
1757 IortSmmu
->GlobalInterruptOffset
= NodeLength
;
1758 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort3a
,
1760 if (ACPI_FAILURE (Status
))
1765 DtInsertSubtable (ParentTable
, Subtable
);
1766 NodeLength
+= Subtable
->Length
;
1768 /* Compile context interrupt array */
1770 ContextIrptNumber
= 0;
1771 IortSmmu
->ContextInterruptOffset
= NodeLength
;
1774 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort3b
,
1776 if (ACPI_FAILURE (Status
))
1786 DtInsertSubtable (ParentTable
, Subtable
);
1787 NodeLength
+= Subtable
->Length
;
1788 ContextIrptNumber
++;
1791 IortSmmu
->ContextInterruptCount
= ContextIrptNumber
;
1793 /* Compile PMU interrupt array */
1796 IortSmmu
->PmuInterruptOffset
= NodeLength
;
1799 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort3c
,
1801 if (ACPI_FAILURE (Status
))
1811 DtInsertSubtable (ParentTable
, Subtable
);
1812 NodeLength
+= Subtable
->Length
;
1816 IortSmmu
->PmuInterruptCount
= PmuIrptNumber
;
1819 case ACPI_IORT_NODE_SMMU_V3
:
1821 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIort4
,
1823 if (ACPI_FAILURE (Status
))
1828 DtInsertSubtable (ParentTable
, Subtable
);
1829 NodeLength
+= Subtable
->Length
;
1834 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "IORT");
1838 /* Compile Array of ID mappings */
1840 IortNode
->MappingOffset
= NodeLength
;
1841 IdMappingNumber
= 0;
1844 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIortMap
,
1846 if (ACPI_FAILURE (Status
))
1856 DtInsertSubtable (ParentTable
, Subtable
);
1857 NodeLength
+= sizeof (ACPI_IORT_ID_MAPPING
);
1861 IortNode
->MappingCount
= IdMappingNumber
;
1862 if (!IdMappingNumber
)
1864 IortNode
->MappingOffset
= 0;
1868 * Node length can be determined by DT_LENGTH option
1869 * IortNode->Length = NodeLength;
1872 ParentTable
= DtPeekSubtable ();
1876 Iort
->NodeCount
= NodeNumber
;
1881 /******************************************************************************
1883 * FUNCTION: DtCompileIvrs
1885 * PARAMETERS: List - Current field list pointer
1889 * DESCRIPTION: Compile IVRS.
1891 *****************************************************************************/
1898 DT_SUBTABLE
*Subtable
;
1899 DT_SUBTABLE
*ParentTable
;
1900 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1901 DT_FIELD
*SubtableStart
;
1902 ACPI_DMTABLE_INFO
*InfoTable
;
1903 ACPI_IVRS_HEADER
*IvrsHeader
;
1907 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIvrs
,
1909 if (ACPI_FAILURE (Status
))
1914 ParentTable
= DtPeekSubtable ();
1915 DtInsertSubtable (ParentTable
, Subtable
);
1919 SubtableStart
= *PFieldList
;
1920 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIvrsHdr
,
1922 if (ACPI_FAILURE (Status
))
1927 ParentTable
= DtPeekSubtable ();
1928 DtInsertSubtable (ParentTable
, Subtable
);
1929 DtPushSubtable (Subtable
);
1931 IvrsHeader
= ACPI_CAST_PTR (ACPI_IVRS_HEADER
, Subtable
->Buffer
);
1933 switch (IvrsHeader
->Type
)
1935 case ACPI_IVRS_TYPE_HARDWARE
:
1937 InfoTable
= AcpiDmTableInfoIvrs0
;
1940 case ACPI_IVRS_TYPE_MEMORY1
:
1941 case ACPI_IVRS_TYPE_MEMORY2
:
1942 case ACPI_IVRS_TYPE_MEMORY3
:
1944 InfoTable
= AcpiDmTableInfoIvrs1
;
1949 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "IVRS");
1953 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
);
1954 if (ACPI_FAILURE (Status
))
1959 ParentTable
= DtPeekSubtable ();
1960 DtInsertSubtable (ParentTable
, Subtable
);
1962 if (IvrsHeader
->Type
== ACPI_IVRS_TYPE_HARDWARE
)
1964 while (*PFieldList
&&
1965 !strcmp ((*PFieldList
)->Name
, "Entry Type"))
1967 SubtableStart
= *PFieldList
;
1968 DtCompileInteger (&EntryType
, *PFieldList
, 1, 0);
1972 /* 4-byte device entries */
1974 case ACPI_IVRS_TYPE_PAD4
:
1975 case ACPI_IVRS_TYPE_ALL
:
1976 case ACPI_IVRS_TYPE_SELECT
:
1977 case ACPI_IVRS_TYPE_START
:
1978 case ACPI_IVRS_TYPE_END
:
1980 InfoTable
= AcpiDmTableInfoIvrs4
;
1983 /* 8-byte entries, type A */
1985 case ACPI_IVRS_TYPE_ALIAS_SELECT
:
1986 case ACPI_IVRS_TYPE_ALIAS_START
:
1988 InfoTable
= AcpiDmTableInfoIvrs8a
;
1991 /* 8-byte entries, type B */
1993 case ACPI_IVRS_TYPE_PAD8
:
1994 case ACPI_IVRS_TYPE_EXT_SELECT
:
1995 case ACPI_IVRS_TYPE_EXT_START
:
1997 InfoTable
= AcpiDmTableInfoIvrs8b
;
2000 /* 8-byte entries, type C */
2002 case ACPI_IVRS_TYPE_SPECIAL
:
2004 InfoTable
= AcpiDmTableInfoIvrs8c
;
2009 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
,
2010 "IVRS Device Entry");
2014 Status
= DtCompileTable (PFieldList
, InfoTable
,
2016 if (ACPI_FAILURE (Status
))
2021 DtInsertSubtable (ParentTable
, Subtable
);