summaryrefslogtreecommitdiffstats
path: root/source/components/debugger/dbmethod.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
committerjkim <jkim@FreeBSD.org>2012-11-14 22:20:16 +0000
commit526bfcf905004d9b67338a445cb661a63c3de018 (patch)
tree2ffc551e57f0545a17c165d729c1438a26236f60 /source/components/debugger/dbmethod.c
parentd8cd02b5b5893df382c08566087e32fe5b0c3abb (diff)
downloadFreeBSD-src-526bfcf905004d9b67338a445cb661a63c3de018.zip
FreeBSD-src-526bfcf905004d9b67338a445cb661a63c3de018.tar.gz
Import ACPICA 20121114.
Diffstat (limited to 'source/components/debugger/dbmethod.c')
-rw-r--r--source/components/debugger/dbmethod.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c
index 5335611..c3266c5 100644
--- a/source/components/debugger/dbmethod.c
+++ b/source/components/debugger/dbmethod.c
@@ -345,6 +345,13 @@ AcpiDbDisassembleMethod (
return (AE_BAD_PARAMETER);
}
+ if (Method->Type != ACPI_TYPE_METHOD)
+ {
+ ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method",
+ Name, AcpiUtGetTypeName (Method->Type)));
+ return (AE_BAD_PARAMETER);
+ }
+
ObjDesc = Method->Object;
Op = AcpiPsCreateScopeOp ();
@@ -362,21 +369,47 @@ AcpiDbDisassembleMethod (
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
- ObjDesc->Method.AmlStart,
- ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+ ObjDesc->Method.AmlStart,
+ ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
+ WalkState->OwnerId = ObjDesc->Method.OwnerId;
+
+ /* Push start scope on scope stack and make it current */
+
+ Status = AcpiDsScopeStackPush (Method,
+ Method->Type, WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
}
- /* Parse the AML */
+ /* Parse the entire method AML including deferred operators */
WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
+
Status = AcpiPsParseAml (WalkState);
+ AcpiDmParseDeferredOps (Op);
+ /* Now we can disassemble the method */
+
+ AcpiGbl_DbOpt_verbose = TRUE;
+ AcpiGbl_DbOpt_verbose = FALSE;
AcpiDmDisassemble (NULL, Op, 0);
+ AcpiGbl_DbOpt_verbose = TRUE;
+
AcpiPsDeleteParseTree (Op);
+
+ /* Method cleanup */
+
+ AcpiNsDeleteNamespaceSubtree (Method);
+ AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId);
+ AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
return (AE_OK);
}
OpenPOWER on IntegriCloud