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 CommandInfo
52 char *Name; /* Command Name */
53 UINT8 MinArgs; /* Minimum arguments required */
57 typedef struct ArgumentInfo
59 char *Name; /* Argument Name */
63 typedef struct acpi_execute_walk
71 #define PARAM_LIST(pl) pl
72 #define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose)
73 #define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
74 AcpiOsPrintf PARAM_LIST(fp);}
76 #define EX_NO_SINGLE_STEP 1
77 #define EX_SINGLE_STEP 2
81 * dbxface - external debugger interfaces
93 ACPI_WALK_STATE *WalkState,
94 ACPI_PARSE_OBJECT *Op,
99 * dbcmds - debug commands and output routines
101 ACPI_NAMESPACE_NODE *
102 AcpiDbConvertToNode (
106 AcpiDbDisplayTableInfo (
110 AcpiDbDisplayTemplate (
114 AcpiDbUnloadAcpiTable (
123 AcpiDbDisplayInterfaces (
125 char *InterfaceNameArg);
136 AcpiDbDisplayResources (
139 ACPI_HW_DEPENDENT_RETURN_VOID (
145 AcpiDbDisplayHandlers (
148 ACPI_HW_DEPENDENT_RETURN_VOID (
156 * dbmethod - control method commands
159 AcpiDbSetMethodBreakpoint (
161 ACPI_WALK_STATE *WalkState,
162 ACPI_PARSE_OBJECT *Op);
165 AcpiDbSetMethodCallBreakpoint (
166 ACPI_PARSE_OBJECT *Op);
169 AcpiDbSetMethodData (
175 AcpiDbDisassembleMethod (
179 AcpiDbDisassembleAml (
181 ACPI_PARSE_OBJECT *Op);
189 * dbnames - namespace commands
196 AcpiDbDumpNamespace (
201 AcpiDbDumpNamespaceByOwner (
206 AcpiDbFindNameInNamespace (
210 AcpiDbCheckPredefinedNames (
214 AcpiDbDisplayObjects (
216 char *DisplayCountArg);
219 AcpiDbCheckIntegrity (
223 AcpiDbFindReferences (
232 * dbdisply - debug display commands
235 AcpiDbDisplayMethodInfo (
236 ACPI_PARSE_OBJECT *Op);
239 AcpiDbDecodeAndDisplayObject (
244 AcpiDbDisplayResultObject (
245 ACPI_OPERAND_OBJECT *ObjDesc,
246 ACPI_WALK_STATE *WalkState);
249 AcpiDbDisplayAllMethods (
250 char *DisplayCountArg);
253 AcpiDbDisplayArguments (
257 AcpiDbDisplayLocals (
261 AcpiDbDisplayResults (
265 AcpiDbDisplayCallingTree (
269 AcpiDbDisplayObjectType (
273 AcpiDbDisplayArgumentObject (
274 ACPI_OPERAND_OBJECT *ObjDesc,
275 ACPI_WALK_STATE *WalkState);
279 * dbexec - debugger control method execution
285 ACPI_OBJECT_TYPE *Types,
289 AcpiDbCreateExecutionThreads (
292 char *MethodNameArg);
294 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
297 ACPI_MEMORY_LIST *Cache);
302 * dbfileio - Debugger file I/O commands
305 AcpiDbMatchArgument (
307 ARGUMENT_INFO *Arguments);
310 AcpiDbCloseDebugFile (
314 AcpiDbOpenDebugFile (
318 AcpiDbLoadAcpiTable (
322 AcpiDbGetTableFromFile (
324 ACPI_TABLE_HEADER **Table);
327 AcpiDbReadTableFromFile (
329 ACPI_TABLE_HEADER **Table);
333 * dbhistry - debugger HISTORY command
340 AcpiDbDisplayHistory (
344 AcpiDbGetFromHistory (
345 char *CommandNumArg);
349 * dbinput - user front-end to the AML debugger
352 AcpiDbCommandDispatch (
354 ACPI_WALK_STATE *WalkState,
355 ACPI_PARSE_OBJECT *Op);
357 void ACPI_SYSTEM_XFACE
358 AcpiDbExecuteThread (
364 ACPI_PARSE_OBJECT *Op);
370 ACPI_OBJECT_TYPE *ReturnType);
374 * dbstats - Generation and display of ACPI table statistics
377 AcpiDbGenerateStatistics (
378 ACPI_PARSE_OBJECT *Root,
382 AcpiDbDisplayStatistics (
387 * dbutils - AML debugger utilities
390 AcpiDbSetOutputDestination (
394 AcpiDbDumpExternalObject (
395 ACPI_OBJECT *ObjDesc,
399 AcpiDbPrepNamestring (
402 ACPI_NAMESPACE_NODE *
403 AcpiDbLocalNsLookup (
407 AcpiDbUint32ToHexString (
411 #endif /* __ACDEBUG_H__ */