diff options
author | marks <marks@FreeBSD.org> | 2004-12-01 23:39:45 +0000 |
---|---|---|
committer | marks <marks@FreeBSD.org> | 2004-12-01 23:39:45 +0000 |
commit | 64092a1d818b16769b4d52d44e61c5e07e3941c2 (patch) | |
tree | 74ef91f8f7deee8add4f0e9f661f3d19c9e4366a /sys/contrib/dev/acpica/dbcmds.c | |
parent | 6a7971435d4a4cf5b94e36f74f8dd1afd193d7f4 (diff) | |
download | FreeBSD-src-64092a1d818b16769b4d52d44e61c5e07e3941c2.zip FreeBSD-src-64092a1d818b16769b4d52d44e61c5e07e3941c2.tar.gz |
Local change: Put various debugging options under ACPI_DISASSEMBLER.
Approved by: njl
MFC after: 1 week
Diffstat (limited to 'sys/contrib/dev/acpica/dbcmds.c')
-rw-r--r-- | sys/contrib/dev/acpica/dbcmds.c | 84 |
1 files changed, 83 insertions, 1 deletions
diff --git a/sys/contrib/dev/acpica/dbcmds.c b/sys/contrib/dev/acpica/dbcmds.c index 5c2345c..f133ee6 100644 --- a/sys/contrib/dev/acpica/dbcmds.c +++ b/sys/contrib/dev/acpica/dbcmds.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbcmds - debug commands and output routines - * $Revision: 113 $ + * $Revision: 115 $ * ******************************************************************************/ @@ -124,6 +124,9 @@ #include "acresrc.h" #include "acdisasm.h" + +#include "acparser.h" + #ifdef ACPI_DEBUGGER #define _COMPONENT ACPI_CA_DEBUGGER @@ -157,6 +160,18 @@ static ARGUMENT_INFO AcpiDbObjectTypes [] = }; +/******************************************************************************* + * + * FUNCTION: AcpiDbSleep + * + * PARAMETERS: ObjectArg - Desired sleep state (0-5) + * + * RETURN: Status + * + * DESCRIPTION: Simulate a sleep/wake sequence + * + ******************************************************************************/ + ACPI_STATUS AcpiDbSleep ( char *ObjectArg) @@ -507,6 +522,71 @@ AcpiDbDisassembleAml ( /******************************************************************************* * + * FUNCTION: AcpiDbDisassembleMethod + * + * PARAMETERS: Method - Name of control method + * + * RETURN: None + * + * DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number + * of statements specified. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDbDisassembleMethod ( + char *Name) +{ + ACPI_STATUS Status; + ACPI_PARSE_OBJECT *Op; + ACPI_WALK_STATE *WalkState; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_NAMESPACE_NODE *Method; + + + Method = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ACPI_STRTOUL (Name, NULL, 16)); + if (!Method) + { + return (AE_BAD_PARAMETER); + } + + ObjDesc = Method->Object; + + Op = AcpiPsCreateScopeOp (); + if (!Op) + { + return (AE_NO_MEMORY); + } + + /* Create and initialize a new walk state */ + + WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL); + if (!WalkState) + { + return (AE_NO_MEMORY); + } + + Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, + ObjDesc->Method.AmlStart, + ObjDesc->Method.AmlLength, NULL, 1); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Parse the AML */ + + WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE; + Status = AcpiPsParseAml (WalkState); + + AcpiDmDisassemble (NULL, Op, 0); + AcpiPsDeleteParseTree (Op); + return (AE_OK); +} + + +/******************************************************************************* + * * FUNCTION: AcpiDbDumpNamespace * * PARAMETERS: StartArg - Node to begin namespace dump @@ -838,6 +918,8 @@ AcpiDbWalkForSpecificObjects ( if (ObjDesc) { + AcpiOsPrintf (" %p/%p", ObjHandle, ObjDesc); + switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) { case ACPI_TYPE_METHOD: |