mirror of
https://github.com/acpica/acpica/
synced 2025-01-13 12:59:18 +03:00
Debugger: Enhance "Tables" and "Unload" commands.
Tables - emit additional information about the ACPI tables, including the owner ID and flags decode. Unload - reimplemented to use the new AcpiUnloadParentTable external interface.
This commit is contained in:
parent
a0284aaffa
commit
c012c44989
@ -326,12 +326,53 @@ AcpiDbDisplayTableInfo (
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Header */
|
||||
|
||||
AcpiOsPrintf ("Idx ID Status Type Sig Address Len Header\n");
|
||||
|
||||
/* Walk the entire root table list */
|
||||
|
||||
for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)
|
||||
{
|
||||
TableDesc = &AcpiGbl_RootTableList.Tables[i];
|
||||
AcpiOsPrintf ("%u ", i);
|
||||
|
||||
/* Index and Table ID */
|
||||
|
||||
AcpiOsPrintf ("%3u %.2u ", i, TableDesc->OwnerId);
|
||||
|
||||
/* Decode the table flags */
|
||||
|
||||
if (!(TableDesc->Flags & ACPI_TABLE_IS_LOADED))
|
||||
{
|
||||
AcpiOsPrintf ("NotLoaded ");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" Loaded ");
|
||||
}
|
||||
|
||||
switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK)
|
||||
{
|
||||
case ACPI_TABLE_ORIGIN_UNKNOWN:
|
||||
AcpiOsPrintf ("Unknown ");
|
||||
break;
|
||||
|
||||
case ACPI_TABLE_ORIGIN_MAPPED:
|
||||
AcpiOsPrintf ("Mapped ");
|
||||
break;
|
||||
|
||||
case ACPI_TABLE_ORIGIN_ALLOCATED:
|
||||
AcpiOsPrintf ("Allocated ");
|
||||
break;
|
||||
|
||||
case ACPI_TABLE_ORIGIN_OVERRIDE:
|
||||
AcpiOsPrintf ("Override ");
|
||||
break;
|
||||
|
||||
default:
|
||||
AcpiOsPrintf ("INVALID ");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make sure that the table is mapped */
|
||||
|
||||
@ -362,55 +403,45 @@ AcpiDbDisplayTableInfo (
|
||||
*
|
||||
* FUNCTION: AcpiDbUnloadAcpiTable
|
||||
*
|
||||
* PARAMETERS: TableArg - Name of the table to be unloaded
|
||||
* InstanceArg - Which instance of the table to unload (if
|
||||
* there are multiple tables of the same type)
|
||||
* PARAMETERS: ObjectName - Namespace pathname for an object that
|
||||
* is owned by the table to be unloaded
|
||||
*
|
||||
* RETURN: Nonde
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Unload an ACPI table.
|
||||
* Instance is not implemented
|
||||
* DESCRIPTION: Unload an ACPI table, via any namespace node that is owned
|
||||
* by the table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbUnloadAcpiTable (
|
||||
char *TableArg,
|
||||
char *InstanceArg)
|
||||
char *ObjectName)
|
||||
{
|
||||
/* TBD: Need to reimplement for new data structures */
|
||||
|
||||
#if 0
|
||||
UINT32 i;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/* Search all tables for the target type */
|
||||
/* Translate name to an Named object */
|
||||
|
||||
for (i = 0; i < (ACPI_TABLE_ID_MAX+1); i++)
|
||||
Node = AcpiDbConvertToNode (ObjectName);
|
||||
if (!Node)
|
||||
{
|
||||
if (!ACPI_STRNCMP (TableArg, AcpiGbl_TableData[i].Signature,
|
||||
AcpiGbl_TableData[i].SigLength))
|
||||
{
|
||||
/* Found the table, unload it */
|
||||
|
||||
Status = AcpiUnloadTable (i);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
AcpiOsPrintf ("[%s] unloaded and uninstalled\n", TableArg);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%s, while unloading [%s]\n",
|
||||
AcpiFormatException (Status), TableArg);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
AcpiOsPrintf ("Could not find [%s] in namespace\n",
|
||||
ObjectName);
|
||||
return;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("Unknown table type [%s]\n", TableArg);
|
||||
#endif
|
||||
Status = AcpiUnloadParentTable (ACPI_CAST_PTR (ACPI_HANDLE, Node));
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Parent of [%s] (%p) unloaded and uninstalled\n",
|
||||
ObjectName, Node);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("%s, while unloading parent table of [%s]\n",
|
||||
AcpiFormatException (Status), ObjectName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -322,7 +322,7 @@ AcpiDbDisplayHelp (
|
||||
AcpiOsPrintf (" Stack Display CPU stack usage\n");
|
||||
AcpiOsPrintf (" Tables Info about current ACPI table(s)\n");
|
||||
AcpiOsPrintf (" Tables Display info about loaded ACPI tables\n");
|
||||
AcpiOsPrintf (" Unload <TableSig> [Instance] Unload an ACPI table\n");
|
||||
AcpiOsPrintf (" Unload <Namepath> Unload an ACPI table via namespace object\n");
|
||||
AcpiOsPrintf (" ! <CommandNumber> Execute command from history buffer\n");
|
||||
AcpiOsPrintf (" !! Execute last command again\n");
|
||||
|
||||
@ -966,7 +966,7 @@ AcpiDbCommandDispatch (
|
||||
break;
|
||||
|
||||
case CMD_UNLOAD:
|
||||
AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
|
||||
AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1]);
|
||||
break;
|
||||
|
||||
case CMD_EXIT:
|
||||
|
@ -184,8 +184,7 @@ AcpiDbDisplayTemplate (
|
||||
|
||||
void
|
||||
AcpiDbUnloadAcpiTable (
|
||||
char *TableArg,
|
||||
char *InstanceArg);
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiDbSendNotify (
|
||||
|
Loading…
Reference in New Issue
Block a user