ReactOS  0.4.15-dev-1392-g3014417
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 - 2020, 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 {
83 
85 
86 
87 #define PARAM_LIST(pl) pl
88 
89 #define EX_NO_SINGLE_STEP 1
90 #define EX_SINGLE_STEP 2
91 #define EX_ALL 4
92 
93 
94 /*
95  * dbxface - external debugger interfaces
96  */
99 AcpiDbSingleStep (
100  ACPI_WALK_STATE *WalkState,
101  ACPI_PARSE_OBJECT *Op,
102  UINT32 OpType))
103 
105 void
106 AcpiDbSignalBreakPoint (
107  ACPI_WALK_STATE *WalkState))
108 
109 
110 /*
111  * dbcmds - debug commands and output routines
112  */
114 AcpiDbConvertToNode (
115  char *InString);
116 
117 void
119  char *TableArg);
120 
121 void
123  char *BufferArg);
124 
125 void
127  char *Name);
128 
129 void
131  char *Name,
132  UINT32 Value);
133 
134 void
136  char *ActionArg,
137  char *InterfaceNameArg);
138 
140 AcpiDbSleep (
141  char *ObjectArg);
142 
143 void
144 AcpiDbTrace (
145  char *EnableArg,
146  char *MethodArg,
147  char *OnceArg);
148 
149 void
151  void);
152 
153 void
155  char *ObjectArg);
156 
158 void
159 AcpiDbDisplayGpes (
160  void))
161 
162 void
163 AcpiDbDisplayHandlers (
164  void);
165 
167 void
168 AcpiDbGenerateGpe (
169  char *GpeArg,
170  char *BlockArg))
171 
173 void
174 AcpiDbGenerateSci (
175  void))
176 
177 void
178 AcpiDbExecuteTest (
179  char *TypeArg);
180 
181 
182 /*
183  * dbconvert - miscellaneous conversion routines
184  */
187  int HexChar,
188  UINT8 *ReturnValue);
189 
192  char *String,
194 
198  char *String,
200 
201 UINT8 *
203  ACPI_PLD_INFO *PldInfo);
204 
205 void
207  ACPI_OBJECT *ObjDesc);
208 
209 
210 /*
211  * dbmethod - control method commands
212  */
213 void
215  char *Location,
216  ACPI_WALK_STATE *WalkState,
217  ACPI_PARSE_OBJECT *Op);
218 
219 void
221  ACPI_PARSE_OBJECT *Op);
222 
223 void
225  char *TypeArg,
226  char *IndexArg,
227  char *ValueArg);
228 
231  char *Name);
232 
233 void
235  char *Statements,
236  ACPI_PARSE_OBJECT *Op);
237 
238 void
240  void);
241 
242 void
244  char *NameSeg);
245 
246 
247 /*
248  * dbnames - namespace commands
249  */
250 void
252  char *Name);
253 
254 void
256  char *StartArg,
257  char *DepthArg);
258 
259 void
261  void);
262 
263 void
265  char *OwnerArg,
266  char *DepthArg);
267 
270  char *NameArg);
271 
272 void
274  void);
275 
278  char *ObjTypeArg,
279  char *DisplayCountArg);
280 
281 void
283  void);
284 
285 void
287  char *ObjectArg);
288 
289 void
291  void);
292 
295  UINT32 AddressSpaceId);
296 
297 
298 /*
299  * dbdisply - debug display commands
300  */
301 void
303  ACPI_PARSE_OBJECT *Op);
304 
305 void
307  char *Target,
308  char *OutputType);
309 
311 void
312 AcpiDbDisplayResultObject (
313  ACPI_OPERAND_OBJECT *ObjDesc,
314  ACPI_WALK_STATE *WalkState))
315 
317 AcpiDbDisplayAllMethods (
318  char *DisplayCountArg);
319 
320 void
322  void);
323 
324 void
326  void);
327 
328 void
330  void);
331 
332 void
334  void);
335 
336 void
338  char *ObjectArg);
339 
341 void
342 AcpiDbDisplayArgumentObject (
343  ACPI_OPERAND_OBJECT *ObjDesc,
344  ACPI_WALK_STATE *WalkState))
345 
346 
347 /*
348  * dbexec - debugger control method execution
349  */
350 void
351 AcpiDbExecute (
352  char *Name,
353  char **Args,
355  UINT32 Flags);
356 
357 void
359  char *MethodNameArg,
360  char **Arguments,
362 
363 void
365  char *NumThreadsArg,
366  char *NumLoopsArg,
367  char *MethodNameArg);
368 
369 void
371  UINT32 Count,
372  ACPI_OBJECT *Objects);
373 
374 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
375 UINT32
376 AcpiDbGetCacheInfo (
378 #endif
379 
380 
381 /*
382  * dbfileio - Debugger file I/O commands
383  */
386  char *UserArgument,
387  ACPI_DB_ARGUMENT_INFO *Arguments);
388 
389 void
391  void);
392 
393 void
395  char *Name);
396 
399  char *Filename);
400 
403  ACPI_NEW_TABLE_DESC *ListHead);
404 
405 
406 /*
407  * dbhistry - debugger HISTORY command
408  */
409 void
411  char *CommandLine);
412 
413 void
415  void);
416 
417 char *
419  char *CommandNumArg);
420 
421 char *
423  UINT32 CommanddNum);
424 
425 
426 /*
427  * dbinput - user front-end to the AML debugger
428  */
431  char *InputBuffer,
432  ACPI_WALK_STATE *WalkState,
433  ACPI_PARSE_OBJECT *Op);
434 
437  void *Context);
438 
441  void);
442 
443 char *
445  char *String,
446  char **Next,
447  ACPI_OBJECT_TYPE *ReturnType);
448 
449 
450 /*
451  * dbobject
452  */
453 void
455  ACPI_OPERAND_OBJECT *ObjDesc);
456 
457 void
459  ACPI_OPERAND_OBJECT *ObjDesc,
460  ACPI_WALK_STATE *WalkState);
461 
462 void
464  ACPI_WALK_STATE *WalkState);
465 
466 void
468  ACPI_WALK_STATE *WalkState);
469 
470 void
473  ACPI_WALK_STATE *WalkState);
474 
475 
476 /*
477  * dbstats - Generation and display of ACPI table statistics
478  */
479 void
482  BOOLEAN IsMethod);
483 
486  char *TypeArg);
487 
488 
489 /*
490  * dbutils - AML debugger utilities
491  */
492 void
494  UINT32 Where);
495 
496 void
498  ACPI_OBJECT *ObjDesc,
499  UINT32 Level);
500 
501 void
503  char *Name);
504 
507  char *Name);
508 
509 void
511  UINT32 Value,
512  char *Buffer);
513 
514 #endif /* __ACDEBUG_H__ */
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 AcpiDbEvaluateAll(char *NameSeg)
void AcpiDbSetScope(char *Name)
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)
char ACPI_OBJECT_TYPE * Types
Definition: acdebug.h:353
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)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
void AcpiDbDisplayObjectType(char *ObjectArg)
UINT32 ACPI_STATUS
Definition: actypes.h:460
const char * Name
Definition: acdebug.h:59
void AcpiDbDeleteObjects(UINT32 Count, ACPI_OBJECT *Objects)
IN PVCB IN PBCB OUT PDIRENT IN USHORT IN POEM_STRING Filename
Definition: fatprocs.h:934
void AcpiDbEvaluatePredefinedNames(void)
void AcpiDbCheckPredefinedNames(void)
char NameSeg[ACPI_NAMESEG_SIZE+1]
Definition: acdebug.h:82
char * AcpiDbGetFromHistory(char *CommandNumArg)
void AcpiDbTrace(char *EnableArg, char *MethodArg, char *OnceArg)
struct acpi_db_execute_walk ACPI_DB_EXECUTE_WALK
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
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:677
char ** Args
Definition: acdebug.h:353
Definition: bufpool.h:45
void AcpiDbCreateExecutionThreads(char *NumThreadsArg, char *NumLoopsArg, char *MethodNameArg)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
Status
Definition: gdiplustypes.h:24
root entry for file system trees
Definition: entries.h:148
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:949
void AcpiDbDisplayTableInfo(char *TableArg)
int Count
Definition: noreturn.cpp:7
ACPI_STATUS AcpiDbDisplayFields(UINT32 AddressSpaceId)
void AcpiDbDumpPldBuffer(ACPI_OBJECT *ObjDesc)
ACPI_OBJECT_TYPE AcpiDbMatchArgument(char *UserArgument, ACPI_DB_ARGUMENT_INFO *Arguments)
void AcpiDbSendNotify(char *Name, UINT32 Value)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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:326
ACPI_STATUS AcpiDbDisassembleMethod(char *Name)
void AcpiDbUnloadAcpiTable(char *Name)
const char * Name
Definition: acdebug.h:74
void AcpiDbDisplayMethodInfo(ACPI_PARSE_OBJECT *Op)
Type
Definition: Type.h:6
void AcpiDbDumpMethodInfo(ACPI_STATUS Status, ACPI_WALK_STATE *WalkState)
void AcpiDbCheckIntegrity(void)
void AcpiDbPrepNamestring(char *Name)
ACPI_HW_DEPENDENT_RETURN_VOID(void AcpiDbDisplayGpes(void)) void AcpiDbDisplayHandlers(void)
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)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
void AcpiDbDisplayArguments(void)
void AcpiDbDisplayCallingTree(void)
ACPI_STATUS AcpiDbFindNameInNamespace(char *NameArg)
void AcpiDbDumpNamespaceByOwner(char *OwnerArg, char *DepthArg)
void AcpiDbDisplayLocks(void)
void AcpiDbDisplayLocals(void)
struct acpi_db_command_info ACPI_DB_COMMAND_INFO
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
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)
#define ACPI_NAMESEG_SIZE
Definition: actypes.h:415
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)