iASL/TableCompiler: Fix form DMAR compilation problems.

Fixes problems with the optional DMAR subtables.
ACPICA BZ 999. Lv Zheng.
This commit is contained in:
Robert Moore 2013-05-21 12:55:04 -07:00
parent b6819e3036
commit b569b601b7
6 changed files with 34 additions and 15 deletions

View File

@ -819,6 +819,11 @@ AcpiDmDumpTable (
ByteLength = 8;
break;
case ACPI_DMT_BUF10:
ByteLength = 10;
break;
case ACPI_DMT_BUF16:
case ACPI_DMT_UUID:
@ -937,6 +942,7 @@ AcpiDmDumpTable (
break;
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF128:
/*

View File

@ -944,6 +944,7 @@ AcpiDmDumpDmar (
{
return;
}
AcpiOsPrintf ("\n");
switch (SubTable->Type)
{
@ -996,6 +997,7 @@ AcpiDmDumpDmar (
{
return;
}
AcpiOsPrintf ("\n");
/* Dump the PCI Path entries for this device scope */
@ -1013,6 +1015,7 @@ AcpiDmDumpDmar (
PathOffset += 2;
PciPath += 2;
AcpiOsPrintf ("\n");
}
/* Point to next device scope entry */

View File

@ -852,6 +852,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[] =
{
{ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width", 0},
{ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags", 0},
{ACPI_DMT_BUF10, ACPI_DMAR_OFFSET (Reserved[0]), "Reserved", 0},
ACPI_DMT_TERMINATOR
};

View File

@ -613,8 +613,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);
@ -625,17 +626,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)
{
@ -693,10 +684,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);
@ -709,9 +703,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);
@ -723,10 +720,15 @@ DtCompileDmar (
ParentTable = DtPeekSubtable ();
DtInsertSubtable (ParentTable, Subtable);
PciPathLength -= Subtable->Length;
}
DtPopSubtable ();
DeviceScopeLength -= DmarDeviceScope->Length;
}
DtPopSubtable ();
DtPopSubtable ();
}
return (AE_OK);

View File

@ -469,6 +469,7 @@ DtGetFieldType (
case ACPI_DMT_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF10:
case ACPI_DMT_BUF16:
case ACPI_DMT_BUF128:
case ACPI_DMT_PCI_PATH:
@ -702,6 +703,11 @@ DtGetFieldLength (
}
break;
case ACPI_DMT_BUF10:
ByteLength = 10;
break;
case ACPI_DMT_BUF16:
case ACPI_DMT_UUID:

View File

@ -180,6 +180,7 @@ typedef enum
ACPI_DMT_UINT56,
ACPI_DMT_UINT64,
ACPI_DMT_BUF7,
ACPI_DMT_BUF10,
ACPI_DMT_BUF16,
ACPI_DMT_BUF128,
ACPI_DMT_SIG,