summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/debugger/dbmethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/debugger/dbmethod.c')
-rw-r--r--sys/contrib/dev/acpica/components/debugger/dbmethod.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/sys/contrib/dev/acpica/components/debugger/dbmethod.c b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
index 5224854..2d047f5 100644
--- a/sys/contrib/dev/acpica/components/debugger/dbmethod.c
+++ b/sys/contrib/dev/acpica/components/debugger/dbmethod.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,13 +46,10 @@
#include <contrib/dev/acpica/include/acdispat.h>
#include <contrib/dev/acpica/include/acnamesp.h>
#include <contrib/dev/acpica/include/acdebug.h>
-#include <contrib/dev/acpica/include/acdisasm.h>
#include <contrib/dev/acpica/include/acparser.h>
#include <contrib/dev/acpica/include/acpredef.h>
-#ifdef ACPI_DEBUGGER
-
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbmethod")
@@ -79,6 +76,7 @@ AcpiDbSetMethodBreakpoint (
ACPI_PARSE_OBJECT *Op)
{
UINT32 Address;
+ UINT32 AmlOffset;
if (!Op)
@@ -89,11 +87,13 @@ AcpiDbSetMethodBreakpoint (
/* Get and verify the breakpoint address */
- Address = ACPI_STRTOUL (Location, NULL, 16);
- if (Address <= Op->Common.AmlOffset)
+ Address = strtoul (Location, NULL, 16);
+ AmlOffset = (UINT32) ACPI_PTR_DIFF (Op->Common.Aml,
+ WalkState->ParserState.AmlStart);
+ if (Address <= AmlOffset)
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
- Address, Op->Common.AmlOffset);
+ Address, AmlOffset);
}
/* Save breakpoint in current walk */
@@ -174,7 +174,7 @@ AcpiDbSetMethodData (
return;
}
- Value = ACPI_STRTOUL (ValueArg, NULL, 16);
+ Value = strtoul (ValueArg, NULL, 16);
if (Type == 'N')
{
@@ -196,7 +196,7 @@ AcpiDbSetMethodData (
/* Get the index and value */
- Index = ACPI_STRTOUL (IndexArg, NULL, 16);
+ Index = strtoul (IndexArg, NULL, 16);
WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
if (!WalkState)
@@ -224,12 +224,13 @@ AcpiDbSetMethodData (
if (Index > ACPI_METHOD_MAX_ARG)
{
- AcpiOsPrintf ("Arg%u - Invalid argument name\n", Index);
+ AcpiOsPrintf ("Arg%u - Invalid argument name\n",
+ Index);
goto Cleanup;
}
- Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG, Index, ObjDesc,
- WalkState);
+ Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_ARG,
+ Index, ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -238,7 +239,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->Arguments[Index].Object;
AcpiOsPrintf ("Arg%u: ", Index);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
break;
case 'L':
@@ -247,12 +248,13 @@ AcpiDbSetMethodData (
if (Index > ACPI_METHOD_MAX_LOCAL)
{
- AcpiOsPrintf ("Local%u - Invalid local variable name\n", Index);
+ AcpiOsPrintf ("Local%u - Invalid local variable name\n",
+ Index);
goto Cleanup;
}
- Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL, Index, ObjDesc,
- WalkState);
+ Status = AcpiDsStoreObjectToLocal (ACPI_REFCLASS_LOCAL,
+ Index, ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@@ -261,7 +263,7 @@ AcpiDbSetMethodData (
ObjDesc = WalkState->LocalVariables[Index].Object;
AcpiOsPrintf ("Local%u: ", Index);
- AcpiDmDisplayInternalObject (ObjDesc, WalkState);
+ AcpiDbDisplayInternalObject (ObjDesc, WalkState);
break;
default:
@@ -304,7 +306,7 @@ AcpiDbDisassembleAml (
if (Statements)
{
- NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
+ NumStatements = strtoul (Statements, NULL, 0);
}
#ifdef ACPI_DISASSEMBLER
@@ -352,7 +354,7 @@ AcpiDbDisassembleMethod (
ObjDesc = Method->Object;
- Op = AcpiPsCreateScopeOp ();
+ Op = AcpiPsCreateScopeOp (ObjDesc->Method.AmlStart);
if (!Op)
{
return (AE_NO_MEMORY);
@@ -392,15 +394,16 @@ AcpiDbDisassembleMethod (
WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
Status = AcpiPsParseAml (WalkState);
+
+#ifdef ACPI_DISASSEMBLER
(void) AcpiDmParseDeferredOps (Op);
/* Now we can disassemble the method */
- AcpiGbl_DbOpt_Verbose = FALSE;
-#ifdef ACPI_DISASSEMBLER
+ AcpiGbl_DmOpt_Verbose = FALSE;
AcpiDmDisassemble (NULL, Op, 0);
+ AcpiGbl_DmOpt_Verbose = TRUE;
#endif
- AcpiGbl_DbOpt_Verbose = TRUE;
AcpiPsDeleteParseTree (Op);
@@ -411,5 +414,3 @@ AcpiDbDisassembleMethod (
AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
return (AE_OK);
}
-
-#endif /* ACPI_DEBUGGER */
OpenPOWER on IntegriCloud