dbmethod.c revision 26f3cdf03f1adcc98f6d3d99843ee71e9229a8c0
/*******************************************************************************
*
* Module Name: dbmethod - Debug commands for control methods
*
******************************************************************************/
/*
* Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
#include "acnamesp.h"
#include "acdebug.h"
#include "acdisasm.h"
#include "acparser.h"
#ifdef ACPI_DEBUGGER
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbmethod")
/* Local prototypes */
static ACPI_STATUS
void *Context,
void **ReturnValue);
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodBreakpoint
*
* PARAMETERS: Location - AML offset of breakpoint
* WalkState - Current walk info
* Op - Current Op (from parse walk)
*
* RETURN: None
*
* DESCRIPTION: Set a breakpoint in a control method at the specified
* AML offset
*
******************************************************************************/
void
char *Location,
{
if (!Op)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
/* Get and verify the breakpoint address */
{
AcpiOsPrintf ("Breakpoint %X is beyond current address %X\n",
}
/* Save breakpoint in current walk */
}
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodCallBreakpoint
*
* PARAMETERS: Op - Current Op (from parse walk)
*
* RETURN: None
*
* DESCRIPTION: Set a breakpoint in a control method at the specified
* AML offset
*
******************************************************************************/
void
{
if (!Op)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbSetMethodData
*
* PARAMETERS: TypeArg - L for local, A for argument
* IndexArg - which one
* ValueArg - Value to set.
*
* RETURN: None
*
* DESCRIPTION: Set a local or argument for the running control method.
* NOTE: only object supported is Number.
*
******************************************************************************/
void
char *TypeArg,
char *IndexArg,
char *ValueArg)
{
char Type;
/* Validate TypeArg */
if ((Type != 'L') &&
(Type != 'A') &&
(Type != 'N'))
{
return;
}
if (Type == 'N')
{
{
AcpiOsPrintf ("Can only set Integer nodes\n");
return;
}
return;
}
/* Get the index and value */
if (!WalkState)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
/* Create and initialize the new object */
if (!ObjDesc)
{
AcpiOsPrintf ("Could not create an internal object\n");
return;
}
/* Store the new object into the target */
switch (Type)
{
case 'A':
/* Set a method argument */
if (Index > ACPI_METHOD_MAX_ARG)
{
goto Cleanup;
}
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
break;
case 'L':
/* Set a method local */
if (Index > ACPI_METHOD_MAX_LOCAL)
{
goto Cleanup;
}
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
break;
default:
break;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDisassembleAml
*
* PARAMETERS: Statements - Number of statements to disassemble
* Op - Current Op (from parse walk)
*
* RETURN: None
*
* DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
* of statements specified.
*
******************************************************************************/
void
char *Statements,
{
if (!Op)
{
AcpiOsPrintf ("There is no method currently executing\n");
return;
}
if (Statements)
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDbDisassembleMethod
*
* PARAMETERS: Name - Name of control method
*
* RETURN: None
*
* DESCRIPTION: Display disassembled AML (ASL) starting from Op for the number
* of statements specified.
*
******************************************************************************/
char *Name)
{
if (!Method)
{
return (AE_BAD_PARAMETER);
}
Op = AcpiPsCreateScopeOp ();
if (!Op)
{
return (AE_NO_MEMORY);
}
/* Create and initialize a new walk state */
if (!WalkState)
{
return (AE_NO_MEMORY);
}
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Parse the AML */
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbWalkForExecute
*
* PARAMETERS: Callback from WalkNamespace
*
* RETURN: Status
*
* DESCRIPTION: Batch execution module. Currently only executes predefined
* ACPI names.
*
******************************************************************************/
static ACPI_STATUS
void *Context,
void **ReturnValue)
{
char *Pathname;
UINT32 i;
const ACPI_PREDEFINED_INFO *Predefined;
if (!Predefined)
{
return (AE_OK);
}
{
return (AE_OK);
}
if (!Pathname)
{
return (AE_OK);
}
/* Get the object info for number of method parameters */
if (ACPI_FAILURE (Status))
{
return (Status);
}
ParamObjects.Count = 0;
{
/* Setup default parameters */
for (i = 0; i < ObjInfo->ParamCount; i++)
{
}
}
/* Do the actual method execution */
/* Ignore status from method execution */
/* Update count, check if we have executed enough methods */
{
}
return (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiDbBatchExecute
*
* PARAMETERS: CountArg - Max number of methods to execute
*
* RETURN: None
*
* DESCRIPTION: Namespace batch execution. Execute predefined names in the
* namespace, up to the max count, if specified.
*
******************************************************************************/
void
char *CountArg)
{
if (CountArg)
{
}
/* Search all nodes in namespace */
}
#endif /* ACPI_DEBUGGER */