diff options
Diffstat (limited to 'source/components/debugger/dbmethod.c')
-rw-r--r-- | source/components/debugger/dbmethod.c | 203 |
1 files changed, 1 insertions, 202 deletions
diff --git a/source/components/debugger/dbmethod.c b/source/components/debugger/dbmethod.c index fe1c3d5..6e44eaf 100644 --- a/source/components/debugger/dbmethod.c +++ b/source/components/debugger/dbmethod.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -58,16 +58,6 @@ ACPI_MODULE_NAME ("dbmethod") -/* Local prototypes */ - -static ACPI_STATUS -AcpiDbWalkForExecute ( - ACPI_HANDLE ObjHandle, - UINT32 NestingLevel, - void *Context, - void **ReturnValue); - - /******************************************************************************* * * FUNCTION: AcpiDbSetMethodBreakpoint @@ -414,195 +404,4 @@ AcpiDbDisassembleMethod ( return (AE_OK); } - -/******************************************************************************* - * - * FUNCTION: AcpiDbWalkForExecute - * - * PARAMETERS: Callback from WalkNamespace - * - * RETURN: Status - * - * DESCRIPTION: Batch execution module. Currently only executes predefined - * ACPI names. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiDbWalkForExecute ( - ACPI_HANDLE ObjHandle, - UINT32 NestingLevel, - void *Context, - void **ReturnValue) -{ - ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_DB_EXECUTE_WALK *Info = (ACPI_DB_EXECUTE_WALK *) Context; - char *Pathname; - const ACPI_PREDEFINED_INFO *Predefined; - ACPI_DEVICE_INFO *ObjInfo; - ACPI_OBJECT_LIST ParamObjects; - ACPI_OBJECT Params[ACPI_METHOD_NUM_ARGS]; - ACPI_OBJECT *ThisParam; - ACPI_BUFFER ReturnObj; - ACPI_STATUS Status; - UINT16 ArgTypeList; - UINT8 ArgCount; - UINT8 ArgType; - UINT32 i; - - - /* The name must be a predefined ACPI name */ - - Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii); - if (!Predefined) - { - return (AE_OK); - } - - if (Node->Type == ACPI_TYPE_LOCAL_SCOPE) - { - return (AE_OK); - } - - Pathname = AcpiNsGetExternalPathname (Node); - if (!Pathname) - { - return (AE_OK); - } - - /* Get the object info for number of method parameters */ - - Status = AcpiGetObjectInfo (ObjHandle, &ObjInfo); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - ParamObjects.Count = 0; - ParamObjects.Pointer = NULL; - - if (ObjInfo->Type == ACPI_TYPE_METHOD) - { - /* Setup default parameters (with proper types) */ - - ArgTypeList = Predefined->Info.ArgumentList; - ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList); - - /* - * Setup the ACPI-required number of arguments, regardless of what - * the actual method defines. If there is a difference, then the - * method is wrong and a warning will be issued during execution. - */ - ThisParam = Params; - for (i = 0; i < ArgCount; i++) - { - ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); - ThisParam->Type = ArgType; - - switch (ArgType) - { - case ACPI_TYPE_INTEGER: - - ThisParam->Integer.Value = 1; - break; - - case ACPI_TYPE_STRING: - - ThisParam->String.Pointer = "This is the default argument string"; - ThisParam->String.Length = ACPI_STRLEN (ThisParam->String.Pointer); - break; - - case ACPI_TYPE_BUFFER: - - ThisParam->Buffer.Pointer = (UINT8 *) Params; /* just a garbage buffer */ - ThisParam->Buffer.Length = 48; - break; - - case ACPI_TYPE_PACKAGE: - - ThisParam->Package.Elements = NULL; - ThisParam->Package.Count = 0; - break; - - default: - - AcpiOsPrintf ("%s: Unsupported argument type: %u\n", - Pathname, ArgType); - break; - } - - ThisParam++; - } - - ParamObjects.Count = ArgCount; - ParamObjects.Pointer = Params; - } - - ACPI_FREE (ObjInfo); - ReturnObj.Pointer = NULL; - ReturnObj.Length = ACPI_ALLOCATE_BUFFER; - - /* Do the actual method execution */ - - AcpiGbl_MethodExecuting = TRUE; - - Status = AcpiEvaluateObject (Node, NULL, &ParamObjects, &ReturnObj); - - AcpiOsPrintf ("%-32s returned %s\n", Pathname, AcpiFormatException (Status)); - AcpiGbl_MethodExecuting = FALSE; - ACPI_FREE (Pathname); - - /* Ignore status from method execution */ - - Status = AE_OK; - - /* Update count, check if we have executed enough methods */ - - Info->Count++; - if (Info->Count >= Info->MaxCount) - { - Status = AE_CTRL_TERMINATE; - } - - 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 -AcpiDbBatchExecute ( - char *CountArg) -{ - ACPI_DB_EXECUTE_WALK Info; - - - Info.Count = 0; - Info.MaxCount = ACPI_UINT32_MAX; - - if (CountArg) - { - Info.MaxCount = ACPI_STRTOUL (CountArg, NULL, 0); - } - - - /* Search all nodes in namespace */ - - (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - AcpiDbWalkForExecute, NULL, (void *) &Info, NULL); - - AcpiOsPrintf ("Evaluated %u predefined names in the namespace\n", Info.Count); -} - #endif /* ACPI_DEBUGGER */ |