summaryrefslogtreecommitdiff
path: root/source/compiler/dtcompile.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/dtcompile.c')
-rw-r--r--source/compiler/dtcompile.c75
1 files changed, 66 insertions, 9 deletions
diff --git a/source/compiler/dtcompile.c b/source/compiler/dtcompile.c
index 0b949191570d..827905529d79 100644
--- a/source/compiler/dtcompile.c
+++ b/source/compiler/dtcompile.c
@@ -283,7 +283,7 @@ static ACPI_STATUS
DtCompileDataTable (
DT_FIELD **FieldList)
{
- ACPI_DMTABLE_DATA *TableData;
+ const ACPI_DMTABLE_DATA *TableData;
DT_SUBTABLE *Subtable;
char *Signature;
ACPI_TABLE_HEADER *AcpiTableHeader;
@@ -358,7 +358,7 @@ DtCompileDataTable (
TableData = AcpiDmGetTableData (Signature);
if (!TableData || Gbl_CompileGeneric)
{
- DtCompileGeneric ((void **) FieldList);
+ DtCompileGeneric ((void **) FieldList, NULL, NULL);
goto FinishHeader;
}
@@ -436,14 +436,14 @@ DtCompileTable (
DT_FIELD *LocalField;
UINT32 Length;
DT_SUBTABLE *Subtable;
- DT_SUBTABLE *InlineSubtable;
+ DT_SUBTABLE *InlineSubtable = NULL;
UINT32 FieldLength = 0;
UINT8 FieldType;
UINT8 *Buffer;
UINT8 *FlagBuffer = NULL;
char *String;
UINT32 CurrentFlagByteOffset = 0;
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
if (!Field || !*Field)
@@ -479,6 +479,7 @@ DtCompileTable (
Buffer = Subtable->Buffer;
LocalField = *Field;
+ Subtable->Name = LocalField->Name;
/*
* Main loop walks the info table for this ACPI table or subtable
@@ -555,15 +556,32 @@ DtCompileTable (
*/
*Field = LocalField;
- if (Info->Opcode == ACPI_DMT_GAS)
+ switch (Info->Opcode)
{
+ case ACPI_DMT_GAS:
+
Status = DtCompileTable (Field, AcpiDmTableInfoGas,
&InlineSubtable, TRUE);
- }
- else
- {
+ break;
+
+ case ACPI_DMT_HESTNTFY:
+
Status = DtCompileTable (Field, AcpiDmTableInfoHestNotify,
&InlineSubtable, TRUE);
+ break;
+
+ case ACPI_DMT_IORTMEM:
+
+ Status = DtCompileTable (Field, AcpiDmTableInfoIortAcc,
+ &InlineSubtable, TRUE);
+ break;
+
+ default:
+ sprintf (MsgBuffer, "Invalid DMT opcode: 0x%.2X",
+ Info->Opcode);
+ DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, MsgBuffer);
+ Status = AE_BAD_DATA;
+ break;
}
if (ACPI_FAILURE (Status))
@@ -600,7 +618,6 @@ DtCompileTable (
Subtable->LengthField = Buffer;
Subtable->SizeOfLengthField = FieldLength;
}
-
break;
}
@@ -616,3 +633,43 @@ Error:
ACPI_FREE (Subtable);
return (Status);
}
+
+
+/******************************************************************************
+ *
+ * FUNCTION: DtCompilePadding
+ *
+ * PARAMETERS: Length - Padding field size
+ * RetSubtable - Compile result of table
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile a subtable for padding purpose
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompilePadding (
+ UINT32 Length,
+ DT_SUBTABLE **RetSubtable)
+{
+ DT_SUBTABLE *Subtable;
+ /* UINT8 *Buffer; */
+ char *String;
+
+
+ Subtable = UtSubtableCacheCalloc ();
+
+ if (Length > 0)
+ {
+ String = UtStringCacheCalloc (Length);
+ Subtable->Buffer = ACPI_CAST_PTR (UINT8, String);
+ }
+
+ Subtable->Length = Length;
+ Subtable->TotalLength = Length;
+ /* Buffer = Subtable->Buffer; */
+
+ *RetSubtable = Subtable;
+ return (AE_OK);
+}