summaryrefslogtreecommitdiff
path: root/source/tools/acpidump/apdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/acpidump/apdump.c')
-rw-r--r--source/tools/acpidump/apdump.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/tools/acpidump/apdump.c b/source/tools/acpidump/apdump.c
index c229ba5c99c5..5000e4db7f87 100644
--- a/source/tools/acpidump/apdump.c
+++ b/source/tools/acpidump/apdump.c
@@ -46,10 +46,6 @@
/* Local prototypes */
-static BOOLEAN
-ApIsValidHeader (
- ACPI_TABLE_HEADER *Table);
-
static int
ApDumpTableBuffer (
ACPI_TABLE_HEADER *Table,
@@ -68,7 +64,7 @@ ApDumpTableBuffer (
*
******************************************************************************/
-static BOOLEAN
+BOOLEAN
ApIsValidHeader (
ACPI_TABLE_HEADER *Table)
{
@@ -77,7 +73,7 @@ ApIsValidHeader (
if (!AcpiUtValidAcpiName (Table->Signature))
{
- fprintf (stderr, "Table signature (0x%X) is invalid\n",
+ fprintf (stderr, "Table signature (0x%8.8X) is invalid\n",
*(UINT32 *) Table->Signature);
return (FALSE);
}
@@ -86,7 +82,7 @@ ApIsValidHeader (
if (Table->Length <= sizeof (ACPI_TABLE_HEADER))
{
- fprintf (stderr, "Table length (0x%X) is invalid\n",
+ fprintf (stderr, "Table length (0x%8.8X) is invalid\n",
Table->Length);
return (FALSE);
}
@@ -295,10 +291,10 @@ ApDumpTableByName (
ACPI_STATUS Status;
- if (strlen (Signature) > ACPI_NAME_SIZE)
+ if (strlen (Signature) != ACPI_NAME_SIZE)
{
fprintf (stderr,
- "Invalid table signature [%s]: too long (4 chars max)\n",
+ "Invalid table signature [%s]: must be exactly 4 characters\n",
Signature);
return (-1);
}
@@ -308,6 +304,17 @@ ApDumpTableByName (
strcpy (LocalSignature, Signature);
AcpiUtStrupr (LocalSignature);
+ /* To be friendly, handle tables whose signatures do not match the name */
+
+ if (ACPI_COMPARE_NAME (LocalSignature, "FADT"))
+ {
+ strcpy (LocalSignature, ACPI_SIG_FADT);
+ }
+ else if (ACPI_COMPARE_NAME (LocalSignature, "MADT"))
+ {
+ strcpy (LocalSignature, ACPI_SIG_MADT);
+ }
+
/* Dump all instances of this signature (to handle multiple SSDTs) */
for (Instance = 0; Instance < AP_MAX_ACPI_FILES; Instance++)