summaryrefslogtreecommitdiff
path: root/source/common
diff options
context:
space:
mode:
Diffstat (limited to 'source/common')
-rw-r--r--source/common/adfile.c8
-rw-r--r--source/common/adisasm.c66
-rw-r--r--source/common/adwalk.c8
-rw-r--r--source/common/dmextern.c1
-rw-r--r--source/common/dmrestag.c1
-rw-r--r--source/common/dmtable.c15
-rw-r--r--source/common/dmtbdump.c4
-rw-r--r--source/common/dmtbinfo.c14
-rw-r--r--source/common/getopt.c1
9 files changed, 64 insertions, 54 deletions
diff --git a/source/common/adfile.c b/source/common/adfile.c
index 2caf59954a54..2c864d4bc096 100644
--- a/source/common/adfile.c
+++ b/source/common/adfile.c
@@ -100,7 +100,7 @@ AdGenerateFilename (
FilenameBuf[i] = 0;
strcat (FilenameBuf, ACPI_TABLE_FILE_SUFFIX);
- return FilenameBuf;
+ return (FilenameBuf);
}
@@ -183,7 +183,7 @@ AdWriteTable (
* RETURN: New filename containing the original base + the new suffix
*
* DESCRIPTION: Generate a new filename from the ASL source filename and a new
- * extension. Used to create the *.LST, *.TXT, etc. files.
+ * extension. Used to create the *.LST, *.TXT, etc. files.
*
******************************************************************************/
@@ -223,7 +223,7 @@ FlGenerateFilename (
strcat (NewFilename, Suffix);
}
- return NewFilename;
+ return (NewFilename);
}
@@ -332,5 +332,3 @@ FlSplitInputPathname (
*OutFilename = Filename;
return (AE_OK);
}
-
-
diff --git a/source/common/adisasm.c b/source/common/adisasm.c
index fab36179a81d..9ba89164c534 100644
--- a/source/common/adisasm.c
+++ b/source/common/adisasm.c
@@ -296,7 +296,7 @@ AdAmlDisassemble (
Status = AcpiDbGetTableFromFile (Filename, &Table);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
/*
@@ -311,14 +311,13 @@ AdAmlDisassemble (
/* Next external file */
ExternalFileList = ExternalFileList->Next;
-
continue;
}
Status = AcpiDbGetTableFromFile (ExternalFilename, &ExternalTable);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
/* Load external table for symbol resolution */
@@ -330,7 +329,7 @@ AdAmlDisassemble (
{
AcpiOsPrintf ("Could not parse external ACPI tables, %s\n",
AcpiFormatException (Status));
- return Status;
+ return (Status);
}
/*
@@ -361,12 +360,12 @@ AdAmlDisassemble (
{
AcpiOsPrintf ("Could not get ACPI tables, %s\n",
AcpiFormatException (Status));
- return Status;
+ return (Status);
}
if (!AcpiGbl_DbOpt_disasm)
{
- return AE_OK;
+ return (AE_OK);
}
/* Obtained the local tables, just disassemble the DSDT */
@@ -376,7 +375,7 @@ AdAmlDisassemble (
{
AcpiOsPrintf ("Could not get DSDT, %s\n",
AcpiFormatException (Status));
- return Status;
+ return (Status);
}
AcpiOsPrintf ("\nDisassembly of DSDT\n");
@@ -531,7 +530,14 @@ AdAmlDisassemble (
if (AcpiGbl_DbOpt_disasm)
{
+ /* This is the real disassembly */
+
AdDisplayTables (Filename, Table);
+
+ /* Dump hex table if requested (-vt) */
+
+ AcpiDmDumpDataTable (Table);
+
fprintf (stderr, "Disassembly completed\n");
fprintf (stderr, "ASL Output: %s - %u bytes\n",
DisasmFilename, AdGetFileSize (File));
@@ -720,7 +726,7 @@ AdDisplayTables (
if (!AcpiGbl_ParseOpRoot)
{
- return AE_NOT_EXIST;
+ return (AE_NOT_EXIST);
}
if (!AcpiGbl_DbOpt_verbose)
@@ -733,15 +739,15 @@ AdDisplayTables (
if (AcpiGbl_DbOpt_verbose)
{
AcpiOsPrintf ("\n\nTable Header:\n");
- AcpiUtDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
+ AcpiUtDebugDumpBuffer ((UINT8 *) Table, sizeof (ACPI_TABLE_HEADER),
DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
AcpiOsPrintf ("Table Body (Length 0x%X)\n", Table->Length);
- AcpiUtDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)), Table->Length,
- DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
+ AcpiUtDebugDumpBuffer (((UINT8 *) Table + sizeof (ACPI_TABLE_HEADER)),
+ Table->Length, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
}
- return AE_OK;
+ return (AE_OK);
}
@@ -808,8 +814,8 @@ AdDeferredParse (
/*
* We need to update all of the Aml offsets, since the parser thought
- * that the method began at offset zero. In reality, it began somewhere
- * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that
+ * that the method began at offset zero. In reality, it began somewhere
+ * within the ACPI table, at the BaseAmlOffset. Walk the entire tree that
* was just created and update the AmlOffset in each Op
*/
BaseAmlOffset = (Op->Common.Value.Arg)->Common.AmlOffset + 1;
@@ -914,7 +920,7 @@ AdParseDeferredOps (
Status = AdDeferredParse (Op, Op->Named.Data, Op->Named.Length);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ return (Status);
}
break;
@@ -942,7 +948,7 @@ AdParseDeferredOps (
}
fprintf (stderr, "\n");
- return Status;
+ return (Status);
}
@@ -979,7 +985,7 @@ AdGetLocalTables (
if (!NewTable)
{
fprintf (stderr, "Could not obtain RSDT\n");
- return AE_NO_ACPI_TABLES;
+ return (AE_NO_ACPI_TABLES);
}
else
{
@@ -999,7 +1005,7 @@ AdGetLocalTables (
/*
* Determine the number of tables pointed to by the RSDT/XSDT.
* This is defined by the ACPI Specification to be the number of
- * pointers contained within the RSDT/XSDT. The size of the pointers
+ * pointers contained within the RSDT/XSDT. The size of the pointers
* is architecture-dependent.
*/
NumTables = (NewTable->Length - sizeof (ACPI_TABLE_HEADER)) / PointerSize;
@@ -1036,13 +1042,13 @@ AdGetLocalTables (
if (ACPI_FAILURE (Status))
{
fprintf (stderr, "Could not store DSDT\n");
- return AE_NO_ACPI_TABLES;
+ return (AE_NO_ACPI_TABLES);
}
}
else
{
fprintf (stderr, "Could not obtain DSDT\n");
- return AE_NO_ACPI_TABLES;
+ return (AE_NO_ACPI_TABLES);
}
#if 0
@@ -1061,7 +1067,7 @@ AdGetLocalTables (
} while (NewTable);
#endif
- return AE_OK;
+ return (AE_OK);
}
@@ -1096,7 +1102,7 @@ AdParseTable (
if (!Table)
{
- return AE_NOT_EXIST;
+ return (AE_NOT_EXIST);
}
/* Pass 1: Parse everything except control method bodies */
@@ -1111,7 +1117,7 @@ AdParseTable (
AcpiGbl_ParseOpRoot = AcpiPsCreateScopeOp ();
if (!AcpiGbl_ParseOpRoot)
{
- return AE_NO_MEMORY;
+ return (AE_NO_MEMORY);
}
/* Create and initialize a new walk state */
@@ -1136,7 +1142,7 @@ AdParseTable (
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
/* If LoadTable is FALSE, we are parsing the last loaded table */
@@ -1151,19 +1157,19 @@ AdParseTable (
Table->Length, ACPI_TABLE_ORIGIN_ALLOCATED, &TableIndex);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
Status = AcpiTbAllocateOwnerId (TableIndex);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
if (OwnerId)
{
Status = AcpiTbGetOwnerId (TableIndex, OwnerId);
if (ACPI_FAILURE (Status))
{
- return Status;
+ return (Status);
}
}
}
@@ -1180,7 +1186,7 @@ AdParseTable (
if (External)
{
- return AE_OK;
+ return (AE_OK);
}
/* Pass 3: Parse control methods and link their parse trees into the main parse tree */
@@ -1192,7 +1198,5 @@ AdParseTable (
AcpiDmFindResources (AcpiGbl_ParseOpRoot);
fprintf (stderr, "Parsing completed\n");
- return AE_OK;
+ return (AE_OK);
}
-
-
diff --git a/source/common/adwalk.c b/source/common/adwalk.c
index 5336b61ef979..584300516be3 100644
--- a/source/common/adwalk.c
+++ b/source/common/adwalk.c
@@ -654,8 +654,8 @@ AcpiDmLoadDescendingOp (
while (AcpiGbl_PreDefinedNames[PreDefineIndex].Name)
{
- if (!ACPI_STRNCMP (Node->Name.Ascii,
- AcpiGbl_PreDefinedNames[PreDefineIndex].Name, 4))
+ if (ACPI_COMPARE_NAME (Node->Name.Ascii,
+ AcpiGbl_PreDefinedNames[PreDefineIndex].Name))
{
PreDefined = TRUE;
break;
@@ -787,7 +787,7 @@ AcpiDmXrefDescendingOp (
}
/*
- * Lookup the name in the namespace. Name must exist at this point, or it
+ * Lookup the name in the namespace. Name must exist at this point, or it
* is an invalid reference.
*
* The namespace is also used as a lookup table for references to resource
@@ -1018,5 +1018,3 @@ AcpiDmInspectPossibleArgs (
return (Last);
}
-
-
diff --git a/source/common/dmextern.c b/source/common/dmextern.c
index 195290063a4e..22924dd41688 100644
--- a/source/common/dmextern.c
+++ b/source/common/dmextern.c
@@ -687,4 +687,3 @@ AcpiDmEmitExternals (
AcpiOsPrintf ("\n");
}
-
diff --git a/source/common/dmrestag.c b/source/common/dmrestag.c
index 9d18539a7f32..8426dff8448b 100644
--- a/source/common/dmrestag.c
+++ b/source/common/dmrestag.c
@@ -1050,4 +1050,3 @@ AcpiDmAddResourceToNamespace (
Node->Length = Length;
return (AE_OK);
}
-
diff --git a/source/common/dmtable.c b/source/common/dmtable.c
index cb97b541d97e..6c23783e69ed 100644
--- a/source/common/dmtable.c
+++ b/source/common/dmtable.c
@@ -415,6 +415,18 @@ AcpiDmDumpDataTable (
if (AcpiUtIsAmlTable (Table))
{
+ if (Gbl_VerboseTemplates)
+ {
+ /* Dump the raw table data */
+
+ Length = Table->Length;
+
+ AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
+ ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
+ AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
+ Length, DB_BYTE_DISPLAY, 0);
+ AcpiOsPrintf (" */\n");
+ }
return;
}
@@ -484,7 +496,8 @@ AcpiDmDumpDataTable (
AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
- AcpiUtDumpBuffer2 (ACPI_CAST_PTR (UINT8, Table), Length, DB_BYTE_DISPLAY);
+ AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
+ Length, DB_BYTE_DISPLAY, 0);
}
}
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
index 102f1fe0c241..85ae14cedf66 100644
--- a/source/common/dmtbdump.c
+++ b/source/common/dmtbdump.c
@@ -1611,8 +1611,8 @@ AcpiDmDumpMpst (
ACPI_MPST_DATA_HDR *SubTable1;
ACPI_MPST_POWER_DATA *SubTable2;
UINT16 SubtableCount;
- UINT8 PowerStateCount;
- UINT8 ComponentCount;
+ UINT32 PowerStateCount;
+ UINT32 ComponentCount;
/* Main table */
diff --git a/source/common/dmtbinfo.c b/source/common/dmtbinfo.c
index 1cd856a854c9..19d9df3c9ad6 100644
--- a/source/common/dmtbinfo.c
+++ b/source/common/dmtbinfo.c
@@ -1518,10 +1518,10 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[] =
{
- {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT8, ACPI_MPST_OFFSET (ChannelId), "Channel ID", 0},
- {ACPI_DMT_UINT8, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT24, ACPI_MPST_OFFSET (Reserved1[0]), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_MPST_OFFSET (PowerNodeCount), "Power Node Count", 0},
+ {ACPI_DMT_UINT16, ACPI_MPST_OFFSET (Reserved2), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
@@ -1538,12 +1538,11 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[] =
{ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (Reserved1), "Reserved", 0},
{ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (NodeId), "Node ID", 0},
- {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", DT_LENGTH},
+ {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (Length), "Length", 0},
{ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeAddress), "Range Address", 0},
{ACPI_DMT_UINT64, ACPI_MPST0_OFFSET (RangeLength), "Range Length", 0},
- {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0},
- {ACPI_DMT_UINT8, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0},
- {ACPI_DMT_UINT16, ACPI_MPST0_OFFSET (Reserved2), "Reserved", 0},
+ {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPowerStates), "Num Power States", 0},
+ {ACPI_DMT_UINT32, ACPI_MPST0_OFFSET (NumPhysicalComponents), "Num Physical Components", 0},
ACPI_DMT_TERMINATOR
};
@@ -1569,6 +1568,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] =
{
{ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (CharacteristicsCount), "Characteristics Count", 0},
+ {ACPI_DMT_UINT16, ACPI_MPST1_OFFSET (Reserved), "Reserved", 0},
ACPI_DMT_TERMINATOR
};
@@ -1576,7 +1576,7 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[] =
ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[] =
{
- {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Revision), "Revision", 0},
+ {ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (StructureId), "Structure ID", 0},
{ACPI_DMT_UINT8, ACPI_MPST2_OFFSET (Flags), "Flags (decoded below)", DT_FLAG},
{ACPI_DMT_FLAG0, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Memory Preserved", 0},
{ACPI_DMT_FLAG1, ACPI_MPST2_FLAG_OFFSET (Flags,0), "Auto Entry", 0},
diff --git a/source/common/getopt.c b/source/common/getopt.c
index 80d80811746b..6696e3a7a2f3 100644
--- a/source/common/getopt.c
+++ b/source/common/getopt.c
@@ -1,4 +1,3 @@
-
/******************************************************************************
*
* Module Name: getopt