diff options
Diffstat (limited to 'sys/contrib/dev/acpica/dbinput.c')
-rw-r--r-- | sys/contrib/dev/acpica/dbinput.c | 139 |
1 files changed, 77 insertions, 62 deletions
diff --git a/sys/contrib/dev/acpica/dbinput.c b/sys/contrib/dev/acpica/dbinput.c index 576fb68..76b0f40 100644 --- a/sys/contrib/dev/acpica/dbinput.c +++ b/sys/contrib/dev/acpica/dbinput.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: dbinput - user front-end to the AML debugger - * $Revision: 64 $ + * $Revision: 68 $ * ******************************************************************************/ @@ -133,29 +133,44 @@ * Globals that are specific to the debugger */ -NATIVE_CHAR LineBuf[80]; -NATIVE_CHAR ParsedBuf[80]; -NATIVE_CHAR ScopeBuf[40]; -NATIVE_CHAR DebugFilename[40]; -NATIVE_CHAR *Args[DB_MAX_ARGS]; -NATIVE_CHAR *Buffer; -NATIVE_CHAR *Filename = NULL; -BOOLEAN OutputToFile = FALSE; +NATIVE_CHAR AcpiGbl_DbLineBuf[80]; +NATIVE_CHAR AcpiGbl_DbParsedBuf[80]; +NATIVE_CHAR AcpiGbl_DbScopeBuf[40]; +NATIVE_CHAR AcpiGbl_DbDebugFilename[40]; +NATIVE_CHAR *AcpiGbl_DbArgs[DB_MAX_ARGS]; +NATIVE_CHAR *AcpiGbl_DbBuffer; +NATIVE_CHAR *AcpiGbl_DbFilename = NULL; +BOOLEAN AcpiGbl_DbOutputToFile = FALSE; -UINT32 AcpiGbl_DbDebugLevel = 0x0FFFFFFF; -UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | ACPI_LV_TABLES; -UINT8 AcpiGbl_DbOutputFlags = DB_CONSOLE_OUTPUT; +UINT32 AcpiGbl_DbDebugLevel = ACPI_LV_VERBOSITY2; +UINT32 AcpiGbl_DbConsoleDebugLevel = NORMAL_DEFAULT | ACPI_LV_TABLES; +UINT8 AcpiGbl_DbOutputFlags = DB_CONSOLE_OUTPUT; -BOOLEAN opt_tables = FALSE; -BOOLEAN opt_disasm = FALSE; -BOOLEAN opt_stats = FALSE; -BOOLEAN opt_parse_jit = FALSE; -BOOLEAN opt_verbose = TRUE; -BOOLEAN opt_ini_methods = TRUE; +BOOLEAN AcpiGbl_DbOpt_tables = FALSE; +BOOLEAN AcpiGbl_DbOpt_disasm = FALSE; +BOOLEAN AcpiGbl_DbOpt_stats = FALSE; +BOOLEAN AcpiGbl_DbOpt_parse_jit = FALSE; +BOOLEAN AcpiGbl_DbOpt_verbose = TRUE; +BOOLEAN AcpiGbl_DbOpt_ini_methods = TRUE; + +/* + * Statistic globals + */ +UINT16 AcpiGbl_ObjTypeCount[INTERNAL_TYPE_NODE_MAX+1]; +UINT16 AcpiGbl_NodeTypeCount[INTERNAL_TYPE_NODE_MAX+1]; +UINT16 AcpiGbl_ObjTypeCountMisc; +UINT16 AcpiGbl_NodeTypeCountMisc; +UINT32 AcpiGbl_NumNodes; +UINT32 AcpiGbl_NumObjects; +UINT32 AcpiGbl_SizeOfParseTree; +UINT32 AcpiGbl_SizeOfMethodTrees; +UINT32 AcpiGbl_SizeOfNodeEntries; +UINT32 AcpiGbl_SizeOfAcpiObjects; + /* * Top-level debugger commands. * @@ -216,7 +231,7 @@ enum AcpiExDebuggerCommands #define CMD_FIRST_VALID 2 -COMMAND_INFO Commands[] = +const COMMAND_INFO AcpiGbl_DbCommands[] = { {"<NOT FOUND>", 0}, {"<NULL>", 0}, @@ -470,14 +485,14 @@ AcpiDbGetLine ( NATIVE_CHAR *This; - STRCPY (ParsedBuf, InputBuffer); - STRUPR (ParsedBuf); + STRCPY (AcpiGbl_DbParsedBuf, InputBuffer); + STRUPR (AcpiGbl_DbParsedBuf); - This = ParsedBuf; + This = AcpiGbl_DbParsedBuf; for (i = 0; i < DB_MAX_ARGS; i++) { - Args[i] = AcpiDbGetNextToken (This, &Next); - if (!Args[i]) + AcpiGbl_DbArgs[i] = AcpiDbGetNextToken (This, &Next); + if (!AcpiGbl_DbArgs[i]) { break; } @@ -488,9 +503,9 @@ AcpiDbGetLine ( /* Uppercase the actual command */ - if (Args[0]) + if (AcpiGbl_DbArgs[0]) { - STRUPR (Args[0]); + STRUPR (AcpiGbl_DbArgs[0]); } Count = i; @@ -527,9 +542,9 @@ AcpiDbMatchCommand ( return (CMD_NULL); } - for (i = CMD_FIRST_VALID; Commands[i].Name; i++) + for (i = CMD_FIRST_VALID; AcpiGbl_DbCommands[i].Name; i++) { - if (STRSTR (Commands[i].Name, UserCommand) == Commands[i].Name) + if (STRSTR (AcpiGbl_DbCommands[i].Name, UserCommand) == AcpiGbl_DbCommands[i].Name) { return (i); } @@ -576,15 +591,15 @@ AcpiDbCommandDispatch ( } ParamCount = AcpiDbGetLine (InputBuffer); - CommandIndex = AcpiDbMatchCommand (Args[0]); + CommandIndex = AcpiDbMatchCommand (AcpiGbl_DbArgs[0]); Temp = 0; /* Verify that we have the minimum number of params */ - if (ParamCount < Commands[CommandIndex].MinArgs) + if (ParamCount < AcpiGbl_DbCommands[CommandIndex].MinArgs) { AcpiOsPrintf ("%d parameters entered, [%s] requires %d parameters\n", - ParamCount, Commands[CommandIndex].Name, Commands[CommandIndex].MinArgs); + ParamCount, AcpiGbl_DbCommands[CommandIndex].Name, AcpiGbl_DbCommands[CommandIndex].MinArgs); return (AE_CTRL_TRUE); } @@ -600,6 +615,7 @@ AcpiDbCommandDispatch ( break; case CMD_ALLOCATIONS: + #ifdef ACPI_DBG_TRACK_ALLOCATIONS AcpiUtDumpCurrentAllocations ((UINT32) -1, NULL); #endif @@ -611,7 +627,7 @@ AcpiDbCommandDispatch ( break; case CMD_BREAKPOINT: - AcpiDbSetMethodBreakpoint (Args[1], WalkState, Op); + AcpiDbSetMethodBreakpoint (AcpiGbl_DbArgs[1], WalkState, Op); break; case CMD_CALL: @@ -624,11 +640,11 @@ AcpiDbCommandDispatch ( break; case CMD_DEBUG: - AcpiDbExecute (Args[1], &Args[2], EX_SINGLE_STEP); + AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_SINGLE_STEP); break; case CMD_DUMP: - AcpiDbDecodeAndDisplayObject (Args[1], Args[2]); + AcpiDbDecodeAndDisplayObject (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_ENABLEACPI: @@ -645,11 +661,11 @@ AcpiDbCommandDispatch ( break; case CMD_EXECUTE: - AcpiDbExecute (Args[1], &Args[2], EX_NO_SINGLE_STEP); + AcpiDbExecute (AcpiGbl_DbArgs[1], &AcpiGbl_DbArgs[2], EX_NO_SINGLE_STEP); break; case CMD_FIND: - AcpiDbFindNameInNamespace (Args[1]); + AcpiDbFindNameInNamespace (AcpiGbl_DbArgs[1]); break; case CMD_GO: @@ -658,7 +674,7 @@ AcpiDbCommandDispatch ( case CMD_HELP: case CMD_HELP2: - AcpiDbDisplayHelp (Args[1]); + AcpiDbDisplayHelp (AcpiGbl_DbArgs[1]); break; case CMD_HISTORY: @@ -666,7 +682,7 @@ AcpiDbCommandDispatch ( break; case CMD_HISTORY_EXE: - CommandLine = AcpiDbGetFromHistory (Args[1]); + CommandLine = AcpiDbGetFromHistory (AcpiGbl_DbArgs[1]); if (!CommandLine) { return (AE_CTRL_TRUE); @@ -718,23 +734,23 @@ AcpiDbCommandDispatch ( else if (ParamCount == 2) { Temp = AcpiGbl_DbConsoleDebugLevel; - AcpiGbl_DbConsoleDebugLevel = STRTOUL (Args[1], NULL, 16); + AcpiGbl_DbConsoleDebugLevel = 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 = STRTOUL (Args[1], NULL, 16); + AcpiGbl_DbDebugLevel = STRTOUL (AcpiGbl_DbArgs[1], NULL, 16); AcpiOsPrintf ("Debug Level for file output was %8.8lX, now %8.8lX\n", Temp, AcpiGbl_DbDebugLevel); } break; case CMD_LIST: - AcpiDbDisassembleAml (Args[1], Op); + AcpiDbDisassembleAml (AcpiGbl_DbArgs[1], Op); break; case CMD_LOAD: - Status = AcpiDbLoadAcpiTable (Args[1]); + Status = AcpiDbLoadAcpiTable (AcpiGbl_DbArgs[1]); if (ACPI_FAILURE (Status)) { return (Status); @@ -750,40 +766,40 @@ AcpiDbCommandDispatch ( break; case CMD_METHODS: - AcpiDbDisplayObjects ("METHOD", Args[1]); + AcpiDbDisplayObjects ("METHOD", AcpiGbl_DbArgs[1]); break; case CMD_NAMESPACE: - AcpiDbDumpNamespace (Args[1], Args[2]); + AcpiDbDumpNamespace (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_NOTIFY: - Temp = STRTOUL (Args[2], NULL, 0); - AcpiDbSendNotify (Args[1], Temp); + Temp = STRTOUL (AcpiGbl_DbArgs[2], NULL, 0); + AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp); break; case CMD_OBJECT: - AcpiDbDisplayObjects (STRUPR (Args[1]), Args[2]); + AcpiDbDisplayObjects (STRUPR (AcpiGbl_DbArgs[1]), AcpiGbl_DbArgs[2]); break; case CMD_OPEN: - AcpiDbOpenDebugFile (Args[1]); + AcpiDbOpenDebugFile (AcpiGbl_DbArgs[1]); break; case CMD_OWNER: - AcpiDbDumpNamespaceByOwner (Args[1], Args[2]); + AcpiDbDumpNamespaceByOwner (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_PREFIX: - AcpiDbSetScope (Args[1]); + AcpiDbSetScope (AcpiGbl_DbArgs[1]); break; case CMD_REFERENCES: - AcpiDbFindReferences (Args[1]); + AcpiDbFindReferences (AcpiGbl_DbArgs[1]); break; case CMD_RESOURCES: - AcpiDbDisplayResources (Args[1]); + AcpiDbDisplayResources (AcpiGbl_DbArgs[1]); break; case CMD_RESULTS: @@ -791,11 +807,11 @@ AcpiDbCommandDispatch ( break; case CMD_SET: - AcpiDbSetMethodData (Args[1], Args[2], Args[3]); + AcpiDbSetMethodData (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); break; case CMD_STATS: - AcpiDbDisplayStatistics (Args[1]); + AcpiDbDisplayStatistics (AcpiGbl_DbArgs[1]); break; case CMD_STOP: @@ -803,7 +819,7 @@ AcpiDbCommandDispatch ( break; case CMD_TABLES: - AcpiDbDisplayTableInfo (Args[1]); + AcpiDbDisplayTableInfo (AcpiGbl_DbArgs[1]); break; case CMD_TERMINATE: @@ -816,7 +832,7 @@ AcpiDbCommandDispatch ( break; case CMD_THREADS: - AcpiDbCreateExecutionThreads (Args[1], Args[2], Args[3]); + AcpiDbCreateExecutionThreads (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2], AcpiGbl_DbArgs[3]); break; case CMD_TREE: @@ -824,7 +840,7 @@ AcpiDbCommandDispatch ( break; case CMD_UNLOAD: - AcpiDbUnloadAcpiTable (Args[1], Args[2]); + AcpiDbUnloadAcpiTable (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]); break; case CMD_EXIT: @@ -835,7 +851,7 @@ AcpiDbCommandDispatch ( return (AE_CTRL_TERMINATE); } - if (!OutputToFile) + if (!AcpiGbl_DbOutputToFile) { AcpiDbgLevel = DEBUG_DEFAULT; } @@ -888,7 +904,7 @@ AcpiDbExecuteThread ( AcpiGbl_StepToNextCall = FALSE; AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY); - Status = AcpiDbCommandDispatch (LineBuf, NULL, NULL); + Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); } } @@ -917,7 +933,7 @@ AcpiDbSingleThread ( AcpiGbl_MethodExecuting = FALSE; AcpiGbl_StepToNextCall = FALSE; - Status = AcpiDbCommandDispatch (LineBuf, NULL, NULL); + Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); } @@ -964,7 +980,7 @@ AcpiDbUserCommands ( /* Get the user input line */ - AcpiOsGetLine (LineBuf); + AcpiOsGetLine (AcpiGbl_DbLineBuf); /* Check for single or multithreaded debug */ @@ -975,7 +991,6 @@ AcpiDbUserCommands ( * Signal the debug thread that we have a command to execute, * and wait for the command to complete. */ - AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_READY); AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_COMPLETE); } |