73d02d1adac08422abb7f5aa4d0c46fdd5dc6595
[reactos.git] / drivers / bus / acpi / acpica / include / acdebug.h
1 /******************************************************************************
2 *
3 * Name: acdebug.h - ACPI/AML debugger
4 *
5 *****************************************************************************/
6
7 /*
8 * Copyright (C) 2000 - 2017, 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
56 typedef struct acpi_db_command_info
57 {
58 const char *Name; /* Command Name */
59 UINT8 MinArgs; /* Minimum arguments required */
60
61 } ACPI_DB_COMMAND_INFO;
62
63 typedef struct acpi_db_command_help
64 {
65 UINT8 LineCount; /* Number of help lines */
66 char *Invocation; /* Command Invocation */
67 char *Description; /* Command Description */
68
69 } ACPI_DB_COMMAND_HELP;
70
71 typedef struct acpi_db_argument_info
72 {
73 const char *Name; /* Argument Name */
74
75 } ACPI_DB_ARGUMENT_INFO;
76
77 typedef struct acpi_db_execute_walk
78 {
79 UINT32 Count;
80 UINT32 MaxCount;
81
82 } ACPI_DB_EXECUTE_WALK;
83
84
85 #define PARAM_LIST(pl) pl
86
87 #define EX_NO_SINGLE_STEP 1
88 #define EX_SINGLE_STEP 2
89
90
91 /*
92 * dbxface - external debugger interfaces
93 */
94 ACPI_DBR_DEPENDENT_RETURN_OK (
95 ACPI_STATUS
96 AcpiDbSingleStep (
97 ACPI_WALK_STATE *WalkState,
98 ACPI_PARSE_OBJECT *Op,
99 UINT32 OpType))
100
101 ACPI_DBR_DEPENDENT_RETURN_VOID (
102 void
103 AcpiDbSignalBreakPoint (
104 ACPI_WALK_STATE *WalkState))
105
106
107 /*
108 * dbcmds - debug commands and output routines
109 */
110 ACPI_NAMESPACE_NODE *
111 AcpiDbConvertToNode (
112 char *InString);
113
114 void
115 AcpiDbDisplayTableInfo (
116 char *TableArg);
117
118 void
119 AcpiDbDisplayTemplate (
120 char *BufferArg);
121
122 void
123 AcpiDbUnloadAcpiTable (
124 char *Name);
125
126 void
127 AcpiDbSendNotify (
128 char *Name,
129 UINT32 Value);
130
131 void
132 AcpiDbDisplayInterfaces (
133 char *ActionArg,
134 char *InterfaceNameArg);
135
136 ACPI_STATUS
137 AcpiDbSleep (
138 char *ObjectArg);
139
140 void
141 AcpiDbTrace (
142 char *EnableArg,
143 char *MethodArg,
144 char *OnceArg);
145
146 void
147 AcpiDbDisplayLocks (
148 void);
149
150 void
151 AcpiDbDisplayResources (
152 char *ObjectArg);
153
154 ACPI_HW_DEPENDENT_RETURN_VOID (
155 void
156 AcpiDbDisplayGpes (
157 void))
158
159 void
160 AcpiDbDisplayHandlers (
161 void);
162
163 ACPI_HW_DEPENDENT_RETURN_VOID (
164 void
165 AcpiDbGenerateGpe (
166 char *GpeArg,
167 char *BlockArg))
168
169 ACPI_HW_DEPENDENT_RETURN_VOID (
170 void
171 AcpiDbGenerateSci (
172 void))
173
174 void
175 AcpiDbExecuteTest (
176 char *TypeArg);
177
178
179 /*
180 * dbconvert - miscellaneous conversion routines
181 */
182 ACPI_STATUS
183 AcpiDbHexCharToValue (
184 int HexChar,
185 UINT8 *ReturnValue);
186
187 ACPI_STATUS
188 AcpiDbConvertToPackage (
189 char *String,
190 ACPI_OBJECT *Object);
191
192 ACPI_STATUS
193 AcpiDbConvertToObject (
194 ACPI_OBJECT_TYPE Type,
195 char *String,
196 ACPI_OBJECT *Object);
197
198 UINT8 *
199 AcpiDbEncodePldBuffer (
200 ACPI_PLD_INFO *PldInfo);
201
202 void
203 AcpiDbDumpPldBuffer (
204 ACPI_OBJECT *ObjDesc);
205
206
207 /*
208 * dbmethod - control method commands
209 */
210 void
211 AcpiDbSetMethodBreakpoint (
212 char *Location,
213 ACPI_WALK_STATE *WalkState,
214 ACPI_PARSE_OBJECT *Op);
215
216 void
217 AcpiDbSetMethodCallBreakpoint (
218 ACPI_PARSE_OBJECT *Op);
219
220 void
221 AcpiDbSetMethodData (
222 char *TypeArg,
223 char *IndexArg,
224 char *ValueArg);
225
226 ACPI_STATUS
227 AcpiDbDisassembleMethod (
228 char *Name);
229
230 void
231 AcpiDbDisassembleAml (
232 char *Statements,
233 ACPI_PARSE_OBJECT *Op);
234
235 void
236 AcpiDbEvaluatePredefinedNames (
237 void);
238
239
240 /*
241 * dbnames - namespace commands
242 */
243 void
244 AcpiDbSetScope (
245 char *Name);
246
247 void
248 AcpiDbDumpNamespace (
249 char *StartArg,
250 char *DepthArg);
251
252 void
253 AcpiDbDumpNamespacePaths (
254 void);
255
256 void
257 AcpiDbDumpNamespaceByOwner (
258 char *OwnerArg,
259 char *DepthArg);
260
261 ACPI_STATUS
262 AcpiDbFindNameInNamespace (
263 char *NameArg);
264
265 void
266 AcpiDbCheckPredefinedNames (
267 void);
268
269 ACPI_STATUS
270 AcpiDbDisplayObjects (
271 char *ObjTypeArg,
272 char *DisplayCountArg);
273
274 void
275 AcpiDbCheckIntegrity (
276 void);
277
278 void
279 AcpiDbFindReferences (
280 char *ObjectArg);
281
282 void
283 AcpiDbGetBusInfo (
284 void);
285
286
287 /*
288 * dbdisply - debug display commands
289 */
290 void
291 AcpiDbDisplayMethodInfo (
292 ACPI_PARSE_OBJECT *Op);
293
294 void
295 AcpiDbDecodeAndDisplayObject (
296 char *Target,
297 char *OutputType);
298
299 ACPI_DBR_DEPENDENT_RETURN_VOID (
300 void
301 AcpiDbDisplayResultObject (
302 ACPI_OPERAND_OBJECT *ObjDesc,
303 ACPI_WALK_STATE *WalkState))
304
305 ACPI_STATUS
306 AcpiDbDisplayAllMethods (
307 char *DisplayCountArg);
308
309 void
310 AcpiDbDisplayArguments (
311 void);
312
313 void
314 AcpiDbDisplayLocals (
315 void);
316
317 void
318 AcpiDbDisplayResults (
319 void);
320
321 void
322 AcpiDbDisplayCallingTree (
323 void);
324
325 void
326 AcpiDbDisplayObjectType (
327 char *ObjectArg);
328
329 ACPI_DBR_DEPENDENT_RETURN_VOID (
330 void
331 AcpiDbDisplayArgumentObject (
332 ACPI_OPERAND_OBJECT *ObjDesc,
333 ACPI_WALK_STATE *WalkState))
334
335
336 /*
337 * dbexec - debugger control method execution
338 */
339 void
340 AcpiDbExecute (
341 char *Name,
342 char **Args,
343 ACPI_OBJECT_TYPE *Types,
344 UINT32 Flags);
345
346 void
347 AcpiDbCreateExecutionThreads (
348 char *NumThreadsArg,
349 char *NumLoopsArg,
350 char *MethodNameArg);
351
352 void
353 AcpiDbDeleteObjects (
354 UINT32 Count,
355 ACPI_OBJECT *Objects);
356
357 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
358 UINT32
359 AcpiDbGetCacheInfo (
360 ACPI_MEMORY_LIST *Cache);
361 #endif
362
363
364 /*
365 * dbfileio - Debugger file I/O commands
366 */
367 ACPI_OBJECT_TYPE
368 AcpiDbMatchArgument (
369 char *UserArgument,
370 ACPI_DB_ARGUMENT_INFO *Arguments);
371
372 void
373 AcpiDbCloseDebugFile (
374 void);
375
376 void
377 AcpiDbOpenDebugFile (
378 char *Name);
379
380 ACPI_STATUS
381 AcpiDbLoadAcpiTable (
382 char *Filename);
383
384 ACPI_STATUS
385 AcpiDbLoadTables (
386 ACPI_NEW_TABLE_DESC *ListHead);
387
388
389 /*
390 * dbhistry - debugger HISTORY command
391 */
392 void
393 AcpiDbAddToHistory (
394 char *CommandLine);
395
396 void
397 AcpiDbDisplayHistory (
398 void);
399
400 char *
401 AcpiDbGetFromHistory (
402 char *CommandNumArg);
403
404 char *
405 AcpiDbGetHistoryByIndex (
406 UINT32 CommanddNum);
407
408
409 /*
410 * dbinput - user front-end to the AML debugger
411 */
412 ACPI_STATUS
413 AcpiDbCommandDispatch (
414 char *InputBuffer,
415 ACPI_WALK_STATE *WalkState,
416 ACPI_PARSE_OBJECT *Op);
417
418 void ACPI_SYSTEM_XFACE
419 AcpiDbExecuteThread (
420 void *Context);
421
422 ACPI_STATUS
423 AcpiDbUserCommands (
424 void);
425
426 char *
427 AcpiDbGetNextToken (
428 char *String,
429 char **Next,
430 ACPI_OBJECT_TYPE *ReturnType);
431
432
433 /*
434 * dbobject
435 */
436 void
437 AcpiDbDecodeInternalObject (
438 ACPI_OPERAND_OBJECT *ObjDesc);
439
440 void
441 AcpiDbDisplayInternalObject (
442 ACPI_OPERAND_OBJECT *ObjDesc,
443 ACPI_WALK_STATE *WalkState);
444
445 void
446 AcpiDbDecodeArguments (
447 ACPI_WALK_STATE *WalkState);
448
449 void
450 AcpiDbDecodeLocals (
451 ACPI_WALK_STATE *WalkState);
452
453 void
454 AcpiDbDumpMethodInfo (
455 ACPI_STATUS Status,
456 ACPI_WALK_STATE *WalkState);
457
458
459 /*
460 * dbstats - Generation and display of ACPI table statistics
461 */
462 void
463 AcpiDbGenerateStatistics (
464 ACPI_PARSE_OBJECT *Root,
465 BOOLEAN IsMethod);
466
467 ACPI_STATUS
468 AcpiDbDisplayStatistics (
469 char *TypeArg);
470
471
472 /*
473 * dbutils - AML debugger utilities
474 */
475 void
476 AcpiDbSetOutputDestination (
477 UINT32 Where);
478
479 void
480 AcpiDbDumpExternalObject (
481 ACPI_OBJECT *ObjDesc,
482 UINT32 Level);
483
484 void
485 AcpiDbPrepNamestring (
486 char *Name);
487
488 ACPI_NAMESPACE_NODE *
489 AcpiDbLocalNsLookup (
490 char *Name);
491
492 void
493 AcpiDbUint32ToHexString (
494 UINT32 Value,
495 char *Buffer);
496
497 #endif /* __ACDEBUG_H__ */