1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, 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 (
162 ACPI_HW_DEPENDENT_RETURN_VOID (
168 * dbconvert - miscellaneous conversion routines
171 AcpiDbHexCharToValue (
176 AcpiDbConvertToPackage (
178 ACPI_OBJECT
*Object
);
181 AcpiDbConvertToObject (
182 ACPI_OBJECT_TYPE Type
,
184 ACPI_OBJECT
*Object
);
187 AcpiDbEncodePldBuffer (
188 ACPI_PLD_INFO
*PldInfo
);
191 AcpiDbDumpPldBuffer (
192 ACPI_OBJECT
*ObjDesc
);
196 * dbmethod - control method commands
199 AcpiDbSetMethodBreakpoint (
201 ACPI_WALK_STATE
*WalkState
,
202 ACPI_PARSE_OBJECT
*Op
);
205 AcpiDbSetMethodCallBreakpoint (
206 ACPI_PARSE_OBJECT
*Op
);
209 AcpiDbSetMethodData (
215 AcpiDbDisassembleMethod (
219 AcpiDbDisassembleAml (
221 ACPI_PARSE_OBJECT
*Op
);
229 * dbnames - namespace commands
236 AcpiDbDumpNamespace (
241 AcpiDbDumpNamespacePaths (
245 AcpiDbDumpNamespaceByOwner (
250 AcpiDbFindNameInNamespace (
254 AcpiDbCheckPredefinedNames (
258 AcpiDbDisplayObjects (
260 char *DisplayCountArg
);
263 AcpiDbCheckIntegrity (
267 AcpiDbFindReferences (
276 * dbdisply - debug display commands
279 AcpiDbDisplayMethodInfo (
280 ACPI_PARSE_OBJECT
*Op
);
283 AcpiDbDecodeAndDisplayObject (
288 AcpiDbDisplayResultObject (
289 ACPI_OPERAND_OBJECT
*ObjDesc
,
290 ACPI_WALK_STATE
*WalkState
);
293 AcpiDbDisplayAllMethods (
294 char *DisplayCountArg
);
297 AcpiDbDisplayArguments (
301 AcpiDbDisplayLocals (
305 AcpiDbDisplayResults (
309 AcpiDbDisplayCallingTree (
313 AcpiDbDisplayObjectType (
317 AcpiDbDisplayArgumentObject (
318 ACPI_OPERAND_OBJECT
*ObjDesc
,
319 ACPI_WALK_STATE
*WalkState
);
323 * dbexec - debugger control method execution
329 ACPI_OBJECT_TYPE
*Types
,
333 AcpiDbCreateExecutionThreads (
336 char *MethodNameArg
);
339 AcpiDbDeleteObjects (
341 ACPI_OBJECT
*Objects
);
343 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
346 ACPI_MEMORY_LIST
*Cache
);
351 * dbfileio - Debugger file I/O commands
354 AcpiDbMatchArgument (
356 ACPI_DB_ARGUMENT_INFO
*Arguments
);
359 AcpiDbCloseDebugFile (
363 AcpiDbOpenDebugFile (
367 AcpiDbLoadAcpiTable (
371 AcpiDbGetTableFromFile (
373 ACPI_TABLE_HEADER
**Table
);
376 AcpiDbReadTableFromFile (
378 ACPI_TABLE_HEADER
**Table
);
382 * dbhistry - debugger HISTORY command
389 AcpiDbDisplayHistory (
393 AcpiDbGetFromHistory (
394 char *CommandNumArg
);
397 AcpiDbGetHistoryByIndex (
402 * dbinput - user front-end to the AML debugger
405 AcpiDbCommandDispatch (
407 ACPI_WALK_STATE
*WalkState
,
408 ACPI_PARSE_OBJECT
*Op
);
410 void ACPI_SYSTEM_XFACE
411 AcpiDbExecuteThread (
417 ACPI_PARSE_OBJECT
*Op
);
423 ACPI_OBJECT_TYPE
*ReturnType
);
427 * dbstats - Generation and display of ACPI table statistics
430 AcpiDbGenerateStatistics (
431 ACPI_PARSE_OBJECT
*Root
,
435 AcpiDbDisplayStatistics (
440 * dbutils - AML debugger utilities
443 AcpiDbSetOutputDestination (
447 AcpiDbDumpExternalObject (
448 ACPI_OBJECT
*ObjDesc
,
452 AcpiDbPrepNamestring (
455 ACPI_NAMESPACE_NODE
*
456 AcpiDbLocalNsLookup (
460 AcpiDbUint32ToHexString (
464 #endif /* __ACDEBUG_H__ */