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
280 ACPI_OBJECT_TYPE *Types,
284 AcpiDbCreateExecutionThreads (
287 char *MethodNameArg);
289 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
292 ACPI_MEMORY_LIST *Cache);
297 * dbfileio - Debugger file I/O commands
300 AcpiDbMatchArgument (
302 ARGUMENT_INFO *Arguments);
305 AcpiDbCloseDebugFile (
309 AcpiDbOpenDebugFile (
313 AcpiDbLoadAcpiTable (
317 AcpiDbGetTableFromFile (
319 ACPI_TABLE_HEADER **Table);
322 AcpiDbReadTableFromFile (
324 ACPI_TABLE_HEADER **Table);
328 * dbhistry - debugger HISTORY command
335 AcpiDbDisplayHistory (
339 AcpiDbGetFromHistory (
340 char *CommandNumArg);
344 * dbinput - user front-end to the AML debugger
347 AcpiDbCommandDispatch (
349 ACPI_WALK_STATE *WalkState,
350 ACPI_PARSE_OBJECT *Op);
352 void ACPI_SYSTEM_XFACE
353 AcpiDbExecuteThread (
359 ACPI_PARSE_OBJECT *Op);
365 ACPI_OBJECT_TYPE *ReturnType);
369 * dbstats - Generation and display of ACPI table statistics
372 AcpiDbGenerateStatistics (
373 ACPI_PARSE_OBJECT *Root,
377 AcpiDbDisplayStatistics (
382 * dbutils - AML debugger utilities
385 AcpiDbSetOutputDestination (
389 AcpiDbDumpExternalObject (
390 ACPI_OBJECT *ObjDesc,
394 AcpiDbPrepNamestring (
397 ACPI_NAMESPACE_NODE *
398 AcpiDbLocalNsLookup (
402 AcpiDbUInt32ToHexString (
406 #endif /* __ACDEBUG_H__ */