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 (
124 AcpiDbDisplayInterfaces (
126 char *InterfaceNameArg);
137 AcpiDbDisplayResources (
140 ACPI_HW_DEPENDENT_RETURN_VOID (
146 AcpiDbDisplayHandlers (
149 ACPI_HW_DEPENDENT_RETURN_VOID (
157 * dbmethod - control method commands
160 AcpiDbSetMethodBreakpoint (
162 ACPI_WALK_STATE *WalkState,
163 ACPI_PARSE_OBJECT *Op);
166 AcpiDbSetMethodCallBreakpoint (
167 ACPI_PARSE_OBJECT *Op);
170 AcpiDbSetMethodData (
176 AcpiDbDisassembleMethod (
180 AcpiDbDisassembleAml (
182 ACPI_PARSE_OBJECT *Op);
190 * dbnames - namespace commands
197 AcpiDbDumpNamespace (
202 AcpiDbDumpNamespaceByOwner (
207 AcpiDbFindNameInNamespace (
211 AcpiDbCheckPredefinedNames (
215 AcpiDbDisplayObjects (
217 char *DisplayCountArg);
220 AcpiDbCheckIntegrity (
224 AcpiDbFindReferences (
233 * dbdisply - debug display commands
236 AcpiDbDisplayMethodInfo (
237 ACPI_PARSE_OBJECT *Op);
240 AcpiDbDecodeAndDisplayObject (
245 AcpiDbDisplayResultObject (
246 ACPI_OPERAND_OBJECT *ObjDesc,
247 ACPI_WALK_STATE *WalkState);
250 AcpiDbDisplayAllMethods (
251 char *DisplayCountArg);
254 AcpiDbDisplayArguments (
258 AcpiDbDisplayLocals (
262 AcpiDbDisplayResults (
266 AcpiDbDisplayCallingTree (
270 AcpiDbDisplayObjectType (
274 AcpiDbDisplayArgumentObject (
275 ACPI_OPERAND_OBJECT *ObjDesc,
276 ACPI_WALK_STATE *WalkState);
280 * dbexec - debugger control method execution
286 ACPI_OBJECT_TYPE *Types,
290 AcpiDbCreateExecutionThreads (
293 char *MethodNameArg);
295 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
298 ACPI_MEMORY_LIST *Cache);
303 * dbfileio - Debugger file I/O commands
306 AcpiDbMatchArgument (
308 ARGUMENT_INFO *Arguments);
311 AcpiDbCloseDebugFile (
315 AcpiDbOpenDebugFile (
319 AcpiDbLoadAcpiTable (
323 AcpiDbGetTableFromFile (
325 ACPI_TABLE_HEADER **Table);
328 AcpiDbReadTableFromFile (
330 ACPI_TABLE_HEADER **Table);
334 * dbhistry - debugger HISTORY command
341 AcpiDbDisplayHistory (
345 AcpiDbGetFromHistory (
346 char *CommandNumArg);
350 * dbinput - user front-end to the AML debugger
353 AcpiDbCommandDispatch (
355 ACPI_WALK_STATE *WalkState,
356 ACPI_PARSE_OBJECT *Op);
358 void ACPI_SYSTEM_XFACE
359 AcpiDbExecuteThread (
365 ACPI_PARSE_OBJECT *Op);
371 ACPI_OBJECT_TYPE *ReturnType);
375 * dbstats - Generation and display of ACPI table statistics
378 AcpiDbGenerateStatistics (
379 ACPI_PARSE_OBJECT *Root,
383 AcpiDbDisplayStatistics (
388 * dbutils - AML debugger utilities
391 AcpiDbSetOutputDestination (
395 AcpiDbDumpExternalObject (
396 ACPI_OBJECT *ObjDesc,
400 AcpiDbPrepNamestring (
403 ACPI_NAMESPACE_NODE *
404 AcpiDbLocalNsLookup (
408 AcpiDbUInt32ToHexString (
412 #endif /* __ACDEBUG_H__ */