Update disassembler for DMAR table changes.

Now supports the 2007 intel Virtualization Technology for
Directed I/O specification.
This commit is contained in:
Robert Moore 2008-05-20 13:28:37 -07:00
parent b622e9f4d8
commit d6b7ac2fe2
5 changed files with 64 additions and 46 deletions

View File

@ -151,6 +151,7 @@ static const char *AcpiDmDmarSubnames[] =
{
"Hardware Unit Definition",
"Reserved Memory Region",
"Root Port ATS Capability",
"Unknown SubTable Type" /* Reserved */
};

View File

@ -536,6 +536,10 @@ AcpiDmDumpDmar (
InfoTable = AcpiDmTableInfoDmar1;
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
break;
case ACPI_DMAR_TYPE_ATSR:
InfoTable = AcpiDmTableInfoDmar2;
ScopeOffset = sizeof (ACPI_DMAR_TYPE_ATSR);
break;
default:
AcpiOsPrintf ("\n**** Unknown DMAR sub-table type %X\n\n", SubTable->Type);
return;
@ -548,49 +552,42 @@ AcpiDmDumpDmar (
return;
}
/*
* Currently, a common flag indicates whether there are any
* device scope entries present at the end of the subtable.
*/
if ((SubTable->Flags & ACPI_DMAR_INCLUDE_ALL) == 0)
/* Dump the device scope entries (if any) */
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
while (ScopeOffset < SubTable->Length)
{
/* Dump the device scope entries */
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
while (ScopeOffset < SubTable->Length)
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
ScopeTable->Length, AcpiDmTableInfoDmarScope);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("\n");
Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
ScopeTable->Length, AcpiDmTableInfoDmarScope);
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump the PCI Path entries for this device scope */
PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
sizeof (ACPI_DMAR_DEVICE_SCOPE));
while (PathOffset < ScopeTable->Length)
{
AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
/* Point to next PCI Path entry */
PathOffset += 2;
PciPath += 2;
}
/* Point to next device scope entry */
ScopeOffset += ScopeTable->Length;
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
ScopeTable, ScopeTable->Length);
return;
}
/* Dump the PCI Path entries for this device scope */
PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
sizeof (ACPI_DMAR_DEVICE_SCOPE));
while (PathOffset < ScopeTable->Length)
{
AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
AcpiOsPrintf ("[%2.2X, %2.2X]\n", PciPath[0], PciPath[1]);
/* Point to next PCI Path entry */
PathOffset += 2;
PciPath += 2;
}
/* Point to next device scope entry */
ScopeOffset += ScopeTable->Length;
ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
ScopeTable, ScopeTable->Length);
}
/* Point to next sub-table */

View File

@ -162,6 +162,7 @@
#define ACPI_DMARS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
#define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
#define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
#define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
#define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
@ -576,6 +577,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[] =
{
{ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Width), "Host Address Width"},
{ACPI_DMT_UINT8, ACPI_DMAR_OFFSET (Flags), "Flags"},
{ACPI_DMT_EXIT, 0, NULL}
};
@ -585,8 +587,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[] =
{
{ACPI_DMT_DMAR, ACPI_DMAR0_OFFSET (Header.Type), "Subtable Type"},
{ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Header.Length), "Length"},
{ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Header.Flags), "Flags"},
{ACPI_DMT_UINT24, ACPI_DMAR0_OFFSET (Header.Reserved[0]), "Reserved"},
{ACPI_DMT_EXIT, 0, NULL}
};
@ -596,7 +596,8 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
{
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EntryType), "Device Scope Entry Type"},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Length), "Entry Length"},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Segment), "PCI Segment Number"},
{ACPI_DMT_UINT16, ACPI_DMARS_OFFSET (Reserved), "Reserved"},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (EnumerationId), "Enumeration ID"},
{ACPI_DMT_UINT8, ACPI_DMARS_OFFSET (Bus), "PCI Bus Number"},
{ACPI_DMT_EXIT, 0, NULL}
};
@ -607,19 +608,34 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[] =
{
{ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Flags), "Flags"},
{ACPI_DMT_UINT8, ACPI_DMAR0_OFFSET (Reserved), "Reserved"},
{ACPI_DMT_UINT16, ACPI_DMAR0_OFFSET (Segment), "PCI Segment Number"},
{ACPI_DMT_UINT64, ACPI_DMAR0_OFFSET (Address), "Register Base Address"},
{ACPI_DMT_EXIT, 0, NULL}
};
/* 1: Reserved Memory Defininition */
/* 1: Reserved Memory Definition */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[] =
{
{ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (Address), "Base Address"},
{ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Reserved), "Reserved"},
{ACPI_DMT_UINT16, ACPI_DMAR1_OFFSET (Segment), "PCI Segment Number"},
{ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (BaseAddress), "Base Address"},
{ACPI_DMT_UINT64, ACPI_DMAR1_OFFSET (EndAddress), "End Address (limit)"},
{ACPI_DMT_EXIT, 0, NULL}
};
/* 2: Root Port ATS Capability Definition */
ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[] =
{
{ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Flags), "Flags"},
{ACPI_DMT_UINT8, ACPI_DMAR2_OFFSET (Reserved), "Reserved"},
{ACPI_DMT_UINT16, ACPI_DMAR2_OFFSET (Segment), "PCI Segment Number"},
{ACPI_DMT_EXIT, 0, NULL}
};
/*******************************************************************************
*
@ -1034,7 +1050,6 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[] =
{ACPI_DMT_UINT16, ACPI_SRAT1_OFFSET (Reserved), "Reserved"},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (BaseAddress), "Base Address"},
{ACPI_DMT_UINT64, ACPI_SRAT1_OFFSET (Length), "Address Length"},
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (MemoryType), "Memory Type"},
{ACPI_DMT_UINT32, ACPI_SRAT1_OFFSET (Flags), "Flags (decoded below)"},
{ACPI_DMT_FLAG0, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Enabled"},
{ACPI_DMT_FLAG1, ACPI_SRAT1_FLAG_OFFSET (Flags,0), "Hot Pluggable"},

View File

@ -249,6 +249,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarScope[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];

4
source/include/actbl1.h Executable file → Normal file
View File

@ -436,6 +436,10 @@ typedef struct acpi_table_dmar
} ACPI_TABLE_DMAR;
/* Flags */
#define ACPI_DMAR_INTR_REMAP (1)
/* DMAR subtable header */
typedef struct acpi_dmar_header