aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib
diff options
context:
space:
mode:
authorMark Santcroos <marks@FreeBSD.org>2004-12-01 23:39:45 +0000
committerMark Santcroos <marks@FreeBSD.org>2004-12-01 23:39:45 +0000
commit40047a89b4d886b319451a82e01182de491ae958 (patch)
tree74ef91f8f7deee8add4f0e9f661f3d19c9e4366a /sys/contrib
parent8baa584183e686f6b9c4c56ff3d5f934e4f71eab (diff)
downloadsrc-40047a89b4d886b319451a82e01182de491ae958.tar.gz
src-40047a89b4d886b319451a82e01182de491ae958.zip
Local change: Put various debugging options under ACPI_DISASSEMBLER.
Approved by: njl MFC after: 1 week
Notes
Notes: svn path=/head/; revision=138293
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/dev/acpica/dbcmds.c84
1 files changed, 83 insertions, 1 deletions
diff --git a/sys/contrib/dev/acpica/dbcmds.c b/sys/contrib/dev/acpica/dbcmds.c
index 5c2345c05e02..f133ee6b42fb 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: