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 AcpiDbUnloadAcpiTable (
120 AcpiDbDisplayInterfaces (
122 char *InterfaceNameArg);
133 AcpiDbDisplayResources (
141 AcpiDbDisplayHandlers (
151 * dbmethod - control method commands
154 AcpiDbSetMethodBreakpoint (
156 ACPI_WALK_STATE *WalkState,
157 ACPI_PARSE_OBJECT *Op);
160 AcpiDbSetMethodCallBreakpoint (
161 ACPI_PARSE_OBJECT *Op);
164 AcpiDbSetMethodData (
170 AcpiDbDisassembleMethod (
174 AcpiDbDisassembleAml (
176 ACPI_PARSE_OBJECT *Op);
184 * dbnames - namespace commands
191 AcpiDbDumpNamespace (
196 AcpiDbDumpNamespaceByOwner (
201 AcpiDbFindNameInNamespace (
205 AcpiDbCheckPredefinedNames (
209 AcpiDbDisplayObjects (
211 char *DisplayCountArg);
214 AcpiDbCheckIntegrity (
218 AcpiDbFindReferences (
227 * dbdisply - debug display commands
230 AcpiDbDisplayMethodInfo (
231 ACPI_PARSE_OBJECT *Op);
234 AcpiDbDecodeAndDisplayObject (
239 AcpiDbDisplayResultObject (
240 ACPI_OPERAND_OBJECT *ObjDesc,
241 ACPI_WALK_STATE *WalkState);
244 AcpiDbDisplayAllMethods (
245 char *DisplayCountArg);
248 AcpiDbDisplayArguments (
252 AcpiDbDisplayLocals (
256 AcpiDbDisplayResults (
260 AcpiDbDisplayCallingTree (
264 AcpiDbDisplayObjectType (
268 AcpiDbDisplayArgumentObject (
269 ACPI_OPERAND_OBJECT *ObjDesc,
270 ACPI_WALK_STATE *WalkState);
274 * dbexec - debugger control method execution
283 AcpiDbCreateExecutionThreads (
286 char *MethodNameArg);
288 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
291 ACPI_MEMORY_LIST *Cache);
296 * dbfileio - Debugger file I/O commands
299 AcpiDbMatchArgument (
301 ARGUMENT_INFO *Arguments);
304 AcpiDbCloseDebugFile (
308 AcpiDbOpenDebugFile (
312 AcpiDbLoadAcpiTable (
316 AcpiDbGetTableFromFile (
318 ACPI_TABLE_HEADER **Table);
321 AcpiDbReadTableFromFile (
323 ACPI_TABLE_HEADER **Table);
327 * dbhistry - debugger HISTORY command
334 AcpiDbDisplayHistory (
338 AcpiDbGetFromHistory (
339 char *CommandNumArg);
343 * dbinput - user front-end to the AML debugger
346 AcpiDbCommandDispatch (
348 ACPI_WALK_STATE *WalkState,
349 ACPI_PARSE_OBJECT *Op);
351 void ACPI_SYSTEM_XFACE
352 AcpiDbExecuteThread (
358 ACPI_PARSE_OBJECT *Op);
362 * dbstats - Generation and display of ACPI table statistics
365 AcpiDbGenerateStatistics (
366 ACPI_PARSE_OBJECT *Root,
370 AcpiDbDisplayStatistics (
375 * dbutils - AML debugger utilities
378 AcpiDbSetOutputDestination (
382 AcpiDbDumpExternalObject (
383 ACPI_OBJECT *ObjDesc,
387 AcpiDbPrepNamestring (
390 ACPI_NAMESPACE_NODE *
391 AcpiDbLocalNsLookup (
395 AcpiDbUInt32ToHexString (
399 #endif /* __ACDEBUG_H__ */