1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2011, 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 (
145 AcpiDbDisplayHandlers (
155 * dbmethod - control method commands
158 AcpiDbSetMethodBreakpoint (
160 ACPI_WALK_STATE *WalkState,
161 ACPI_PARSE_OBJECT *Op);
164 AcpiDbSetMethodCallBreakpoint (
165 ACPI_PARSE_OBJECT *Op);
168 AcpiDbSetMethodData (
174 AcpiDbDisassembleMethod (
178 AcpiDbDisassembleAml (
180 ACPI_PARSE_OBJECT *Op);
188 * dbnames - namespace commands
195 AcpiDbDumpNamespace (
200 AcpiDbDumpNamespaceByOwner (
205 AcpiDbFindNameInNamespace (
209 AcpiDbCheckPredefinedNames (
213 AcpiDbDisplayObjects (
215 char *DisplayCountArg);
218 AcpiDbCheckIntegrity (
222 AcpiDbFindReferences (
231 * dbdisply - debug display commands
234 AcpiDbDisplayMethodInfo (
235 ACPI_PARSE_OBJECT *Op);
238 AcpiDbDecodeAndDisplayObject (
243 AcpiDbDisplayResultObject (
244 ACPI_OPERAND_OBJECT *ObjDesc,
245 ACPI_WALK_STATE *WalkState);
248 AcpiDbDisplayAllMethods (
249 char *DisplayCountArg);
252 AcpiDbDisplayArguments (
256 AcpiDbDisplayLocals (
260 AcpiDbDisplayResults (
264 AcpiDbDisplayCallingTree (
268 AcpiDbDisplayObjectType (
272 AcpiDbDisplayArgumentObject (
273 ACPI_OPERAND_OBJECT *ObjDesc,
274 ACPI_WALK_STATE *WalkState);
278 * dbexec - debugger control method execution
284 ACPI_OBJECT_TYPE *Types,
288 AcpiDbCreateExecutionThreads (
291 char *MethodNameArg);
293 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
296 ACPI_MEMORY_LIST *Cache);
301 * dbfileio - Debugger file I/O commands
304 AcpiDbMatchArgument (
306 ARGUMENT_INFO *Arguments);
309 AcpiDbCloseDebugFile (
313 AcpiDbOpenDebugFile (
317 AcpiDbLoadAcpiTable (
321 AcpiDbGetTableFromFile (
323 ACPI_TABLE_HEADER **Table);
326 AcpiDbReadTableFromFile (
328 ACPI_TABLE_HEADER **Table);
332 * dbhistry - debugger HISTORY command
339 AcpiDbDisplayHistory (
343 AcpiDbGetFromHistory (
344 char *CommandNumArg);
348 * dbinput - user front-end to the AML debugger
351 AcpiDbCommandDispatch (
353 ACPI_WALK_STATE *WalkState,
354 ACPI_PARSE_OBJECT *Op);
356 void ACPI_SYSTEM_XFACE
357 AcpiDbExecuteThread (
363 ACPI_PARSE_OBJECT *Op);
369 ACPI_OBJECT_TYPE *ReturnType);
373 * dbstats - Generation and display of ACPI table statistics
376 AcpiDbGenerateStatistics (
377 ACPI_PARSE_OBJECT *Root,
381 AcpiDbDisplayStatistics (
386 * dbutils - AML debugger utilities
389 AcpiDbSetOutputDestination (
393 AcpiDbDumpExternalObject (
394 ACPI_OBJECT *ObjDesc,
398 AcpiDbPrepNamestring (
401 ACPI_NAMESPACE_NODE *
402 AcpiDbLocalNsLookup (
406 AcpiDbUInt32ToHexString (
410 #endif /* __ACDEBUG_H__ */