1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2016, 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.
47 /* The debugger is used in conjunction with the disassembler most of time */
49 #ifdef ACPI_DISASSEMBLER
54 #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
56 typedef struct acpi_db_command_info
58 const char *Name
; /* Command Name */
59 UINT8 MinArgs
; /* Minimum arguments required */
61 } ACPI_DB_COMMAND_INFO
;
63 typedef struct acpi_db_command_help
65 UINT8 LineCount
; /* Number of help lines */
66 char *Invocation
; /* Command Invocation */
67 char *Description
; /* Command Description */
69 } ACPI_DB_COMMAND_HELP
;
71 typedef struct acpi_db_argument_info
73 const char *Name
; /* Argument Name */
75 } ACPI_DB_ARGUMENT_INFO
;
77 typedef struct acpi_db_execute_walk
82 } ACPI_DB_EXECUTE_WALK
;
85 #define PARAM_LIST(pl) pl
87 #define EX_NO_SINGLE_STEP 1
88 #define EX_SINGLE_STEP 2
92 * dbxface - external debugger interfaces
94 ACPI_DBR_DEPENDENT_RETURN_OK (
97 ACPI_WALK_STATE
*WalkState
,
98 ACPI_PARSE_OBJECT
*Op
,
101 ACPI_DBR_DEPENDENT_RETURN_VOID (
103 AcpiDbSignalBreakPoint (
104 ACPI_WALK_STATE
*WalkState
))
108 * dbcmds - debug commands and output routines
110 ACPI_NAMESPACE_NODE
*
111 AcpiDbConvertToNode (
115 AcpiDbDisplayTableInfo (
119 AcpiDbDisplayTemplate (
123 AcpiDbUnloadAcpiTable (
132 AcpiDbDisplayInterfaces (
134 char *InterfaceNameArg
);
151 AcpiDbDisplayResources (
154 ACPI_HW_DEPENDENT_RETURN_VOID (
160 AcpiDbDisplayHandlers (
163 ACPI_HW_DEPENDENT_RETURN_VOID (
169 ACPI_HW_DEPENDENT_RETURN_VOID (
180 * dbconvert - miscellaneous conversion routines
183 AcpiDbHexCharToValue (
188 AcpiDbConvertToPackage (
190 ACPI_OBJECT
*Object
);
193 AcpiDbConvertToObject (
194 ACPI_OBJECT_TYPE Type
,
196 ACPI_OBJECT
*Object
);
199 AcpiDbEncodePldBuffer (
200 ACPI_PLD_INFO
*PldInfo
);
203 AcpiDbDumpPldBuffer (
204 ACPI_OBJECT
*ObjDesc
);
208 * dbmethod - control method commands
211 AcpiDbSetMethodBreakpoint (
213 ACPI_WALK_STATE
*WalkState
,
214 ACPI_PARSE_OBJECT
*Op
);
217 AcpiDbSetMethodCallBreakpoint (
218 ACPI_PARSE_OBJECT
*Op
);
221 AcpiDbSetMethodData (
227 AcpiDbDisassembleMethod (
231 AcpiDbDisassembleAml (
233 ACPI_PARSE_OBJECT
*Op
);
241 * dbnames - namespace commands
248 AcpiDbDumpNamespace (
253 AcpiDbDumpNamespacePaths (
257 AcpiDbDumpNamespaceByOwner (
262 AcpiDbFindNameInNamespace (
266 AcpiDbCheckPredefinedNames (
270 AcpiDbDisplayObjects (
272 char *DisplayCountArg
);
275 AcpiDbCheckIntegrity (
279 AcpiDbFindReferences (
288 * dbdisply - debug display commands
291 AcpiDbDisplayMethodInfo (
292 ACPI_PARSE_OBJECT
*Op
);
295 AcpiDbDecodeAndDisplayObject (
299 ACPI_DBR_DEPENDENT_RETURN_VOID (
301 AcpiDbDisplayResultObject (
302 ACPI_OPERAND_OBJECT
*ObjDesc
,
303 ACPI_WALK_STATE
*WalkState
))
306 AcpiDbDisplayAllMethods (
307 char *DisplayCountArg
);
310 AcpiDbDisplayArguments (
314 AcpiDbDisplayLocals (
318 AcpiDbDisplayResults (
322 AcpiDbDisplayCallingTree (
326 AcpiDbDisplayObjectType (
329 ACPI_DBR_DEPENDENT_RETURN_VOID (
331 AcpiDbDisplayArgumentObject (
332 ACPI_OPERAND_OBJECT
*ObjDesc
,
333 ACPI_WALK_STATE
*WalkState
))
337 * dbexec - debugger control method execution
343 ACPI_OBJECT_TYPE
*Types
,
347 AcpiDbCreateExecutionThreads (
350 char *MethodNameArg
);
353 AcpiDbDeleteObjects (
355 ACPI_OBJECT
*Objects
);
357 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
360 ACPI_MEMORY_LIST
*Cache
);
365 * dbfileio - Debugger file I/O commands
368 AcpiDbMatchArgument (
370 ACPI_DB_ARGUMENT_INFO
*Arguments
);
373 AcpiDbCloseDebugFile (
377 AcpiDbOpenDebugFile (
381 AcpiDbLoadAcpiTable (
386 ACPI_NEW_TABLE_DESC
*ListHead
);
390 * dbhistry - debugger HISTORY command
397 AcpiDbDisplayHistory (
401 AcpiDbGetFromHistory (
402 char *CommandNumArg
);
405 AcpiDbGetHistoryByIndex (
410 * dbinput - user front-end to the AML debugger
413 AcpiDbCommandDispatch (
415 ACPI_WALK_STATE
*WalkState
,
416 ACPI_PARSE_OBJECT
*Op
);
418 void ACPI_SYSTEM_XFACE
419 AcpiDbExecuteThread (
425 ACPI_PARSE_OBJECT
*Op
);
431 ACPI_OBJECT_TYPE
*ReturnType
);
438 AcpiDbDecodeInternalObject (
439 ACPI_OPERAND_OBJECT
*ObjDesc
);
442 AcpiDbDisplayInternalObject (
443 ACPI_OPERAND_OBJECT
*ObjDesc
,
444 ACPI_WALK_STATE
*WalkState
);
447 AcpiDbDecodeArguments (
448 ACPI_WALK_STATE
*WalkState
);
452 ACPI_WALK_STATE
*WalkState
);
455 AcpiDbDumpMethodInfo (
457 ACPI_WALK_STATE
*WalkState
);
461 * dbstats - Generation and display of ACPI table statistics
464 AcpiDbGenerateStatistics (
465 ACPI_PARSE_OBJECT
*Root
,
469 AcpiDbDisplayStatistics (
474 * dbutils - AML debugger utilities
477 AcpiDbSetOutputDestination (
481 AcpiDbDumpExternalObject (
482 ACPI_OBJECT
*ObjDesc
,
486 AcpiDbPrepNamestring (
489 ACPI_NAMESPACE_NODE
*
490 AcpiDbLocalNsLookup (
494 AcpiDbUint32ToHexString (
498 #endif /* __ACDEBUG_H__ */