1 /******************************************************************************
3 * Module Name: dttable.c - handling for specific ACPI tables
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
46 /* Compile all complex data tables */
48 #include "aslcompiler.h"
49 #include "dtcompiler.h"
51 #define _COMPONENT DT_COMPILER
52 ACPI_MODULE_NAME ("dttable")
55 /* TBD: merge these into dmtbinfo.c? */
57 static ACPI_DMTABLE_INFO TableInfoAsfAddress
[] =
59 {ACPI_DMT_BUFFER
, 0, "Addresses", 0},
60 {ACPI_DMT_EXIT
, 0, NULL
, 0}
63 static ACPI_DMTABLE_INFO TableInfoDmarPciPath
[] =
65 {ACPI_DMT_PCI_PATH
, 0, "PCI Path", 0},
66 {ACPI_DMT_EXIT
, 0, NULL
, 0}
70 /* TBD: move to acmacros.h */
72 #define ACPI_SUB_PTR(t, a, b) \
73 ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
76 /* Local prototypes */
79 DtCompileTwoSubtables (
81 ACPI_DMTABLE_INFO
*TableInfo1
,
82 ACPI_DMTABLE_INFO
*TableInfo2
);
85 /******************************************************************************
87 * FUNCTION: DtCompileTwoSubtables
89 * PARAMETERS: List - Current field list pointer
90 * TableInfo1 - Info table 1
91 * TableInfo1 - Info table 2
95 * DESCRIPTION: Compile tables with a header and one or more same subtables.
96 * Include CPEP, EINJ, ERST, MCFG, MSCT, WDAT
98 *****************************************************************************/
101 DtCompileTwoSubtables (
103 ACPI_DMTABLE_INFO
*TableInfo1
,
104 ACPI_DMTABLE_INFO
*TableInfo2
)
107 DT_SUBTABLE
*Subtable
;
108 DT_SUBTABLE
*ParentTable
;
109 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
112 Status
= DtCompileTable (PFieldList
, TableInfo1
, &Subtable
, TRUE
);
113 if (ACPI_FAILURE (Status
))
118 ParentTable
= DtPeekSubtable ();
119 DtInsertSubtable (ParentTable
, Subtable
);
123 Status
= DtCompileTable (PFieldList
, TableInfo2
, &Subtable
, FALSE
);
124 if (ACPI_FAILURE (Status
))
129 DtInsertSubtable (ParentTable
, Subtable
);
136 /******************************************************************************
138 * FUNCTION: DtCompileFacs
140 * PARAMETERS: PFieldList - Current field list pointer
144 * DESCRIPTION: Compile FACS.
146 *****************************************************************************/
150 DT_FIELD
**PFieldList
)
152 DT_SUBTABLE
*Subtable
;
153 UINT8
*ReservedBuffer
;
158 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFacs
,
159 &Gbl_RootTable
, TRUE
);
160 if (ACPI_FAILURE (Status
))
165 /* Large FACS reserved area at the end of the table */
167 ReservedSize
= (UINT32
) sizeof (((ACPI_TABLE_FACS
*) NULL
)->Reserved1
);
168 ReservedBuffer
= UtLocalCalloc (ReservedSize
);
170 DtCreateSubtable (ReservedBuffer
, ReservedSize
, &Subtable
);
172 ACPI_FREE (ReservedBuffer
);
173 DtInsertSubtable (Gbl_RootTable
, Subtable
);
178 /******************************************************************************
180 * FUNCTION: DtCompileRsdp
182 * PARAMETERS: PFieldList - Current field list pointer
186 * DESCRIPTION: Compile RSDP.
188 *****************************************************************************/
192 DT_FIELD
**PFieldList
)
194 DT_SUBTABLE
*Subtable
;
195 ACPI_TABLE_RSDP
*Rsdp
;
196 ACPI_RSDP_EXTENSION
*RsdpExtension
;
200 /* Compile the "common" RSDP (ACPI 1.0) */
202 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoRsdp1
,
203 &Gbl_RootTable
, TRUE
);
204 if (ACPI_FAILURE (Status
))
209 Rsdp
= ACPI_CAST_PTR (ACPI_TABLE_RSDP
, Gbl_RootTable
->Buffer
);
210 DtSetTableChecksum (&Rsdp
->Checksum
);
212 if (Rsdp
->Revision
> 0)
214 /* Compile the "extended" part of the RSDP as a subtable */
216 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoRsdp2
,
218 if (ACPI_FAILURE (Status
))
223 DtInsertSubtable (Gbl_RootTable
, Subtable
);
225 /* Set length and extended checksum for entire RSDP */
227 RsdpExtension
= ACPI_CAST_PTR (ACPI_RSDP_EXTENSION
, Subtable
->Buffer
);
228 RsdpExtension
->Length
= Gbl_RootTable
->Length
+ Subtable
->Length
;
229 DtSetTableChecksum (&RsdpExtension
->ExtendedChecksum
);
236 /******************************************************************************
238 * FUNCTION: DtCompileAsf
240 * PARAMETERS: List - Current field list pointer
244 * DESCRIPTION: Compile ASF!.
246 *****************************************************************************/
252 ACPI_ASF_INFO
*AsfTable
;
253 DT_SUBTABLE
*Subtable
;
254 DT_SUBTABLE
*ParentTable
;
255 ACPI_DMTABLE_INFO
*InfoTable
;
256 ACPI_DMTABLE_INFO
*DataInfoTable
= NULL
;
257 UINT32 DataCount
= 0;
260 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
261 DT_FIELD
*SubtableStart
;
266 SubtableStart
= *PFieldList
;
267 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoAsfHdr
,
269 if (ACPI_FAILURE (Status
))
274 ParentTable
= DtPeekSubtable ();
275 DtInsertSubtable (ParentTable
, Subtable
);
276 DtPushSubtable (Subtable
);
278 AsfTable
= ACPI_CAST_PTR (ACPI_ASF_INFO
, Subtable
->Buffer
);
280 switch (AsfTable
->Header
.Type
& 0x7F) /* Mask off top bit */
282 case ACPI_ASF_TYPE_INFO
:
284 InfoTable
= AcpiDmTableInfoAsf0
;
287 case ACPI_ASF_TYPE_ALERT
:
289 InfoTable
= AcpiDmTableInfoAsf1
;
292 case ACPI_ASF_TYPE_CONTROL
:
294 InfoTable
= AcpiDmTableInfoAsf2
;
297 case ACPI_ASF_TYPE_BOOT
:
299 InfoTable
= AcpiDmTableInfoAsf3
;
302 case ACPI_ASF_TYPE_ADDRESS
:
304 InfoTable
= AcpiDmTableInfoAsf4
;
309 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "ASF!");
313 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
314 if (ACPI_FAILURE (Status
))
319 ParentTable
= DtPeekSubtable ();
320 DtInsertSubtable (ParentTable
, Subtable
);
322 switch (AsfTable
->Header
.Type
& 0x7F) /* Mask off top bit */
324 case ACPI_ASF_TYPE_INFO
:
326 DataInfoTable
= NULL
;
329 case ACPI_ASF_TYPE_ALERT
:
331 DataInfoTable
= AcpiDmTableInfoAsf1a
;
332 DataCount
= ACPI_CAST_PTR (ACPI_ASF_ALERT
,
333 ACPI_SUB_PTR (UINT8
, Subtable
->Buffer
,
334 sizeof (ACPI_ASF_HEADER
)))->Alerts
;
337 case ACPI_ASF_TYPE_CONTROL
:
339 DataInfoTable
= AcpiDmTableInfoAsf2a
;
340 DataCount
= ACPI_CAST_PTR (ACPI_ASF_REMOTE
,
341 ACPI_SUB_PTR (UINT8
, Subtable
->Buffer
,
342 sizeof (ACPI_ASF_HEADER
)))->Controls
;
345 case ACPI_ASF_TYPE_BOOT
:
347 DataInfoTable
= NULL
;
350 case ACPI_ASF_TYPE_ADDRESS
:
352 DataInfoTable
= TableInfoAsfAddress
;
353 DataCount
= ACPI_CAST_PTR (ACPI_ASF_ADDRESS
,
354 ACPI_SUB_PTR (UINT8
, Subtable
->Buffer
,
355 sizeof (ACPI_ASF_HEADER
)))->Devices
;
360 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "ASF!");
366 switch (AsfTable
->Header
.Type
& 0x7F)
368 case ACPI_ASF_TYPE_ADDRESS
:
370 while (DataCount
> 0)
372 Status
= DtCompileTable (PFieldList
, DataInfoTable
,
374 if (ACPI_FAILURE (Status
))
379 DtInsertSubtable (ParentTable
, Subtable
);
380 DataCount
= DataCount
- Subtable
->Length
;
386 for (i
= 0; i
< DataCount
; i
++)
388 Status
= DtCompileTable (PFieldList
, DataInfoTable
,
390 if (ACPI_FAILURE (Status
))
395 DtInsertSubtable (ParentTable
, Subtable
);
408 /******************************************************************************
410 * FUNCTION: DtCompileCpep
412 * PARAMETERS: List - Current field list pointer
416 * DESCRIPTION: Compile CPEP.
418 *****************************************************************************/
427 Status
= DtCompileTwoSubtables (List
,
428 AcpiDmTableInfoCpep
, AcpiDmTableInfoCpep0
);
433 /******************************************************************************
435 * FUNCTION: DtCompileCsrt
437 * PARAMETERS: List - Current field list pointer
441 * DESCRIPTION: Compile CSRT.
443 *****************************************************************************/
449 ACPI_STATUS Status
= AE_OK
;
450 DT_SUBTABLE
*Subtable
;
451 DT_SUBTABLE
*ParentTable
;
452 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
453 UINT32 DescriptorCount
;
457 /* Sub-tables (Resource Groups) */
461 /* Resource group subtable */
463 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoCsrt0
,
465 if (ACPI_FAILURE (Status
))
470 /* Compute the number of resource descriptors */
473 (ACPI_CAST_PTR (ACPI_CSRT_GROUP
,
474 Subtable
->Buffer
))->Length
-
475 (ACPI_CAST_PTR (ACPI_CSRT_GROUP
,
476 Subtable
->Buffer
))->SharedInfoLength
-
477 sizeof (ACPI_CSRT_GROUP
);
479 DescriptorCount
= (GroupLength
/
480 sizeof (ACPI_CSRT_DESCRIPTOR
));
482 ParentTable
= DtPeekSubtable ();
483 DtInsertSubtable (ParentTable
, Subtable
);
484 DtPushSubtable (Subtable
);
486 /* Shared info subtable (One per resource group) */
488 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoCsrt1
,
490 if (ACPI_FAILURE (Status
))
495 ParentTable
= DtPeekSubtable ();
496 DtInsertSubtable (ParentTable
, Subtable
);
498 /* Sub-Subtables (Resource Descriptors) */
500 while (*PFieldList
&& DescriptorCount
)
502 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoCsrt2
,
504 if (ACPI_FAILURE (Status
))
509 ParentTable
= DtPeekSubtable ();
510 DtInsertSubtable (ParentTable
, Subtable
);
521 /******************************************************************************
523 * FUNCTION: DtCompileDmar
525 * PARAMETERS: List - Current field list pointer
529 * DESCRIPTION: Compile DMAR.
531 *****************************************************************************/
538 DT_SUBTABLE
*Subtable
;
539 DT_SUBTABLE
*ParentTable
;
540 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
541 DT_FIELD
*SubtableStart
;
542 ACPI_DMTABLE_INFO
*InfoTable
;
543 ACPI_DMAR_HEADER
*DmarHeader
;
544 ACPI_DMAR_DEVICE_SCOPE
*DmarDeviceScope
;
545 UINT32 DeviceScopeLength
;
546 UINT32 PciPathLength
;
549 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoDmar
, &Subtable
, TRUE
);
550 if (ACPI_FAILURE (Status
))
555 ParentTable
= DtPeekSubtable ();
556 DtInsertSubtable (ParentTable
, Subtable
);
557 DtPushSubtable (Subtable
);
563 SubtableStart
= *PFieldList
;
564 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoDmarHdr
,
566 if (ACPI_FAILURE (Status
))
571 ParentTable
= DtPeekSubtable ();
572 DtInsertSubtable (ParentTable
, Subtable
);
573 DtPushSubtable (Subtable
);
575 DmarHeader
= ACPI_CAST_PTR (ACPI_DMAR_HEADER
, Subtable
->Buffer
);
577 switch (DmarHeader
->Type
)
579 case ACPI_DMAR_TYPE_HARDWARE_UNIT
:
581 InfoTable
= AcpiDmTableInfoDmar0
;
584 case ACPI_DMAR_TYPE_RESERVED_MEMORY
:
586 InfoTable
= AcpiDmTableInfoDmar1
;
589 case ACPI_DMAR_TYPE_ATSR
:
591 InfoTable
= AcpiDmTableInfoDmar2
;
594 case ACPI_DMAR_HARDWARE_AFFINITY
:
596 InfoTable
= AcpiDmTableInfoDmar3
;
601 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "DMAR");
607 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
608 if (ACPI_FAILURE (Status
))
613 ParentTable
= DtPeekSubtable ();
614 DtInsertSubtable (ParentTable
, Subtable
);
615 DtPushSubtable (Subtable
);
617 /* Optional Device Scope subtables */
619 DeviceScopeLength
= DmarHeader
->Length
- Subtable
->Length
-
621 while (DeviceScopeLength
)
623 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoDmarScope
,
625 if (Status
== AE_NOT_FOUND
)
630 ParentTable
= DtPeekSubtable ();
631 DtInsertSubtable (ParentTable
, Subtable
);
632 DtPushSubtable (Subtable
);
634 DmarDeviceScope
= ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE
, Subtable
->Buffer
);
636 /* Optional PCI Paths */
638 PciPathLength
= DmarDeviceScope
->Length
- Subtable
->Length
;
639 while (PciPathLength
)
641 Status
= DtCompileTable (PFieldList
, TableInfoDmarPciPath
,
643 if (Status
== AE_NOT_FOUND
)
649 ParentTable
= DtPeekSubtable ();
650 DtInsertSubtable (ParentTable
, Subtable
);
651 PciPathLength
-= Subtable
->Length
;
655 DeviceScopeLength
-= DmarDeviceScope
->Length
;
666 /******************************************************************************
668 * FUNCTION: DtCompileEinj
670 * PARAMETERS: List - Current field list pointer
674 * DESCRIPTION: Compile EINJ.
676 *****************************************************************************/
685 Status
= DtCompileTwoSubtables (List
,
686 AcpiDmTableInfoEinj
, AcpiDmTableInfoEinj0
);
691 /******************************************************************************
693 * FUNCTION: DtCompileErst
695 * PARAMETERS: List - Current field list pointer
699 * DESCRIPTION: Compile ERST.
701 *****************************************************************************/
710 Status
= DtCompileTwoSubtables (List
,
711 AcpiDmTableInfoErst
, AcpiDmTableInfoEinj0
);
716 /******************************************************************************
718 * FUNCTION: DtCompileFadt
720 * PARAMETERS: List - Current field list pointer
724 * DESCRIPTION: Compile FADT.
726 *****************************************************************************/
733 DT_SUBTABLE
*Subtable
;
734 DT_SUBTABLE
*ParentTable
;
735 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
736 ACPI_TABLE_HEADER
*Table
;
740 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFadt1
,
742 if (ACPI_FAILURE (Status
))
747 ParentTable
= DtPeekSubtable ();
748 DtInsertSubtable (ParentTable
, Subtable
);
750 Table
= ACPI_CAST_PTR (ACPI_TABLE_HEADER
, ParentTable
->Buffer
);
751 Revision
= Table
->Revision
;
755 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFadt2
,
757 if (ACPI_FAILURE (Status
))
762 DtInsertSubtable (ParentTable
, Subtable
);
764 else if (Revision
>= 2)
766 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFadt3
,
768 if (ACPI_FAILURE (Status
))
773 DtInsertSubtable (ParentTable
, Subtable
);
777 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFadt5
,
779 if (ACPI_FAILURE (Status
))
784 DtInsertSubtable (ParentTable
, Subtable
);
792 /******************************************************************************
794 * FUNCTION: DtCompileFpdt
796 * PARAMETERS: List - Current field list pointer
800 * DESCRIPTION: Compile FPDT.
802 *****************************************************************************/
809 ACPI_FPDT_HEADER
*FpdtHeader
;
810 DT_SUBTABLE
*Subtable
;
811 DT_SUBTABLE
*ParentTable
;
812 ACPI_DMTABLE_INFO
*InfoTable
;
813 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
814 DT_FIELD
*SubtableStart
;
819 SubtableStart
= *PFieldList
;
820 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoFpdtHdr
,
822 if (ACPI_FAILURE (Status
))
827 ParentTable
= DtPeekSubtable ();
828 DtInsertSubtable (ParentTable
, Subtable
);
829 DtPushSubtable (Subtable
);
831 FpdtHeader
= ACPI_CAST_PTR (ACPI_FPDT_HEADER
, Subtable
->Buffer
);
833 switch (FpdtHeader
->Type
)
835 case ACPI_FPDT_TYPE_BOOT
:
837 InfoTable
= AcpiDmTableInfoFpdt0
;
840 case ACPI_FPDT_TYPE_S3PERF
:
842 InfoTable
= AcpiDmTableInfoFpdt1
;
847 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "FPDT");
852 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
853 if (ACPI_FAILURE (Status
))
858 ParentTable
= DtPeekSubtable ();
859 DtInsertSubtable (ParentTable
, Subtable
);
867 /******************************************************************************
869 * FUNCTION: DtCompileHest
871 * PARAMETERS: List - Current field list pointer
875 * DESCRIPTION: Compile HEST.
877 *****************************************************************************/
884 DT_SUBTABLE
*Subtable
;
885 DT_SUBTABLE
*ParentTable
;
886 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
887 DT_FIELD
*SubtableStart
;
888 ACPI_DMTABLE_INFO
*InfoTable
;
893 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHest
,
895 if (ACPI_FAILURE (Status
))
900 ParentTable
= DtPeekSubtable ();
901 DtInsertSubtable (ParentTable
, Subtable
);
905 /* Get subtable type */
907 SubtableStart
= *PFieldList
;
908 DtCompileInteger ((UINT8
*) &Type
, *PFieldList
, 2, 0);
912 case ACPI_HEST_TYPE_IA32_CHECK
:
914 InfoTable
= AcpiDmTableInfoHest0
;
917 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
919 InfoTable
= AcpiDmTableInfoHest1
;
922 case ACPI_HEST_TYPE_IA32_NMI
:
924 InfoTable
= AcpiDmTableInfoHest2
;
927 case ACPI_HEST_TYPE_AER_ROOT_PORT
:
929 InfoTable
= AcpiDmTableInfoHest6
;
932 case ACPI_HEST_TYPE_AER_ENDPOINT
:
934 InfoTable
= AcpiDmTableInfoHest7
;
937 case ACPI_HEST_TYPE_AER_BRIDGE
:
939 InfoTable
= AcpiDmTableInfoHest8
;
942 case ACPI_HEST_TYPE_GENERIC_ERROR
:
944 InfoTable
= AcpiDmTableInfoHest9
;
949 /* Cannot continue on unknown type */
951 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "HEST");
955 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
956 if (ACPI_FAILURE (Status
))
961 DtInsertSubtable (ParentTable
, Subtable
);
964 * Additional subtable data - IA32 Error Bank(s)
969 case ACPI_HEST_TYPE_IA32_CHECK
:
971 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK
,
972 Subtable
->Buffer
))->NumHardwareBanks
;
975 case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK
:
977 BankCount
= (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED
,
978 Subtable
->Buffer
))->NumHardwareBanks
;
988 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoHestBank
,
990 if (ACPI_FAILURE (Status
))
995 DtInsertSubtable (ParentTable
, Subtable
);
1004 /******************************************************************************
1006 * FUNCTION: DtCompileIvrs
1008 * PARAMETERS: List - Current field list pointer
1012 * DESCRIPTION: Compile IVRS.
1014 *****************************************************************************/
1021 DT_SUBTABLE
*Subtable
;
1022 DT_SUBTABLE
*ParentTable
;
1023 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1024 DT_FIELD
*SubtableStart
;
1025 ACPI_DMTABLE_INFO
*InfoTable
;
1026 ACPI_IVRS_HEADER
*IvrsHeader
;
1030 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIvrs
,
1032 if (ACPI_FAILURE (Status
))
1037 ParentTable
= DtPeekSubtable ();
1038 DtInsertSubtable (ParentTable
, Subtable
);
1042 SubtableStart
= *PFieldList
;
1043 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoIvrsHdr
,
1045 if (ACPI_FAILURE (Status
))
1050 ParentTable
= DtPeekSubtable ();
1051 DtInsertSubtable (ParentTable
, Subtable
);
1052 DtPushSubtable (Subtable
);
1054 IvrsHeader
= ACPI_CAST_PTR (ACPI_IVRS_HEADER
, Subtable
->Buffer
);
1056 switch (IvrsHeader
->Type
)
1058 case ACPI_IVRS_TYPE_HARDWARE
:
1060 InfoTable
= AcpiDmTableInfoIvrs0
;
1063 case ACPI_IVRS_TYPE_MEMORY1
:
1064 case ACPI_IVRS_TYPE_MEMORY2
:
1065 case ACPI_IVRS_TYPE_MEMORY3
:
1067 InfoTable
= AcpiDmTableInfoIvrs1
;
1072 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "IVRS");
1076 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
1077 if (ACPI_FAILURE (Status
))
1082 ParentTable
= DtPeekSubtable ();
1083 DtInsertSubtable (ParentTable
, Subtable
);
1085 if (IvrsHeader
->Type
== ACPI_IVRS_TYPE_HARDWARE
)
1087 while (*PFieldList
&&
1088 !ACPI_STRCMP ((*PFieldList
)->Name
, "Entry Type"))
1090 SubtableStart
= *PFieldList
;
1091 DtCompileInteger (&EntryType
, *PFieldList
, 1, 0);
1095 /* 4-byte device entries */
1097 case ACPI_IVRS_TYPE_PAD4
:
1098 case ACPI_IVRS_TYPE_ALL
:
1099 case ACPI_IVRS_TYPE_SELECT
:
1100 case ACPI_IVRS_TYPE_START
:
1101 case ACPI_IVRS_TYPE_END
:
1103 InfoTable
= AcpiDmTableInfoIvrs4
;
1106 /* 8-byte entries, type A */
1108 case ACPI_IVRS_TYPE_ALIAS_SELECT
:
1109 case ACPI_IVRS_TYPE_ALIAS_START
:
1111 InfoTable
= AcpiDmTableInfoIvrs8a
;
1114 /* 8-byte entries, type B */
1116 case ACPI_IVRS_TYPE_PAD8
:
1117 case ACPI_IVRS_TYPE_EXT_SELECT
:
1118 case ACPI_IVRS_TYPE_EXT_START
:
1120 InfoTable
= AcpiDmTableInfoIvrs8b
;
1123 /* 8-byte entries, type C */
1125 case ACPI_IVRS_TYPE_SPECIAL
:
1127 InfoTable
= AcpiDmTableInfoIvrs8c
;
1132 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
,
1133 "IVRS Device Entry");
1137 Status
= DtCompileTable (PFieldList
, InfoTable
,
1139 if (ACPI_FAILURE (Status
))
1144 DtInsertSubtable (ParentTable
, Subtable
);
1155 /******************************************************************************
1157 * FUNCTION: DtCompileMadt
1159 * PARAMETERS: List - Current field list pointer
1163 * DESCRIPTION: Compile MADT.
1165 *****************************************************************************/
1172 DT_SUBTABLE
*Subtable
;
1173 DT_SUBTABLE
*ParentTable
;
1174 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1175 DT_FIELD
*SubtableStart
;
1176 ACPI_SUBTABLE_HEADER
*MadtHeader
;
1177 ACPI_DMTABLE_INFO
*InfoTable
;
1180 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMadt
,
1182 if (ACPI_FAILURE (Status
))
1187 ParentTable
= DtPeekSubtable ();
1188 DtInsertSubtable (ParentTable
, Subtable
);
1192 SubtableStart
= *PFieldList
;
1193 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMadtHdr
,
1195 if (ACPI_FAILURE (Status
))
1200 ParentTable
= DtPeekSubtable ();
1201 DtInsertSubtable (ParentTable
, Subtable
);
1202 DtPushSubtable (Subtable
);
1204 MadtHeader
= ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER
, Subtable
->Buffer
);
1206 switch (MadtHeader
->Type
)
1208 case ACPI_MADT_TYPE_LOCAL_APIC
:
1210 InfoTable
= AcpiDmTableInfoMadt0
;
1213 case ACPI_MADT_TYPE_IO_APIC
:
1215 InfoTable
= AcpiDmTableInfoMadt1
;
1218 case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE
:
1220 InfoTable
= AcpiDmTableInfoMadt2
;
1223 case ACPI_MADT_TYPE_NMI_SOURCE
:
1225 InfoTable
= AcpiDmTableInfoMadt3
;
1228 case ACPI_MADT_TYPE_LOCAL_APIC_NMI
:
1230 InfoTable
= AcpiDmTableInfoMadt4
;
1233 case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE
:
1235 InfoTable
= AcpiDmTableInfoMadt5
;
1238 case ACPI_MADT_TYPE_IO_SAPIC
:
1240 InfoTable
= AcpiDmTableInfoMadt6
;
1243 case ACPI_MADT_TYPE_LOCAL_SAPIC
:
1245 InfoTable
= AcpiDmTableInfoMadt7
;
1248 case ACPI_MADT_TYPE_INTERRUPT_SOURCE
:
1250 InfoTable
= AcpiDmTableInfoMadt8
;
1253 case ACPI_MADT_TYPE_LOCAL_X2APIC
:
1255 InfoTable
= AcpiDmTableInfoMadt9
;
1258 case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI
:
1260 InfoTable
= AcpiDmTableInfoMadt10
;
1263 case ACPI_MADT_TYPE_GENERIC_INTERRUPT
:
1265 InfoTable
= AcpiDmTableInfoMadt11
;
1268 case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR
:
1270 InfoTable
= AcpiDmTableInfoMadt12
;
1275 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "MADT");
1279 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
1280 if (ACPI_FAILURE (Status
))
1285 ParentTable
= DtPeekSubtable ();
1286 DtInsertSubtable (ParentTable
, Subtable
);
1294 /******************************************************************************
1296 * FUNCTION: DtCompileMcfg
1298 * PARAMETERS: List - Current field list pointer
1302 * DESCRIPTION: Compile MCFG.
1304 *****************************************************************************/
1313 Status
= DtCompileTwoSubtables (List
,
1314 AcpiDmTableInfoMcfg
, AcpiDmTableInfoMcfg0
);
1319 /******************************************************************************
1321 * FUNCTION: DtCompileMpst
1323 * PARAMETERS: List - Current field list pointer
1327 * DESCRIPTION: Compile MPST.
1329 *****************************************************************************/
1336 DT_SUBTABLE
*Subtable
;
1337 DT_SUBTABLE
*ParentTable
;
1338 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1339 ACPI_MPST_CHANNEL
*MpstChannelInfo
;
1340 ACPI_MPST_POWER_NODE
*MpstPowerNode
;
1341 ACPI_MPST_DATA_HDR
*MpstDataHeader
;
1342 UINT16 SubtableCount
;
1343 UINT32 PowerStateCount
;
1344 UINT32 ComponentCount
;
1349 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst
, &Subtable
, TRUE
);
1350 if (ACPI_FAILURE (Status
))
1355 ParentTable
= DtPeekSubtable ();
1356 DtInsertSubtable (ParentTable
, Subtable
);
1357 DtPushSubtable (Subtable
);
1359 MpstChannelInfo
= ACPI_CAST_PTR (ACPI_MPST_CHANNEL
, Subtable
->Buffer
);
1360 SubtableCount
= MpstChannelInfo
->PowerNodeCount
;
1362 while (*PFieldList
&& SubtableCount
)
1364 /* Subtable: Memory Power Node(s) */
1366 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst0
,
1368 if (ACPI_FAILURE (Status
))
1373 ParentTable
= DtPeekSubtable ();
1374 DtInsertSubtable (ParentTable
, Subtable
);
1375 DtPushSubtable (Subtable
);
1377 MpstPowerNode
= ACPI_CAST_PTR (ACPI_MPST_POWER_NODE
, Subtable
->Buffer
);
1378 PowerStateCount
= MpstPowerNode
->NumPowerStates
;
1379 ComponentCount
= MpstPowerNode
->NumPhysicalComponents
;
1381 ParentTable
= DtPeekSubtable ();
1383 /* Sub-subtables - Memory Power State Structure(s) */
1385 while (*PFieldList
&& PowerStateCount
)
1387 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst0A
,
1389 if (ACPI_FAILURE (Status
))
1394 DtInsertSubtable (ParentTable
, Subtable
);
1398 /* Sub-subtables - Physical Component ID Structure(s) */
1400 while (*PFieldList
&& ComponentCount
)
1402 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst0B
,
1404 if (ACPI_FAILURE (Status
))
1409 DtInsertSubtable (ParentTable
, Subtable
);
1417 /* Subtable: Count of Memory Power State Characteristic structures */
1421 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst1
, &Subtable
, TRUE
);
1422 if (ACPI_FAILURE (Status
))
1427 ParentTable
= DtPeekSubtable ();
1428 DtInsertSubtable (ParentTable
, Subtable
);
1429 DtPushSubtable (Subtable
);
1431 MpstDataHeader
= ACPI_CAST_PTR (ACPI_MPST_DATA_HDR
, Subtable
->Buffer
);
1432 SubtableCount
= MpstDataHeader
->CharacteristicsCount
;
1434 ParentTable
= DtPeekSubtable ();
1436 /* Subtable: Memory Power State Characteristics structure(s) */
1438 while (*PFieldList
&& SubtableCount
)
1440 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoMpst2
,
1442 if (ACPI_FAILURE (Status
))
1447 DtInsertSubtable (ParentTable
, Subtable
);
1456 /******************************************************************************
1458 * FUNCTION: DtCompileMsct
1460 * PARAMETERS: List - Current field list pointer
1464 * DESCRIPTION: Compile MSCT.
1466 *****************************************************************************/
1475 Status
= DtCompileTwoSubtables (List
,
1476 AcpiDmTableInfoMsct
, AcpiDmTableInfoMsct0
);
1481 /******************************************************************************
1483 * FUNCTION: DtCompileMtmr
1485 * PARAMETERS: List - Current field list pointer
1489 * DESCRIPTION: Compile MTMR.
1491 *****************************************************************************/
1500 Status
= DtCompileTwoSubtables (List
,
1501 AcpiDmTableInfoMtmr
, AcpiDmTableInfoMtmr0
);
1506 /******************************************************************************
1508 * FUNCTION: DtCompilePmtt
1510 * PARAMETERS: List - Current field list pointer
1514 * DESCRIPTION: Compile PMTT.
1516 *****************************************************************************/
1523 DT_SUBTABLE
*Subtable
;
1524 DT_SUBTABLE
*ParentTable
;
1525 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1526 DT_FIELD
*SubtableStart
;
1527 ACPI_PMTT_HEADER
*PmttHeader
;
1528 ACPI_PMTT_CONTROLLER
*PmttController
;
1530 UINT8 PrevType
= ACPI_PMTT_TYPE_SOCKET
;
1535 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmtt
, &Subtable
, TRUE
);
1536 if (ACPI_FAILURE (Status
))
1541 ParentTable
= DtPeekSubtable ();
1542 DtInsertSubtable (ParentTable
, Subtable
);
1543 DtPushSubtable (Subtable
);
1547 SubtableStart
= *PFieldList
;
1548 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmttHdr
,
1550 if (ACPI_FAILURE (Status
))
1555 PmttHeader
= ACPI_CAST_PTR (ACPI_PMTT_HEADER
, Subtable
->Buffer
);
1556 while (PrevType
>= PmttHeader
->Type
)
1560 if (PrevType
== ACPI_PMTT_TYPE_SOCKET
)
1566 PrevType
= PmttHeader
->Type
;
1568 ParentTable
= DtPeekSubtable ();
1569 DtInsertSubtable (ParentTable
, Subtable
);
1570 DtPushSubtable (Subtable
);
1572 switch (PmttHeader
->Type
)
1574 case ACPI_PMTT_TYPE_SOCKET
:
1576 /* Subtable: Socket Structure */
1578 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmtt0
,
1580 if (ACPI_FAILURE (Status
))
1585 ParentTable
= DtPeekSubtable ();
1586 DtInsertSubtable (ParentTable
, Subtable
);
1589 case ACPI_PMTT_TYPE_CONTROLLER
:
1591 /* Subtable: Memory Controller Structure */
1593 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmtt1
,
1595 if (ACPI_FAILURE (Status
))
1600 ParentTable
= DtPeekSubtable ();
1601 DtInsertSubtable (ParentTable
, Subtable
);
1603 PmttController
= ACPI_CAST_PTR (ACPI_PMTT_CONTROLLER
,
1604 (Subtable
->Buffer
- sizeof (ACPI_PMTT_HEADER
)));
1605 DomainCount
= PmttController
->DomainCount
;
1609 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmtt1a
,
1611 if (ACPI_FAILURE (Status
))
1616 DtInsertSubtable (ParentTable
, Subtable
);
1621 case ACPI_PMTT_TYPE_DIMM
:
1623 /* Subtable: Physical Component Structure */
1625 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoPmtt2
,
1627 if (ACPI_FAILURE (Status
))
1632 ParentTable
= DtPeekSubtable ();
1633 DtInsertSubtable (ParentTable
, Subtable
);
1638 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "PMTT");
1647 /******************************************************************************
1649 * FUNCTION: DtCompileRsdt
1651 * PARAMETERS: List - Current field list pointer
1655 * DESCRIPTION: Compile RSDT.
1657 *****************************************************************************/
1663 DT_SUBTABLE
*Subtable
;
1664 DT_SUBTABLE
*ParentTable
;
1665 DT_FIELD
*FieldList
= *(DT_FIELD
**) List
;
1669 ParentTable
= DtPeekSubtable ();
1673 DtCompileInteger ((UINT8
*) &Address
, FieldList
, 4, DT_NON_ZERO
);
1675 DtCreateSubtable ((UINT8
*) &Address
, 4, &Subtable
);
1676 DtInsertSubtable (ParentTable
, Subtable
);
1677 FieldList
= FieldList
->Next
;
1684 /******************************************************************************
1686 * FUNCTION: DtCompileS3pt
1688 * PARAMETERS: PFieldList - Current field list pointer
1692 * DESCRIPTION: Compile S3PT (Pointed to by FPDT)
1694 *****************************************************************************/
1698 DT_FIELD
**PFieldList
)
1701 ACPI_S3PT_HEADER
*S3ptHeader
;
1702 DT_SUBTABLE
*Subtable
;
1703 DT_SUBTABLE
*ParentTable
;
1704 ACPI_DMTABLE_INFO
*InfoTable
;
1705 DT_FIELD
*SubtableStart
;
1708 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoS3pt
,
1709 &Gbl_RootTable
, TRUE
);
1710 if (ACPI_FAILURE (Status
))
1715 DtPushSubtable (Gbl_RootTable
);
1719 SubtableStart
= *PFieldList
;
1720 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoS3ptHdr
,
1722 if (ACPI_FAILURE (Status
))
1727 ParentTable
= DtPeekSubtable ();
1728 DtInsertSubtable (ParentTable
, Subtable
);
1729 DtPushSubtable (Subtable
);
1731 S3ptHeader
= ACPI_CAST_PTR (ACPI_S3PT_HEADER
, Subtable
->Buffer
);
1733 switch (S3ptHeader
->Type
)
1735 case ACPI_S3PT_TYPE_RESUME
:
1737 InfoTable
= AcpiDmTableInfoS3pt0
;
1740 case ACPI_S3PT_TYPE_SUSPEND
:
1742 InfoTable
= AcpiDmTableInfoS3pt1
;
1747 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "S3PT");
1751 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
1752 if (ACPI_FAILURE (Status
))
1757 ParentTable
= DtPeekSubtable ();
1758 DtInsertSubtable (ParentTable
, Subtable
);
1766 /******************************************************************************
1768 * FUNCTION: DtCompileSlic
1770 * PARAMETERS: List - Current field list pointer
1774 * DESCRIPTION: Compile SLIC.
1776 *****************************************************************************/
1783 DT_SUBTABLE
*Subtable
;
1784 DT_SUBTABLE
*ParentTable
;
1785 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1786 DT_FIELD
*SubtableStart
;
1787 ACPI_SLIC_HEADER
*SlicHeader
;
1788 ACPI_DMTABLE_INFO
*InfoTable
;
1793 SubtableStart
= *PFieldList
;
1794 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoSlicHdr
,
1796 if (ACPI_FAILURE (Status
))
1801 ParentTable
= DtPeekSubtable ();
1802 DtInsertSubtable (ParentTable
, Subtable
);
1803 DtPushSubtable (Subtable
);
1805 SlicHeader
= ACPI_CAST_PTR (ACPI_SLIC_HEADER
, Subtable
->Buffer
);
1807 switch (SlicHeader
->Type
)
1809 case ACPI_SLIC_TYPE_PUBLIC_KEY
:
1811 InfoTable
= AcpiDmTableInfoSlic0
;
1814 case ACPI_SLIC_TYPE_WINDOWS_MARKER
:
1816 InfoTable
= AcpiDmTableInfoSlic1
;
1821 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "SLIC");
1825 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
1826 if (ACPI_FAILURE (Status
))
1831 ParentTable
= DtPeekSubtable ();
1832 DtInsertSubtable (ParentTable
, Subtable
);
1840 /******************************************************************************
1842 * FUNCTION: DtCompileSlit
1844 * PARAMETERS: List - Current field list pointer
1848 * DESCRIPTION: Compile SLIT.
1850 *****************************************************************************/
1857 DT_SUBTABLE
*Subtable
;
1858 DT_SUBTABLE
*ParentTable
;
1859 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1860 DT_FIELD
*FieldList
;
1862 UINT8
*LocalityBuffer
;
1865 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoSlit
,
1867 if (ACPI_FAILURE (Status
))
1872 ParentTable
= DtPeekSubtable ();
1873 DtInsertSubtable (ParentTable
, Subtable
);
1875 Localities
= *ACPI_CAST_PTR (UINT32
, Subtable
->Buffer
);
1876 LocalityBuffer
= UtLocalCalloc (Localities
);
1878 /* Compile each locality buffer */
1880 FieldList
= *PFieldList
;
1883 DtCompileBuffer (LocalityBuffer
,
1884 FieldList
->Value
, FieldList
, Localities
);
1886 DtCreateSubtable (LocalityBuffer
, Localities
, &Subtable
);
1887 DtInsertSubtable (ParentTable
, Subtable
);
1888 FieldList
= FieldList
->Next
;
1891 ACPI_FREE (LocalityBuffer
);
1896 /******************************************************************************
1898 * FUNCTION: DtCompileSrat
1900 * PARAMETERS: List - Current field list pointer
1904 * DESCRIPTION: Compile SRAT.
1906 *****************************************************************************/
1913 DT_SUBTABLE
*Subtable
;
1914 DT_SUBTABLE
*ParentTable
;
1915 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
1916 DT_FIELD
*SubtableStart
;
1917 ACPI_SUBTABLE_HEADER
*SratHeader
;
1918 ACPI_DMTABLE_INFO
*InfoTable
;
1921 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoSrat
,
1923 if (ACPI_FAILURE (Status
))
1928 ParentTable
= DtPeekSubtable ();
1929 DtInsertSubtable (ParentTable
, Subtable
);
1933 SubtableStart
= *PFieldList
;
1934 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoSratHdr
,
1936 if (ACPI_FAILURE (Status
))
1941 ParentTable
= DtPeekSubtable ();
1942 DtInsertSubtable (ParentTable
, Subtable
);
1943 DtPushSubtable (Subtable
);
1945 SratHeader
= ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER
, Subtable
->Buffer
);
1947 switch (SratHeader
->Type
)
1949 case ACPI_SRAT_TYPE_CPU_AFFINITY
:
1951 InfoTable
= AcpiDmTableInfoSrat0
;
1954 case ACPI_SRAT_TYPE_MEMORY_AFFINITY
:
1956 InfoTable
= AcpiDmTableInfoSrat1
;
1959 case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY
:
1961 InfoTable
= AcpiDmTableInfoSrat2
;
1966 DtFatal (ASL_MSG_UNKNOWN_SUBTABLE
, SubtableStart
, "SRAT");
1970 Status
= DtCompileTable (PFieldList
, InfoTable
, &Subtable
, TRUE
);
1971 if (ACPI_FAILURE (Status
))
1976 ParentTable
= DtPeekSubtable ();
1977 DtInsertSubtable (ParentTable
, Subtable
);
1985 /******************************************************************************
1987 * FUNCTION: DtGetGenericTableInfo
1989 * PARAMETERS: Name - Generic type name
1991 * RETURN: Info entry
1993 * DESCRIPTION: Obtain table info for a generic name entry
1995 *****************************************************************************/
1998 DtGetGenericTableInfo (
2001 ACPI_DMTABLE_INFO
*Info
;
2010 /* Search info table for name match */
2014 Info
= AcpiDmTableInfoGeneric
[i
];
2015 if (Info
->Opcode
== ACPI_DMT_EXIT
)
2021 /* Use caseless compare for generic keywords */
2023 if (!AcpiUtStricmp (Name
, Info
->Name
))
2033 /******************************************************************************
2035 * FUNCTION: DtCompileUefi
2037 * PARAMETERS: List - Current field list pointer
2041 * DESCRIPTION: Compile UEFI.
2043 *****************************************************************************/
2050 DT_SUBTABLE
*Subtable
;
2051 DT_SUBTABLE
*ParentTable
;
2052 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
2056 /* Compile the predefined portion of the UEFI table */
2058 Status
= DtCompileTable (PFieldList
, AcpiDmTableInfoUefi
,
2060 if (ACPI_FAILURE (Status
))
2065 DataOffset
= (UINT16
*) (Subtable
->Buffer
+ 16);
2066 *DataOffset
= sizeof (ACPI_TABLE_UEFI
);
2068 ParentTable
= DtPeekSubtable ();
2069 DtInsertSubtable (ParentTable
, Subtable
);
2072 * Compile the "generic" portion of the UEFI table. This
2073 * part of the table is not predefined and any of the generic
2074 * operators may be used.
2077 DtCompileGeneric ((void **) PFieldList
);
2083 /******************************************************************************
2085 * FUNCTION: DtCompileVrtc
2087 * PARAMETERS: List - Current field list pointer
2091 * DESCRIPTION: Compile VRTC.
2093 *****************************************************************************/
2102 Status
= DtCompileTwoSubtables (List
,
2103 AcpiDmTableInfoVrtc
, AcpiDmTableInfoVrtc0
);
2108 /******************************************************************************
2110 * FUNCTION: DtCompileWdat
2112 * PARAMETERS: List - Current field list pointer
2116 * DESCRIPTION: Compile WDAT.
2118 *****************************************************************************/
2127 Status
= DtCompileTwoSubtables (List
,
2128 AcpiDmTableInfoWdat
, AcpiDmTableInfoWdat0
);
2133 /******************************************************************************
2135 * FUNCTION: DtCompileXsdt
2137 * PARAMETERS: List - Current field list pointer
2141 * DESCRIPTION: Compile XSDT.
2143 *****************************************************************************/
2149 DT_SUBTABLE
*Subtable
;
2150 DT_SUBTABLE
*ParentTable
;
2151 DT_FIELD
*FieldList
= *(DT_FIELD
**) List
;
2154 ParentTable
= DtPeekSubtable ();
2158 DtCompileInteger ((UINT8
*) &Address
, FieldList
, 8, DT_NON_ZERO
);
2160 DtCreateSubtable ((UINT8
*) &Address
, 8, &Subtable
);
2161 DtInsertSubtable (ParentTable
, Subtable
);
2162 FieldList
= FieldList
->Next
;
2169 /******************************************************************************
2171 * FUNCTION: DtCompileGeneric
2173 * PARAMETERS: List - Current field list pointer
2177 * DESCRIPTION: Compile generic unknown table.
2179 *****************************************************************************/
2186 DT_SUBTABLE
*Subtable
;
2187 DT_SUBTABLE
*ParentTable
;
2188 DT_FIELD
**PFieldList
= (DT_FIELD
**) List
;
2189 ACPI_DMTABLE_INFO
*Info
;
2192 ParentTable
= DtPeekSubtable ();
2195 * Compile the "generic" portion of the table. This
2196 * part of the table is not predefined and any of the generic
2197 * operators may be used.
2200 /* Find any and all labels in the entire generic portion */
2202 DtDetectAllLabels (*PFieldList
);
2204 /* Now we can actually compile the parse tree */
2208 Info
= DtGetGenericTableInfo ((*PFieldList
)->Name
);
2211 sprintf (MsgBuffer
, "Generic data type \"%s\" not found",
2212 (*PFieldList
)->Name
);
2213 DtNameError (ASL_ERROR
, ASL_MSG_INVALID_FIELD_NAME
,
2214 (*PFieldList
), MsgBuffer
);
2216 *PFieldList
= (*PFieldList
)->Next
;
2220 Status
= DtCompileTable (PFieldList
, Info
,
2222 if (ACPI_SUCCESS (Status
))
2224 DtInsertSubtable (ParentTable
, Subtable
);
2228 *PFieldList
= (*PFieldList
)->Next
;
2230 if (Status
== AE_NOT_FOUND
)
2232 sprintf (MsgBuffer
, "Generic data type \"%s\" not found",
2233 (*PFieldList
)->Name
);
2234 DtNameError (ASL_ERROR
, ASL_MSG_INVALID_FIELD_NAME
,
2235 (*PFieldList
), MsgBuffer
);