summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler/dttable.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/compiler/dttable.c')
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index fe15822..bb6c7cb 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -541,8 +541,9 @@ DtCompileDmar (
DT_FIELD *SubtableStart;
ACPI_DMTABLE_INFO *InfoTable;
ACPI_DMAR_HEADER *DmarHeader;
- UINT8 *ReservedBuffer;
- UINT32 ReservedSize;
+ ACPI_DMAR_DEVICE_SCOPE *DmarDeviceScope;
+ UINT32 DeviceScopeLength;
+ UINT32 PciPathLength;
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmar, &Subtable, TRUE);
@@ -553,17 +554,7 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
-
- /* DMAR Reserved area */
-
- ReservedSize = (UINT32) sizeof (((ACPI_TABLE_DMAR *) NULL)->Reserved);
- ReservedBuffer = UtLocalCalloc (ReservedSize);
-
- DtCreateSubtable (ReservedBuffer, ReservedSize, &Subtable);
-
- ACPI_FREE (ReservedBuffer);
- ParentTable = DtPeekSubtable ();
- DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
while (*PFieldList)
{
@@ -621,10 +612,13 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
/* Optional Device Scope subtables */
- while (*PFieldList)
+ DeviceScopeLength = DmarHeader->Length - Subtable->Length -
+ ParentTable->Length;
+ while (DeviceScopeLength)
{
Status = DtCompileTable (PFieldList, AcpiDmTableInfoDmarScope,
&Subtable, FALSE);
@@ -637,9 +631,12 @@ DtCompileDmar (
DtInsertSubtable (ParentTable, Subtable);
DtPushSubtable (Subtable);
+ DmarDeviceScope = ACPI_CAST_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable->Buffer);
+
/* Optional PCI Paths */
- while (*PFieldList)
+ PciPathLength = DmarDeviceScope->Length - Subtable->Length;
+ while (PciPathLength)
{
Status = DtCompileTable (PFieldList, TableInfoDmarPciPath,
&Subtable, FALSE);
@@ -651,10 +648,15 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
+ PciPathLength -= Subtable->Length;
}
+
+ DtPopSubtable ();
+ DeviceScopeLength -= DmarDeviceScope->Length;
}
DtPopSubtable ();
+ DtPopSubtable ();
}
return (AE_OK);
OpenPOWER on IntegriCloud