mirror of
https://github.com/acpica/acpica/
synced 2025-01-17 14:59:56 +03:00
strupr not POSIX, always use local AcpiUtStrupr
date 2005.04.07.22.25.00; author rmoore1; state Exp;
This commit is contained in:
parent
d362e085b8
commit
6c25afb4a5
@ -1,7 +1,7 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dbinput - user front-end to the AML debugger
|
||||
* $Revision: 1.103 $
|
||||
* $Revision: 1.107 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -124,6 +124,29 @@
|
||||
#define _COMPONENT ACPI_CA_DEBUGGER
|
||||
ACPI_MODULE_NAME ("dbinput")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static char *
|
||||
AcpiDbGetNextToken (
|
||||
char *String,
|
||||
char **Next);
|
||||
|
||||
static UINT32
|
||||
AcpiDbGetLine (
|
||||
char *InputBuffer);
|
||||
|
||||
static UINT32
|
||||
AcpiDbMatchCommand (
|
||||
char *UserCommand);
|
||||
|
||||
static void
|
||||
AcpiDbSingleThread (
|
||||
void);
|
||||
|
||||
static void
|
||||
AcpiDbDisplayHelp (
|
||||
char *HelpType);
|
||||
|
||||
|
||||
/*
|
||||
* Top-level debugger commands.
|
||||
@ -189,7 +212,6 @@ enum AcpiExDebuggerCommands
|
||||
|
||||
#define CMD_FIRST_VALID 2
|
||||
|
||||
|
||||
static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
||||
{
|
||||
{"<NOT FOUND>", 0},
|
||||
@ -261,12 +283,11 @@ static const COMMAND_INFO AcpiGbl_DbCommands[] =
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
AcpiDbDisplayHelp (
|
||||
char *HelpType)
|
||||
{
|
||||
|
||||
|
||||
/* No parameter, just give the overview */
|
||||
|
||||
if (!HelpType)
|
||||
@ -387,7 +408,7 @@ AcpiDbDisplayHelp (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
static char *
|
||||
AcpiDbGetNextToken (
|
||||
char *String,
|
||||
char **Next)
|
||||
@ -446,14 +467,14 @@ AcpiDbGetNextToken (
|
||||
*
|
||||
* PARAMETERS: InputBuffer - Command line buffer
|
||||
*
|
||||
* RETURN: None
|
||||
* RETURN: Count of arguments to the command
|
||||
*
|
||||
* DESCRIPTION: Get the next command line from the user. Gets entire line
|
||||
* up to the next newline
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
static UINT32
|
||||
AcpiDbGetLine (
|
||||
char *InputBuffer)
|
||||
{
|
||||
@ -464,7 +485,7 @@ AcpiDbGetLine (
|
||||
|
||||
|
||||
ACPI_STRCPY (AcpiGbl_DbParsedBuf, InputBuffer);
|
||||
ACPI_STRUPR (AcpiGbl_DbParsedBuf);
|
||||
AcpiUtStrupr (AcpiGbl_DbParsedBuf);
|
||||
|
||||
This = AcpiGbl_DbParsedBuf;
|
||||
for (i = 0; i < ACPI_DEBUGGER_MAX_ARGS; i++)
|
||||
@ -482,7 +503,7 @@ AcpiDbGetLine (
|
||||
|
||||
if (AcpiGbl_DbArgs[0])
|
||||
{
|
||||
ACPI_STRUPR (AcpiGbl_DbArgs[0]);
|
||||
AcpiUtStrupr (AcpiGbl_DbArgs[0]);
|
||||
}
|
||||
|
||||
Count = i;
|
||||
@ -507,7 +528,7 @@ AcpiDbGetLine (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
static UINT32
|
||||
AcpiDbMatchCommand (
|
||||
char *UserCommand)
|
||||
{
|
||||
@ -544,7 +565,7 @@ AcpiDbMatchCommand (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Command dispatcher. Called from two places:
|
||||
* DESCRIPTION: Command dispatcher.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -577,7 +598,9 @@ AcpiDbCommandDispatch (
|
||||
if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs)
|
||||
{
|
||||
AcpiOsPrintf ("%d parameters entered, [%s] requires %d parameters\n",
|
||||
ParamCount, AcpiGbl_DbCommands[CommandIndex].Name, AcpiGbl_DbCommands[CommandIndex].MinArgs);
|
||||
ParamCount, AcpiGbl_DbCommands[CommandIndex].Name,
|
||||
AcpiGbl_DbCommands[CommandIndex].MinArgs);
|
||||
|
||||
return (AE_CTRL_TRUE);
|
||||
}
|
||||
|
||||
@ -643,7 +666,8 @@ AcpiDbCommandDispatch (
|
||||
break;
|
||||
|
||||
case CMD_EXECUTE:
|
||||
AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP);
|
||||
AcpiDbExecute (AcpiGbl_DbArgs[1],
|
||||
&AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP);
|
||||
break;
|
||||
|
||||
case CMD_FIND:
|
||||
@ -710,20 +734,27 @@ AcpiDbCommandDispatch (
|
||||
case CMD_LEVEL:
|
||||
if (ParamCount == 0)
|
||||
{
|
||||
AcpiOsPrintf ("Current debug level for file output is: %8.8lX\n", AcpiGbl_DbDebugLevel);
|
||||
AcpiOsPrintf ("Current debug level for console output is: %8.8lX\n", AcpiGbl_DbConsoleDebugLevel);
|
||||
AcpiOsPrintf ("Current debug level for file output is: %8.8lX\n",
|
||||
AcpiGbl_DbDebugLevel);
|
||||
AcpiOsPrintf ("Current debug level for console output is: %8.8lX\n",
|
||||
AcpiGbl_DbConsoleDebugLevel);
|
||||
}
|
||||
else if (ParamCount == 2)
|
||||
{
|
||||
Temp = AcpiGbl_DbConsoleDebugLevel;
|
||||
AcpiGbl_DbConsoleDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], NULL, 16);
|
||||
AcpiOsPrintf ("Debug Level for console output was %8.8lX, now %8.8lX\n", Temp, AcpiGbl_DbConsoleDebugLevel);
|
||||
AcpiGbl_DbConsoleDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1],
|
||||
NULL, 16);
|
||||
AcpiOsPrintf (
|
||||
"Debug Level for console output was %8.8lX, now %8.8lX\n",
|
||||
Temp, AcpiGbl_DbConsoleDebugLevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
Temp = AcpiGbl_DbDebugLevel;
|
||||
AcpiGbl_DbDebugLevel = ACPI_STRTOUL (AcpiGbl_DbArgs[1], NULL, 16);
|
||||
AcpiOsPrintf ("Debug Level for file output was %8.8lX, now %8.8lX\n", Temp, AcpiGbl_DbDebugLevel);
|
||||
AcpiOsPrintf (
|
||||
"Debug Level for file output was %8.8lX, now %8.8lX\n",
|
||||
Temp, AcpiGbl_DbDebugLevel);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -757,7 +788,7 @@ AcpiDbCommandDispatch (
|
||||
break;
|
||||
|
||||
case CMD_OBJECT:
|
||||
ACPI_STRUPR (AcpiGbl_DbArgs[1]);
|
||||
AcpiUtStrupr (AcpiGbl_DbArgs[1]);
|
||||
Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
|
||||
break;
|
||||
|
||||
@ -786,7 +817,8 @@ AcpiDbCommandDispatch (
|
||||
break;
|
||||
|
||||
case CMD_SET:
|
||||
AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]);
|
||||
AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
|
||||
AcpiGbl_DbArgs[3]);
|
||||
break;
|
||||
|
||||
case CMD_SLEEP:
|
||||
@ -808,13 +840,17 @@ AcpiDbCommandDispatch (
|
||||
AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
|
||||
AcpiUtSubsystemShutdown ();
|
||||
|
||||
/* TBD: [Restructure] Need some way to re-initialize without re-creating the semaphores! */
|
||||
/*
|
||||
* TBD: [Restructure] Need some way to re-initialize without
|
||||
* re-creating the semaphores!
|
||||
*/
|
||||
|
||||
/* AcpiInitialize (NULL); */
|
||||
break;
|
||||
|
||||
case CMD_THREADS:
|
||||
AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]);
|
||||
AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2],
|
||||
AcpiGbl_DbArgs[3]);
|
||||
break;
|
||||
|
||||
case CMD_TREE:
|
||||
@ -842,13 +878,8 @@ AcpiDbCommandDispatch (
|
||||
AcpiDbgLevel = ACPI_DEBUG_DEFAULT;
|
||||
}
|
||||
|
||||
/* Shutdown */
|
||||
|
||||
/* AcpiUtSubsystemShutdown (); */
|
||||
AcpiDbCloseDebugFile ();
|
||||
|
||||
AcpiGbl_DbTerminateThreads = TRUE;
|
||||
|
||||
return (AE_CTRL_TERMINATE);
|
||||
|
||||
case CMD_NOT_FOUND:
|
||||
@ -925,7 +956,7 @@ AcpiDbExecuteThread (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
AcpiDbSingleThread (
|
||||
void)
|
||||
{
|
||||
@ -1011,13 +1042,12 @@ AcpiDbUserCommands (
|
||||
}
|
||||
|
||||
/*
|
||||
* Only this thread (the original thread) should actually terminate the subsystem,
|
||||
* because all the semaphores are deleted during termination
|
||||
* Only this thread (the original thread) should actually terminate the
|
||||
* subsystem, because all the semaphores are deleted during termination
|
||||
*/
|
||||
Status = AcpiTerminate ();
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dbstats - Generation and display of ACPI table statistics
|
||||
* $Revision: 1.56 $
|
||||
* $Revision: 1.75 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@ -115,21 +115,37 @@
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#include <acpi.h>
|
||||
#include <acdebug.h>
|
||||
#include <amlcode.h>
|
||||
#include <acparser.h>
|
||||
#include <acnamesp.h>
|
||||
#include "acpi.h"
|
||||
#include "acdebug.h"
|
||||
#include "acnamesp.h"
|
||||
|
||||
#ifdef ENABLE_DEBUGGER
|
||||
#ifdef ACPI_DEBUGGER
|
||||
|
||||
#define _COMPONENT ACPI_DEBUGGER
|
||||
#define _COMPONENT ACPI_CA_DEBUGGER
|
||||
ACPI_MODULE_NAME ("dbstats")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiDbCountNamespaceObjects (
|
||||
void);
|
||||
|
||||
static void
|
||||
AcpiDbEnumerateObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDbClassifyOneObject (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 NestingLevel,
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
|
||||
/*
|
||||
* Statistics subcommands
|
||||
*/
|
||||
ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
static ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
{
|
||||
{"ALLOCATIONS"},
|
||||
{"OBJECTS"},
|
||||
@ -141,13 +157,13 @@ ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
{NULL} /* Must be null terminated */
|
||||
};
|
||||
|
||||
#define CMD_ALLOCATIONS 0
|
||||
#define CMD_OBJECTS 1
|
||||
#define CMD_MEMORY 2
|
||||
#define CMD_MISC 3
|
||||
#define CMD_TABLES 4
|
||||
#define CMD_SIZES 5
|
||||
#define CMD_STACK 6
|
||||
#define CMD_STAT_ALLOCATIONS 0
|
||||
#define CMD_STAT_OBJECTS 1
|
||||
#define CMD_STAT_MEMORY 2
|
||||
#define CMD_STAT_MISC 3
|
||||
#define CMD_STAT_TABLES 4
|
||||
#define CMD_STAT_SIZES 5
|
||||
#define CMD_STAT_STACK 6
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -164,7 +180,7 @@ ARGUMENT_INFO AcpiDbStatTypes [] =
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
static void
|
||||
AcpiDbEnumerateObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
@ -176,25 +192,25 @@ AcpiDbEnumerateObject (
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Enumerate this object first */
|
||||
|
||||
AcpiGbl_NumObjects++;
|
||||
|
||||
if (ObjDesc->Common.Type > INTERNAL_TYPE_NODE_MAX)
|
||||
if (ACPI_GET_OBJECT_TYPE (ObjDesc) > ACPI_TYPE_NS_NODE_MAX)
|
||||
{
|
||||
AcpiGbl_ObjTypeCountMisc++;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiGbl_ObjTypeCount [ObjDesc->Common.Type]++;
|
||||
AcpiGbl_ObjTypeCount [ACPI_GET_OBJECT_TYPE (ObjDesc)]++;
|
||||
}
|
||||
|
||||
/* Count the sub-objects */
|
||||
|
||||
switch (ObjDesc->Common.Type)
|
||||
switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
|
||||
{
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
for (i = 0; i < ObjDesc->Package.Count; i++)
|
||||
{
|
||||
AcpiDbEnumerateObject (ObjDesc->Package.Elements[i]);
|
||||
@ -202,12 +218,14 @@ AcpiDbEnumerateObject (
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.SysHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.DrvHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.AddrHandler);
|
||||
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.SystemNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.DeviceNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->Device.Handler);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
if (AcpiNsGetSecondaryObject (ObjDesc))
|
||||
{
|
||||
AcpiGbl_ObjTypeCount [ACPI_TYPE_BUFFER_FIELD]++;
|
||||
@ -215,32 +233,37 @@ AcpiDbEnumerateObject (
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_REGION:
|
||||
AcpiGbl_ObjTypeCount [INTERNAL_TYPE_REGION_FIELD ]++;
|
||||
AcpiDbEnumerateObject (ObjDesc->Region.AddrHandler);
|
||||
|
||||
AcpiGbl_ObjTypeCount [ACPI_TYPE_LOCAL_REGION_FIELD ]++;
|
||||
AcpiDbEnumerateObject (ObjDesc->Region.Handler);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_POWER:
|
||||
AcpiDbEnumerateObject (ObjDesc->PowerResource.SysHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->PowerResource.DrvHandler);
|
||||
|
||||
AcpiDbEnumerateObject (ObjDesc->PowerResource.SystemNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->PowerResource.DeviceNotify);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.SysHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.DrvHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.AddrHandler);
|
||||
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.SystemNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.DeviceNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->Processor.Handler);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_THERMAL:
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.SysHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.DrvHandler);
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.AddrHandler);
|
||||
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.SystemNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.DeviceNotify);
|
||||
AcpiDbEnumerateObject (ObjDesc->ThermalZone.Handler);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef PARSER_ONLY
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbClassifyOneObject
|
||||
@ -254,7 +277,7 @@ AcpiDbEnumerateObject (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static ACPI_STATUS
|
||||
AcpiDbClassifyOneObject (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 NestingLevel,
|
||||
@ -274,11 +297,10 @@ AcpiDbClassifyOneObject (
|
||||
AcpiDbEnumerateObject (ObjDesc);
|
||||
|
||||
Type = Node->Type;
|
||||
if (Type > INTERNAL_TYPE_NODE_MAX)
|
||||
if (Type > ACPI_TYPE_NS_NODE_MAX)
|
||||
{
|
||||
AcpiGbl_NodeTypeCountMisc++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
AcpiGbl_NodeTypeCount [Type]++;
|
||||
@ -287,8 +309,10 @@ AcpiDbClassifyOneObject (
|
||||
return AE_OK;
|
||||
|
||||
|
||||
#if ACPI_FUTURE_IMPLEMENTATION
|
||||
|
||||
/* TBD: These need to be counted during the initial parsing phase */
|
||||
/*
|
||||
|
||||
if (AcpiPsIsNamedOp (Op->Opcode))
|
||||
{
|
||||
NumNodes++;
|
||||
@ -302,12 +326,12 @@ AcpiDbClassifyOneObject (
|
||||
NumGrammarElements++;
|
||||
Op = AcpiPsGetDepthNext (Root, Op);
|
||||
|
||||
SizeOfParseTree = (NumGrammarElements - NumMethodElements) * (UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfNodeEntries = NumNodes * (UINT32) sizeof (ACPI_NAMESPACE_NODE);
|
||||
SizeOfAcpiObjects = NumNodes * (UINT32) sizeof (ACPI_OPERAND_OBJECT);
|
||||
|
||||
*/
|
||||
SizeOfParseTree = (NumGrammarElements - NumMethodElements) *
|
||||
(UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfMethodTrees = NumMethodElements * (UINT32) sizeof (ACPI_PARSE_OBJECT);
|
||||
SizeOfNodeEntries = NumNodes * (UINT32) sizeof (ACPI_NAMESPACE_NODE);
|
||||
SizeOfAcpiObjects = NumNodes * (UINT32) sizeof (ACPI_OPERAND_OBJECT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -317,14 +341,14 @@ AcpiDbClassifyOneObject (
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Count and classify the entire namespace, including all
|
||||
* namespace nodes and attached objects.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
static void
|
||||
AcpiDbCountNamespaceObjects (
|
||||
void)
|
||||
{
|
||||
@ -335,20 +359,16 @@ AcpiDbCountNamespaceObjects (
|
||||
AcpiGbl_NumObjects = 0;
|
||||
|
||||
AcpiGbl_ObjTypeCountMisc = 0;
|
||||
for (i = 0; i < (INTERNAL_TYPE_NODE_MAX -1); i++)
|
||||
for (i = 0; i < (ACPI_TYPE_NS_NODE_MAX -1); i++)
|
||||
{
|
||||
AcpiGbl_ObjTypeCount [i] = 0;
|
||||
AcpiGbl_NodeTypeCount [i] = 0;
|
||||
}
|
||||
|
||||
AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
|
||||
FALSE, AcpiDbClassifyOneObject, NULL, NULL);
|
||||
|
||||
return (AE_OK);
|
||||
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, FALSE, AcpiDbClassifyOneObject, NULL, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -364,7 +384,7 @@ AcpiDbCountNamespaceObjects (
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisplayStatistics (
|
||||
NATIVE_CHAR *TypeArg)
|
||||
char *TypeArg)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 Type;
|
||||
@ -385,7 +405,7 @@ AcpiDbDisplayStatistics (
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_STRUPR (TypeArg);
|
||||
AcpiUtStrupr (TypeArg);
|
||||
Type = AcpiDbMatchArgument (TypeArg, AcpiDbStatTypes);
|
||||
if (Type == (UINT32) -1)
|
||||
{
|
||||
@ -396,34 +416,33 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
#ifndef PARSER_ONLY
|
||||
case CMD_ALLOCATIONS:
|
||||
case CMD_STAT_ALLOCATIONS:
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
AcpiUtDumpAllocationInfo ();
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
case CMD_TABLES:
|
||||
case CMD_STAT_TABLES:
|
||||
|
||||
AcpiOsPrintf ("ACPI Table Information:\n\n");
|
||||
if (AcpiGbl_DSDT)
|
||||
{
|
||||
AcpiOsPrintf ("DSDT Length:................% 7ld (%X)\n", AcpiGbl_DSDT->Length, AcpiGbl_DSDT->Length);
|
||||
AcpiOsPrintf ("DSDT Length:................% 7ld (%X)\n",
|
||||
AcpiGbl_DSDT->Length, AcpiGbl_DSDT->Length);
|
||||
}
|
||||
break;
|
||||
|
||||
case CMD_OBJECTS:
|
||||
|
||||
#ifndef PARSER_ONLY
|
||||
case CMD_STAT_OBJECTS:
|
||||
|
||||
AcpiDbCountNamespaceObjects ();
|
||||
|
||||
AcpiOsPrintf ("\nObjects defined in the current namespace:\n\n");
|
||||
|
||||
AcpiOsPrintf ("%16.16s % 10.10s % 10.10s\n", "ACPI_TYPE", "NODES", "OBJECTS");
|
||||
AcpiOsPrintf ("%16.16s %10.10s %10.10s\n",
|
||||
"ACPI_TYPE", "NODES", "OBJECTS");
|
||||
|
||||
for (i = 0; i < INTERNAL_TYPE_NODE_MAX; i++)
|
||||
for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++)
|
||||
{
|
||||
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", AcpiUtGetTypeName (i),
|
||||
AcpiGbl_NodeTypeCount [i], AcpiGbl_ObjTypeCount [i]);
|
||||
@ -433,11 +452,9 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
AcpiOsPrintf ("%16.16s % 10ld% 10ld\n", "TOTALS:",
|
||||
AcpiGbl_NumNodes, AcpiGbl_NumObjects);
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
case CMD_MEMORY:
|
||||
case CMD_STAT_MEMORY:
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
AcpiOsPrintf ("\n----Object and Cache Statistics---------------------------------------------\n");
|
||||
@ -448,17 +465,19 @@ AcpiDbDisplayStatistics (
|
||||
|
||||
if (AcpiGbl_MemoryLists[i].MaxCacheDepth > 0)
|
||||
{
|
||||
AcpiOsPrintf (" Cache: [Depth Max Avail Size] % 7d % 7d % 7d % 7d B\n",
|
||||
AcpiGbl_MemoryLists[i].CacheDepth,
|
||||
AcpiGbl_MemoryLists[i].MaxCacheDepth,
|
||||
AcpiGbl_MemoryLists[i].MaxCacheDepth - AcpiGbl_MemoryLists[i].CacheDepth,
|
||||
(AcpiGbl_MemoryLists[i].CacheDepth * AcpiGbl_MemoryLists[i].ObjectSize));
|
||||
AcpiOsPrintf (
|
||||
" Cache: [Depth Max Avail Size] % 7d % 7d % 7d % 7d B\n",
|
||||
AcpiGbl_MemoryLists[i].CacheDepth,
|
||||
AcpiGbl_MemoryLists[i].MaxCacheDepth,
|
||||
AcpiGbl_MemoryLists[i].MaxCacheDepth - AcpiGbl_MemoryLists[i].CacheDepth,
|
||||
(AcpiGbl_MemoryLists[i].CacheDepth * AcpiGbl_MemoryLists[i].ObjectSize));
|
||||
|
||||
AcpiOsPrintf (" Cache: [Requests Hits Misses ObjSize] % 7d % 7d % 7d % 7d B\n",
|
||||
AcpiGbl_MemoryLists[i].CacheRequests,
|
||||
AcpiGbl_MemoryLists[i].CacheHits,
|
||||
AcpiGbl_MemoryLists[i].CacheRequests - AcpiGbl_MemoryLists[i].CacheHits,
|
||||
AcpiGbl_MemoryLists[i].ObjectSize);
|
||||
AcpiOsPrintf (
|
||||
" Cache: [Requests Hits Misses ObjSize] % 7d % 7d % 7d % 7d B\n",
|
||||
AcpiGbl_MemoryLists[i].CacheRequests,
|
||||
AcpiGbl_MemoryLists[i].CacheHits,
|
||||
AcpiGbl_MemoryLists[i].CacheRequests - AcpiGbl_MemoryLists[i].CacheHits,
|
||||
AcpiGbl_MemoryLists[i].ObjectSize);
|
||||
}
|
||||
|
||||
Outstanding = AcpiGbl_MemoryLists[i].TotalAllocated -
|
||||
@ -474,32 +493,36 @@ AcpiDbDisplayStatistics (
|
||||
Size = ACPI_ROUND_UP_TO_1K (AcpiGbl_MemoryLists[i].CurrentTotalSize);
|
||||
}
|
||||
|
||||
AcpiOsPrintf (" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n",
|
||||
AcpiGbl_MemoryLists[i].TotalAllocated,
|
||||
AcpiGbl_MemoryLists[i].TotalFreed,
|
||||
Outstanding, Size);
|
||||
AcpiOsPrintf (
|
||||
" Mem: [Alloc Free Outstanding Size] % 7d % 7d % 7d % 7d Kb\n",
|
||||
AcpiGbl_MemoryLists[i].TotalAllocated,
|
||||
AcpiGbl_MemoryLists[i].TotalFreed,
|
||||
Outstanding, Size);
|
||||
}
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
case CMD_MISC:
|
||||
case CMD_STAT_MISC:
|
||||
|
||||
AcpiOsPrintf ("\nMiscellaneous Statistics:\n\n");
|
||||
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n", AcpiGbl_PsFindCount);
|
||||
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n", AcpiGbl_NsLookupCount);
|
||||
AcpiOsPrintf ("Calls to AcpiPsFind:.. ........% 7ld\n",
|
||||
AcpiGbl_PsFindCount);
|
||||
AcpiOsPrintf ("Calls to AcpiNsLookup:..........% 7ld\n",
|
||||
AcpiGbl_NsLookupCount);
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
|
||||
AcpiOsPrintf ("Mutex usage:\n\n");
|
||||
for (i = 0; i < NUM_MTX; i++)
|
||||
for (i = 0; i < NUM_MUTEX; i++)
|
||||
{
|
||||
AcpiOsPrintf ("%-28s: % 7ld\n", AcpiUtGetMutexName (i), AcpiGbl_AcpiMutexInfo[i].UseCount);
|
||||
AcpiOsPrintf ("%-28s: % 7ld\n",
|
||||
AcpiUtGetMutexName (i), AcpiGbl_MutexInfo[i].UseCount);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case CMD_SIZES:
|
||||
case CMD_STAT_SIZES:
|
||||
|
||||
AcpiOsPrintf ("\nInternal object sizes:\n\n");
|
||||
|
||||
@ -521,8 +544,8 @@ AcpiDbDisplayStatistics (
|
||||
AcpiOsPrintf ("BankField %3d\n", sizeof (ACPI_OBJECT_BANK_FIELD));
|
||||
AcpiOsPrintf ("IndexField %3d\n", sizeof (ACPI_OBJECT_INDEX_FIELD));
|
||||
AcpiOsPrintf ("Reference %3d\n", sizeof (ACPI_OBJECT_REFERENCE));
|
||||
AcpiOsPrintf ("NotifyHandler %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
||||
AcpiOsPrintf ("AddrHandler %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
||||
AcpiOsPrintf ("Notify %3d\n", sizeof (ACPI_OBJECT_NOTIFY_HANDLER));
|
||||
AcpiOsPrintf ("AddressSpace %3d\n", sizeof (ACPI_OBJECT_ADDR_HANDLER));
|
||||
AcpiOsPrintf ("Extra %3d\n", sizeof (ACPI_OBJECT_EXTRA));
|
||||
AcpiOsPrintf ("Data %3d\n", sizeof (ACPI_OBJECT_DATA));
|
||||
|
||||
@ -537,10 +560,10 @@ AcpiDbDisplayStatistics (
|
||||
break;
|
||||
|
||||
|
||||
case CMD_STACK:
|
||||
#if defined(ACPI_DEBUG)
|
||||
case CMD_STAT_STACK:
|
||||
#if defined(ACPI_DEBUG_OUTPUT)
|
||||
|
||||
Size = AcpiGbl_EntryStackPointer - AcpiGbl_LowestStackPointer;
|
||||
Size = (UINT32) (AcpiGbl_EntryStackPointer - AcpiGbl_LowestStackPointer);
|
||||
|
||||
AcpiOsPrintf ("\nSubsystem Stack Usage:\n\n");
|
||||
AcpiOsPrintf ("Entry Stack Pointer %X\n", AcpiGbl_EntryStackPointer);
|
||||
@ -549,11 +572,13 @@ AcpiDbDisplayStatistics (
|
||||
AcpiOsPrintf ("Deepest Procedure Nesting %d\n", AcpiGbl_DeepestNesting);
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
#endif /* ENABLE_DEBUGGER */
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: dbutils - AML debugger utilities
|
||||
* $Revision: 1.61 $
|
||||
* $Revision: 1.73 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@ -121,6 +121,7 @@
|
||||
#include "acnamesp.h"
|
||||
#include "acdebug.h"
|
||||
#include "acdispat.h"
|
||||
#include "acdisasm.h"
|
||||
|
||||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
@ -128,6 +129,18 @@
|
||||
#define _COMPONENT ACPI_CA_DEBUGGER
|
||||
ACPI_MODULE_NAME ("dbutils")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
#ifdef ACPI_OBSOLETE_FUNCTIONS
|
||||
ACPI_STATUS
|
||||
AcpiDbSecondPassParse (
|
||||
ACPI_PARSE_OBJECT *Root);
|
||||
|
||||
void
|
||||
AcpiDbDumpBuffer (
|
||||
UINT32 Address);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@ -177,7 +190,7 @@ AcpiDbMatchArgument (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Set the current destination for debugger output. Alos sets
|
||||
* DESCRIPTION: Set the current destination for debugger output. Also sets
|
||||
* the debug output level accordingly.
|
||||
*
|
||||
******************************************************************************/
|
||||
@ -200,30 +213,6 @@ AcpiDbSetOutputDestination (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDumpBuffer
|
||||
*
|
||||
* PARAMETERS: Address - Pointer to the buffer
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Print a portion of a buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDbDumpBuffer (
|
||||
UINT32 Address)
|
||||
{
|
||||
|
||||
AcpiOsPrintf ("\nLocation %X:\n", Address);
|
||||
|
||||
AcpiDbgLevel |= ACPI_LV_TABLES;
|
||||
AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY, ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbDumpObject
|
||||
@ -260,15 +249,15 @@ AcpiDbDumpObject (
|
||||
{
|
||||
case ACPI_TYPE_ANY:
|
||||
|
||||
AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
|
||||
AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
|
||||
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
|
||||
ACPI_HIDWORD (ObjDesc->Integer.Value),
|
||||
ACPI_LODWORD (ObjDesc->Integer.Value));
|
||||
ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
|
||||
break;
|
||||
|
||||
|
||||
@ -288,7 +277,8 @@ AcpiDbDumpObject (
|
||||
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
|
||||
if (ObjDesc->Buffer.Length)
|
||||
{
|
||||
AcpiUtDumpBuffer ((UINT8 *) ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
|
||||
AcpiUtDumpBuffer ((UINT8 *) ObjDesc->Buffer.Pointer,
|
||||
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -299,7 +289,8 @@ AcpiDbDumpObject (
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("[Package] Contains %d Elements: \n", ObjDesc->Package.Count);
|
||||
AcpiOsPrintf ("[Package] Contains %d Elements: \n",
|
||||
ObjDesc->Package.Count);
|
||||
|
||||
for (i = 0; i < ObjDesc->Package.Count; i++)
|
||||
{
|
||||
@ -310,7 +301,8 @@ AcpiDbDumpObject (
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
AcpiOsPrintf ("[Object Reference] = %p\n", ObjDesc->Reference.Handle);
|
||||
AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
|
||||
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
|
||||
break;
|
||||
|
||||
|
||||
@ -351,13 +343,12 @@ AcpiDbPrepNamestring (
|
||||
char *Name)
|
||||
{
|
||||
|
||||
|
||||
if (!Name)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ACPI_STRUPR (Name);
|
||||
AcpiUtStrupr (Name);
|
||||
|
||||
/* Convert a leading forward slash to a backslash */
|
||||
|
||||
@ -388,6 +379,59 @@ AcpiDbPrepNamestring (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbLocalNsLookup
|
||||
*
|
||||
* PARAMETERS: Name - Name to lookup
|
||||
*
|
||||
* RETURN: Pointer to a namespace node, null on failure
|
||||
*
|
||||
* DESCRIPTION: Lookup a name in the ACPI namespace
|
||||
*
|
||||
* Note: Currently begins search from the root. Could be enhanced to use
|
||||
* the current prefix (scope) node as the search beginning point.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiDbLocalNsLookup (
|
||||
char *Name)
|
||||
{
|
||||
char *InternalPath;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node = NULL;
|
||||
|
||||
|
||||
AcpiDbPrepNamestring (Name);
|
||||
|
||||
/* Build an internal namestring */
|
||||
|
||||
Status = AcpiNsInternalizeName (Name, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid namestring: %s\n", Name);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Lookup the name.
|
||||
* (Uses root node as the search starting point)
|
||||
*/
|
||||
Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not locate name: %s %s\n",
|
||||
Name, AcpiFormatException (Status));
|
||||
}
|
||||
|
||||
ACPI_MEM_FREE (InternalPath);
|
||||
return (Node);
|
||||
}
|
||||
|
||||
|
||||
#ifdef ACPI_OBSOLETE_FUNCTIONS
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbSecondPassParse
|
||||
@ -427,8 +471,7 @@ AcpiDbSecondPassParse (
|
||||
|
||||
/* Create a new walk state for the parse */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT,
|
||||
NULL, NULL, NULL);
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
@ -439,7 +482,8 @@ AcpiDbSecondPassParse (
|
||||
WalkState->ParserState.Aml =
|
||||
WalkState->ParserState.AmlStart = Method->Named.Data;
|
||||
WalkState->ParserState.AmlEnd =
|
||||
WalkState->ParserState.PkgEnd = Method->Named.Data + Method->Named.Length;
|
||||
WalkState->ParserState.PkgEnd = Method->Named.Data +
|
||||
Method->Named.Length;
|
||||
WalkState->ParserState.StartScope = Op;
|
||||
|
||||
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
|
||||
@ -484,54 +528,28 @@ AcpiDbSecondPassParse (
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDbLocalNsLookup
|
||||
* FUNCTION: AcpiDbDumpBuffer
|
||||
*
|
||||
* PARAMETERS: Name - Name to lookup
|
||||
* PARAMETERS: Address - Pointer to the buffer
|
||||
*
|
||||
* RETURN: Pointer to a namespace node
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Lookup a name in the ACPI namespace
|
||||
*
|
||||
* Note: Currently begins search from the root. Could be enhanced to use
|
||||
* the current prefix (scope) node as the search beginning point.
|
||||
* DESCRIPTION: Print a portion of a buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiDbLocalNsLookup (
|
||||
char *Name)
|
||||
void
|
||||
AcpiDbDumpBuffer (
|
||||
UINT32 Address)
|
||||
{
|
||||
char *InternalPath;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node = NULL;
|
||||
|
||||
AcpiOsPrintf ("\nLocation %X:\n", Address);
|
||||
|
||||
AcpiDbPrepNamestring (Name);
|
||||
|
||||
/* Build an internal namestring */
|
||||
|
||||
Status = AcpiNsInternalizeName (Name, &InternalPath);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Invalid namestring: %s\n", Name);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Lookup the name.
|
||||
* (Uses root node as the search starting point)
|
||||
*/
|
||||
Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf ("Could not locate name: %s %s\n", Name, AcpiFormatException (Status));
|
||||
}
|
||||
|
||||
ACPI_MEM_FREE (InternalPath);
|
||||
return (Node);
|
||||
AcpiDbgLevel |= ACPI_LV_TABLES;
|
||||
AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
|
||||
ACPI_UINT32_MAX);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user