1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2012, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
48 #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
50 typedef struct acpi_db_command_info
52 char *Name; /* Command Name */
53 UINT8 MinArgs; /* Minimum arguments required */
55 } ACPI_DB_COMMAND_INFO;
57 typedef struct acpi_db_command_help
59 UINT8 LineCount; /* Number of help lines */
60 char *Invocation; /* Command Invocation */
61 char *Description; /* Command Description */
63 } ACPI_DB_COMMAND_HELP;
65 typedef struct acpi_db_argument_info
67 char *Name; /* Argument Name */
69 } ACPI_DB_ARGUMENT_INFO;
71 typedef struct acpi_db_execute_walk
76 } ACPI_DB_EXECUTE_WALK;
79 #define PARAM_LIST(pl) pl
80 #define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose)
81 #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
82 AcpiOsPrintf PARAM_LIST(fp);}
84 #define EX_NO_SINGLE_STEP 1
85 #define EX_SINGLE_STEP 2
89 * dbxface - external debugger interfaces
101 ACPI_WALK_STATE *WalkState,
102 ACPI_PARSE_OBJECT *Op,
107 * dbcmds - debug commands and output routines
109 ACPI_NAMESPACE_NODE *
110 AcpiDbConvertToNode (
114 AcpiDbDisplayTableInfo (
118 AcpiDbDisplayTemplate (
122 AcpiDbUnloadAcpiTable (
131 AcpiDbDisplayInterfaces (
133 char *InterfaceNameArg);
144 AcpiDbDisplayResources (
147 ACPI_HW_DEPENDENT_RETURN_VOID (
153 AcpiDbDisplayHandlers (
156 ACPI_HW_DEPENDENT_RETURN_VOID (
164 * dbmethod - control method commands
167 AcpiDbSetMethodBreakpoint (
169 ACPI_WALK_STATE *WalkState,
170 ACPI_PARSE_OBJECT *Op);
173 AcpiDbSetMethodCallBreakpoint (
174 ACPI_PARSE_OBJECT *Op);
177 AcpiDbSetMethodData (
183 AcpiDbDisassembleMethod (
187 AcpiDbDisassembleAml (
189 ACPI_PARSE_OBJECT *Op);
197 * dbnames - namespace commands
204 AcpiDbDumpNamespace (
209 AcpiDbDumpNamespaceByOwner (
214 AcpiDbFindNameInNamespace (
218 AcpiDbCheckPredefinedNames (
222 AcpiDbDisplayObjects (
224 char *DisplayCountArg);
227 AcpiDbCheckIntegrity (
231 AcpiDbFindReferences (
240 * dbdisply - debug display commands
243 AcpiDbDisplayMethodInfo (
244 ACPI_PARSE_OBJECT *Op);
247 AcpiDbDecodeAndDisplayObject (
252 AcpiDbDisplayResultObject (
253 ACPI_OPERAND_OBJECT *ObjDesc,
254 ACPI_WALK_STATE *WalkState);
257 AcpiDbDisplayAllMethods (
258 char *DisplayCountArg);
261 AcpiDbDisplayArguments (
265 AcpiDbDisplayLocals (
269 AcpiDbDisplayResults (
273 AcpiDbDisplayCallingTree (
277 AcpiDbDisplayObjectType (
281 AcpiDbDisplayArgumentObject (
282 ACPI_OPERAND_OBJECT *ObjDesc,
283 ACPI_WALK_STATE *WalkState);
287 * dbexec - debugger control method execution
293 ACPI_OBJECT_TYPE *Types,
297 AcpiDbCreateExecutionThreads (
300 char *MethodNameArg);
302 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
305 ACPI_MEMORY_LIST *Cache);
310 * dbfileio - Debugger file I/O commands
313 AcpiDbMatchArgument (
315 ACPI_DB_ARGUMENT_INFO *Arguments);
318 AcpiDbCloseDebugFile (
322 AcpiDbOpenDebugFile (
326 AcpiDbLoadAcpiTable (
330 AcpiDbGetTableFromFile (
332 ACPI_TABLE_HEADER **Table);
335 AcpiDbReadTableFromFile (
337 ACPI_TABLE_HEADER **Table);
341 * dbhistry - debugger HISTORY command
348 AcpiDbDisplayHistory (
352 AcpiDbGetFromHistory (
353 char *CommandNumArg);
357 * dbinput - user front-end to the AML debugger
360 AcpiDbCommandDispatch (
362 ACPI_WALK_STATE *WalkState,
363 ACPI_PARSE_OBJECT *Op);
365 void ACPI_SYSTEM_XFACE
366 AcpiDbExecuteThread (
372 ACPI_PARSE_OBJECT *Op);
378 ACPI_OBJECT_TYPE *ReturnType);
382 * dbstats - Generation and display of ACPI table statistics
385 AcpiDbGenerateStatistics (
386 ACPI_PARSE_OBJECT *Root,
390 AcpiDbDisplayStatistics (
395 * dbutils - AML debugger utilities
398 AcpiDbSetOutputDestination (
402 AcpiDbDumpExternalObject (
403 ACPI_OBJECT *ObjDesc,
407 AcpiDbPrepNamestring (
410 ACPI_NAMESPACE_NODE *
411 AcpiDbLocalNsLookup (
415 AcpiDbUint32ToHexString (
419 #endif /* __ACDEBUG_H__ */