diff options
Diffstat (limited to 'source/compiler/dttable.c')
| -rw-r--r-- | source/compiler/dttable.c | 32 | 
1 files changed, 17 insertions, 15 deletions
diff --git a/source/compiler/dttable.c b/source/compiler/dttable.c index 4236c6c4daba..3b84956a6389 100644 --- a/source/compiler/dttable.c +++ b/source/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);  | 
