ReactOS  0.4.14-dev-114-gc8cbd56
acdebug.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Name: acdebug.h - ACPI/AML debugger
4  *
5  *****************************************************************************/
6 
7 /*
8  * Copyright (C) 2000 - 2019, Intel Corp.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
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.
25  *
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.
29  *
30  * NO WARRANTY
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.
42  */
43 
44 #ifndef __ACDEBUG_H__
45 #define __ACDEBUG_H__
46 
47 /* The debugger is used in conjunction with the disassembler most of time */
48 
49 #ifdef ACPI_DISASSEMBLER
50 #include "acdisasm.h"
51 #endif
52 
53 
54 #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
55 #define ACPI_DEBUG_LENGTH_FORMAT " (%.4X bits, %.3X bytes)"
56 
57 typedef struct acpi_db_command_info
58 {
59  const char *Name; /* Command Name */
60  UINT8 MinArgs; /* Minimum arguments required */
61 
63 
64 typedef struct acpi_db_command_help
65 {
66  UINT8 LineCount; /* Number of help lines */
67  char *Invocation; /* Command Invocation */
68  char *Description; /* Command Description */
69 
71 
72 typedef struct acpi_db_argument_info
73 {
74  const char *Name; /* Argument Name */
75 
77 
78 typedef struct acpi_db_execute_walk
79 {
82 
84 
85 
86 #define PARAM_LIST(pl) pl
87 
88 #define EX_NO_SINGLE_STEP 1
89 #define EX_SINGLE_STEP 2
90 
91 
92 /*
93  * dbxface - external debugger interfaces
94  */
97 AcpiDbSingleStep (
98  ACPI_WALK_STATE *WalkState,
100  UINT32 OpType))
101 
103 void
104 AcpiDbSignalBreakPoint (
105  ACPI_WALK_STATE *WalkState))
106 
107 
108 /*
109  * dbcmds - debug commands and output routines
110  */
112 AcpiDbConvertToNode (
113  char *InString);
114 
115 void
117  char *TableArg);
118 
119 void
121  char *BufferArg);
122 
123 void
125  char *Name);
126 
127 void
129  char *Name,
130  UINT32 Value);
131 
132 void
134  char *ActionArg,
135  char *InterfaceNameArg);
136 
138 AcpiDbSleep (
139  char *ObjectArg);
140 
141 void
142 AcpiDbTrace (
143  char *EnableArg,
144  char *MethodArg,
145  char *OnceArg);
146 
147 void
149  void);
150 
151 void
153  char *ObjectArg);
154 
156 void
157 AcpiDbDisplayGpes (
158  void))
159 
160 void
161 AcpiDbDisplayHandlers (
162  void);
163 
165 void
166 AcpiDbGenerateGpe (
167  char *GpeArg,
168  char *BlockArg))
169 
171 void
172 AcpiDbGenerateSci (
173  void))
174 
175 void
176 AcpiDbExecuteTest (
177  char *TypeArg);
178 
179 
180 /*
181  * dbconvert - miscellaneous conversion routines
182  */
185  int HexChar,
186  UINT8 *ReturnValue);
187 
190  char *String,
192 
196  char *String,
198 
199 UINT8 *
201  ACPI_PLD_INFO *PldInfo);
202 
203 void
205  ACPI_OBJECT *ObjDesc);
206 
207 
208 /*
209  * dbmethod - control method commands
210  */
211 void
213  char *Location,
214  ACPI_WALK_STATE *WalkState,
215  ACPI_PARSE_OBJECT *Op);
216 
217 void
219  ACPI_PARSE_OBJECT *Op);
220 
221 void
223  char *TypeArg,
224  char *IndexArg,
225  char *ValueArg);
226 
229  char *Name);
230 
231 void
233  char *Statements,
234  ACPI_PARSE_OBJECT *Op);
235 
236 void
238  void);
239 
240 
241 /*
242  * dbnames - namespace commands
243  */
244 void
246  char *Name);
247 
248 void
250  char *StartArg,
251  char *DepthArg);
252 
253 void
255  void);
256 
257 void
259  char *OwnerArg,
260  char *DepthArg);
261 
264  char *NameArg);
265 
266 void
268  void);
269 
272  char *ObjTypeArg,
273  char *DisplayCountArg);
274 
275 void
277  void);
278 
279 void
281  char *ObjectArg);
282 
283 void
285  void);
286 
287 
288 /*
289  * dbdisply - debug display commands
290  */
291 void
293  ACPI_PARSE_OBJECT *Op);
294 
295 void
297  char *Target,
298  char *OutputType);
299 
301 void
302 AcpiDbDisplayResultObject (
303  ACPI_OPERAND_OBJECT *ObjDesc,
304  ACPI_WALK_STATE *WalkState))
305 
307 AcpiDbDisplayAllMethods (
308  char *DisplayCountArg);
309 
310 void
312  void);
313 
314 void
316  void);
317 
318 void
320  void);
321 
322 void
324  void);
325 
326 void
328  char *ObjectArg);
329 
331 void
332 AcpiDbDisplayArgumentObject (
333  ACPI_OPERAND_OBJECT *ObjDesc,
334  ACPI_WALK_STATE *WalkState))
335 
336 
337 /*
338  * dbexec - debugger control method execution
339  */
340 void
341 AcpiDbExecute (
342  char *Name,
343  char **Args,
345  UINT32 Flags);
346 
347 void
349  char *MethodNameArg,
350  char **Arguments,
352 
353 void
355  char *NumThreadsArg,
356  char *NumLoopsArg,
357  char *MethodNameArg);
358 
359 void
361  UINT32 Count,
362  ACPI_OBJECT *Objects);
363 
364 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
365 UINT32
366 AcpiDbGetCacheInfo (
368 #endif
369 
370 
371 /*
372  * dbfileio - Debugger file I/O commands
373  */
376  char *UserArgument,
377  ACPI_DB_ARGUMENT_INFO *Arguments);
378 
379 void
381  void);
382 
383 void
385  char *Name);
386 
389  char *Filename);
390 
393  ACPI_NEW_TABLE_DESC *ListHead);
394 
395 
396 /*
397  * dbhistry - debugger HISTORY command
398  */
399 void
401  char *CommandLine);
402 
403 void
405  void);
406 
407 char *
409  char *CommandNumArg);
410 
411 char *
413  UINT32 CommanddNum);
414 
415 
416 /*
417  * dbinput - user front-end to the AML debugger
418  */
421  char *InputBuffer,
422  ACPI_WALK_STATE *WalkState,
423  ACPI_PARSE_OBJECT *Op);
424 
427  void *Context);
428 
431  void);
432 
433 char *
435  char *String,
436  char **Next,
437  ACPI_OBJECT_TYPE *ReturnType);
438 
439 
440 /*
441  * dbobject
442  */
443 void
445  ACPI_OPERAND_OBJECT *ObjDesc);
446 
447 void
449  ACPI_OPERAND_OBJECT *ObjDesc,
450  ACPI_WALK_STATE *WalkState);
451 
452 void
454  ACPI_WALK_STATE *WalkState);
455 
456 void
458  ACPI_WALK_STATE *WalkState);
459 
460 void
463  ACPI_WALK_STATE *WalkState);
464 
465 
466 /*
467  * dbstats - Generation and display of ACPI table statistics
468  */
469 void
472  BOOLEAN IsMethod);
473 
476  char *TypeArg);
477 
478 
479 /*
480  * dbutils - AML debugger utilities
481  */
482 void
484  UINT32 Where);
485 
486 void
488  ACPI_OBJECT *ObjDesc,
489  UINT32 Level);
490 
491 void
493  char *Name);
494 
497  char *Name);
498 
499 void
501  UINT32 Value,
502  char *Buffer);
503 
504 #endif /* __ACDEBUG_H__ */
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
ACPI_STATUS AcpiDbLoadTables(ACPI_NEW_TABLE_DESC *ListHead)
void AcpiDbAddToHistory(char *CommandLine)
void AcpiDbSetMethodCallBreakpoint(ACPI_PARSE_OBJECT *Op)
void AcpiDbDumpExternalObject(ACPI_OBJECT *ObjDesc, UINT32 Level)
void AcpiDbSetScope(char *Name)
Type
Definition: Type.h:6
char * AcpiDbGetHistoryByIndex(UINT32 CommanddNum)
void AcpiDbDisplayInternalObject(ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState)
ACPI_STATUS AcpiDbSleep(char *ObjectArg)
void AcpiDbDisplayResults(void)
void AcpiDbDecodeInternalObject(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: fatfs.h:173
ACPI_NAMESPACE_NODE * AcpiDbLocalNsLookup(char *Name)
void AcpiDbDumpNamespacePaths(void)
void AcpiDbDisplayTemplate(char *BufferArg)
struct acpi_db_command_help ACPI_DB_COMMAND_HELP
void AcpiDbCreateExecutionThread(char *MethodNameArg, char **Arguments, ACPI_OBJECT_TYPE *Types)
ACPI_STATUS AcpiDbConvertToPackage(char *String, ACPI_OBJECT *Object)
ACPI_STATUS AcpiDbUserCommands(void)
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
void AcpiDbDisplayObjectType(char *ObjectArg)
static WCHAR String[]
Definition: stringtable.c:55
UINT32 ACPI_STATUS
Definition: actypes.h:460
const char * Name
Definition: acdebug.h:59
void AcpiDbDeleteObjects(UINT32 Count, ACPI_OBJECT *Objects)
CHAR InputBuffer[80]
Definition: conmgr.c:33
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:925
void AcpiDbEvaluatePredefinedNames(void)
void AcpiDbCheckPredefinedNames(void)
char * AcpiDbGetFromHistory(char *CommandNumArg)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void AcpiDbTrace(char *EnableArg, char *MethodArg, char *OnceArg)
struct acpi_db_execute_walk ACPI_DB_EXECUTE_WALK
UINT32 void void ** ReturnValue
Definition: acevents.h:214
unsigned int UINT32
UINT8 * AcpiDbEncodePldBuffer(ACPI_PLD_INFO *PldInfo)
char * AcpiDbGetNextToken(char *String, char **Next, ACPI_OBJECT_TYPE *ReturnType)
void AcpiDbDecodeArguments(ACPI_WALK_STATE *WalkState)
unsigned char BOOLEAN
void AcpiDbFindReferences(char *ObjectArg)
void AcpiDbDisplayResources(char *ObjectArg)
char * Description
Definition: acdebug.h:68
UINT32 ACPI_OBJECT_TYPE
Definition: actypes.h:676
char ** Args
Definition: acdebug.h:343
Definition: bufpool.h:45
void AcpiDbCreateExecutionThreads(char *NumThreadsArg, char *NumLoopsArg, char *MethodNameArg)
root entry for file system trees
Definition: entries.h:148
void AcpiDbDisplayTableInfo(char *TableArg)
void AcpiDbDumpPldBuffer(ACPI_OBJECT *ObjDesc)
ACPI_OBJECT_TYPE AcpiDbMatchArgument(char *UserArgument, ACPI_DB_ARGUMENT_INFO *Arguments)
void AcpiDbSendNotify(char *Name, UINT32 Value)
void AcpiDbGetBusInfo(void)
void AcpiDbDisplayHistory(void)
ACPI_STATUS AcpiDbConvertToObject(ACPI_OBJECT_TYPE Type, char *String, ACPI_OBJECT *Object)
#define ACPI_SYSTEM_XFACE
Definition: acenv.h:311
ACPI_STATUS AcpiDbDisassembleMethod(char *Name)
void AcpiDbUnloadAcpiTable(char *Name)
const char * Name
Definition: acdebug.h:74
void AcpiDbDisplayMethodInfo(ACPI_PARSE_OBJECT *Op)
void AcpiDbDumpMethodInfo(ACPI_STATUS Status, ACPI_WALK_STATE *WalkState)
void AcpiDbCheckIntegrity(void)
_Must_inspect_result_ typedef _In_ ULONG _In_ BOOLEAN Target
Definition: iotypes.h:1068
void AcpiDbPrepNamestring(char *Name)
ACPI_HW_DEPENDENT_RETURN_VOID(void AcpiDbDisplayGpes(void)) void AcpiDbDisplayHandlers(void)
static IUnknown Object
Definition: main.c:512
void AcpiDbOpenDebugFile(char *Name)
void AcpiDbSetMethodBreakpoint(char *Location, ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)
ACPI_DBR_DEPENDENT_RETURN_VOID(void AcpiDbDisplayResultObject(ACPI_OPERAND_OBJECT *ObjDesc, ACPI_WALK_STATE *WalkState)) ACPI_STATUS AcpiDbDisplayAllMethods(char *DisplayCountArg)
void AcpiDbDecodeAndDisplayObject(char *Target, char *OutputType)
void AcpiDbSetMethodData(char *TypeArg, char *IndexArg, char *ValueArg)
void AcpiDbDisplayInterfaces(char *ActionArg, char *InterfaceNameArg)
ACPI_STATUS AcpiDbHexCharToValue(int HexChar, UINT8 *ReturnValue)
ACPI_STATUS AcpiDbLoadAcpiTable(char *Filename)
Status
Definition: gdiplustypes.h:24
void AcpiDbDisplayArguments(void)
void AcpiDbDisplayCallingTree(void)
ACPI_STATUS AcpiDbFindNameInNamespace(char *NameArg)
void AcpiDbDumpNamespaceByOwner(char *OwnerArg, char *DepthArg)
char ACPI_OBJECT_TYPE * Types
Definition: acdebug.h:343
void AcpiDbDisplayLocks(void)
void AcpiDbDisplayLocals(void)
struct acpi_db_command_info ACPI_DB_COMMAND_INFO
struct acpi_db_argument_info ACPI_DB_ARGUMENT_INFO
void AcpiDbDumpNamespace(char *StartArg, char *DepthArg)
void AcpiDbDecodeLocals(ACPI_WALK_STATE *WalkState)
void AcpiDbUint32ToHexString(UINT32 Value, char *Buffer)
ACPI_DBR_DEPENDENT_RETURN_OK(ACPI_STATUS AcpiDbSingleStep(ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op, UINT32 OpType)) ACPI_DBR_DEPENDENT_RETURN_VOID(void AcpiDbSignalBreakPoint(ACPI_WALK_STATE *WalkState)) ACPI_NAMESPACE_NODE *AcpiDbConvertToNode(char *InString)
void AcpiDbDisassembleAml(char *Statements, ACPI_PARSE_OBJECT *Op)
ACPI_STATUS AcpiDbDisplayObjects(char *ObjTypeArg, char *DisplayCountArg)
unsigned char UINT8
void AcpiDbGenerateStatistics(ACPI_PARSE_OBJECT *Root, BOOLEAN IsMethod)
ACPI_STATUS AcpiDbDisplayStatistics(char *TypeArg)
void ACPI_SYSTEM_XFACE AcpiDbExecuteThread(void *Context)
void AcpiDbCloseDebugFile(void)
void AcpiDbSetOutputDestination(UINT32 Where)
ACPI_STATUS AcpiDbCommandDispatch(char *InputBuffer, ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op)