dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / arch / x86 / include / sys / acpi / acdebug.h
blob8f3f47175b139856a5d36e7202239a53295651ba
1 /******************************************************************************
3 * Name: acdebug.h - ACPI/AML debugger
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
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.
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.
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.
44 #ifndef __ACDEBUG_H__
45 #define __ACDEBUG_H__
47 /* The debugger is used in conjunction with the disassembler most of time */
49 #ifdef ACPI_DISASSEMBLER
50 #include "acdisasm.h"
51 #endif
54 #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
56 typedef struct acpi_db_command_info
58 const char *Name; /* Command Name */
59 UINT8 MinArgs; /* Minimum arguments required */
61 } ACPI_DB_COMMAND_INFO;
63 typedef struct acpi_db_command_help
65 UINT8 LineCount; /* Number of help lines */
66 char *Invocation; /* Command Invocation */
67 char *Description; /* Command Description */
69 } ACPI_DB_COMMAND_HELP;
71 typedef struct acpi_db_argument_info
73 const char *Name; /* Argument Name */
75 } ACPI_DB_ARGUMENT_INFO;
77 typedef struct acpi_db_execute_walk
79 UINT32 Count;
80 UINT32 MaxCount;
82 } ACPI_DB_EXECUTE_WALK;
85 #define PARAM_LIST(pl) pl
87 #define EX_NO_SINGLE_STEP 1
88 #define EX_SINGLE_STEP 2
92 * dbxface - external debugger interfaces
94 ACPI_DBR_DEPENDENT_RETURN_OK (
95 ACPI_STATUS
96 AcpiDbSingleStep (
97 ACPI_WALK_STATE *WalkState,
98 ACPI_PARSE_OBJECT *Op,
99 UINT32 OpType))
101 ACPI_DBR_DEPENDENT_RETURN_VOID (
102 void
103 AcpiDbSignalBreakPoint (
104 ACPI_WALK_STATE *WalkState))
108 * dbcmds - debug commands and output routines
110 ACPI_NAMESPACE_NODE *
111 AcpiDbConvertToNode (
112 char *InString);
114 void
115 AcpiDbDisplayTableInfo (
116 char *TableArg);
118 void
119 AcpiDbDisplayTemplate (
120 char *BufferArg);
122 void
123 AcpiDbUnloadAcpiTable (
124 char *Name);
126 void
127 AcpiDbSendNotify (
128 char *Name,
129 UINT32 Value);
131 void
132 AcpiDbDisplayInterfaces (
133 char *ActionArg,
134 char *InterfaceNameArg);
136 ACPI_STATUS
137 AcpiDbSleep (
138 char *ObjectArg);
140 void
141 AcpiDbTrace (
142 char *EnableArg,
143 char *MethodArg,
144 char *OnceArg);
146 void
147 AcpiDbDisplayLocks (
148 void);
150 void
151 AcpiDbDisplayResources (
152 char *ObjectArg);
154 ACPI_HW_DEPENDENT_RETURN_VOID (
155 void
156 AcpiDbDisplayGpes (
157 void))
159 void
160 AcpiDbDisplayHandlers (
161 void);
163 ACPI_HW_DEPENDENT_RETURN_VOID (
164 void
165 AcpiDbGenerateGpe (
166 char *GpeArg,
167 char *BlockArg))
169 ACPI_HW_DEPENDENT_RETURN_VOID (
170 void
171 AcpiDbGenerateSci (
172 void))
174 void
175 AcpiDbExecuteTest (
176 char *TypeArg);
180 * dbconvert - miscellaneous conversion routines
182 ACPI_STATUS
183 AcpiDbHexCharToValue (
184 int HexChar,
185 UINT8 *ReturnValue);
187 ACPI_STATUS
188 AcpiDbConvertToPackage (
189 char *String,
190 ACPI_OBJECT *Object);
192 ACPI_STATUS
193 AcpiDbConvertToObject (
194 ACPI_OBJECT_TYPE Type,
195 char *String,
196 ACPI_OBJECT *Object);
198 UINT8 *
199 AcpiDbEncodePldBuffer (
200 ACPI_PLD_INFO *PldInfo);
202 void
203 AcpiDbDumpPldBuffer (
204 ACPI_OBJECT *ObjDesc);
208 * dbmethod - control method commands
210 void
211 AcpiDbSetMethodBreakpoint (
212 char *Location,
213 ACPI_WALK_STATE *WalkState,
214 ACPI_PARSE_OBJECT *Op);
216 void
217 AcpiDbSetMethodCallBreakpoint (
218 ACPI_PARSE_OBJECT *Op);
220 void
221 AcpiDbSetMethodData (
222 char *TypeArg,
223 char *IndexArg,
224 char *ValueArg);
226 ACPI_STATUS
227 AcpiDbDisassembleMethod (
228 char *Name);
230 void
231 AcpiDbDisassembleAml (
232 char *Statements,
233 ACPI_PARSE_OBJECT *Op);
235 void
236 AcpiDbBatchExecute (
237 char *CountArg);
241 * dbnames - namespace commands
243 void
244 AcpiDbSetScope (
245 char *Name);
247 void
248 AcpiDbDumpNamespace (
249 char *StartArg,
250 char *DepthArg);
252 void
253 AcpiDbDumpNamespacePaths (
254 void);
256 void
257 AcpiDbDumpNamespaceByOwner (
258 char *OwnerArg,
259 char *DepthArg);
261 ACPI_STATUS
262 AcpiDbFindNameInNamespace (
263 char *NameArg);
265 void
266 AcpiDbCheckPredefinedNames (
267 void);
269 ACPI_STATUS
270 AcpiDbDisplayObjects (
271 char *ObjTypeArg,
272 char *DisplayCountArg);
274 void
275 AcpiDbCheckIntegrity (
276 void);
278 void
279 AcpiDbFindReferences (
280 char *ObjectArg);
282 void
283 AcpiDbGetBusInfo (
284 void);
288 * dbdisply - debug display commands
290 void
291 AcpiDbDisplayMethodInfo (
292 ACPI_PARSE_OBJECT *Op);
294 void
295 AcpiDbDecodeAndDisplayObject (
296 char *Target,
297 char *OutputType);
299 ACPI_DBR_DEPENDENT_RETURN_VOID (
300 void
301 AcpiDbDisplayResultObject (
302 ACPI_OPERAND_OBJECT *ObjDesc,
303 ACPI_WALK_STATE *WalkState))
305 ACPI_STATUS
306 AcpiDbDisplayAllMethods (
307 char *DisplayCountArg);
309 void
310 AcpiDbDisplayArguments (
311 void);
313 void
314 AcpiDbDisplayLocals (
315 void);
317 void
318 AcpiDbDisplayResults (
319 void);
321 void
322 AcpiDbDisplayCallingTree (
323 void);
325 void
326 AcpiDbDisplayObjectType (
327 char *ObjectArg);
329 ACPI_DBR_DEPENDENT_RETURN_VOID (
330 void
331 AcpiDbDisplayArgumentObject (
332 ACPI_OPERAND_OBJECT *ObjDesc,
333 ACPI_WALK_STATE *WalkState))
337 * dbexec - debugger control method execution
339 void
340 AcpiDbExecute (
341 char *Name,
342 char **Args,
343 ACPI_OBJECT_TYPE *Types,
344 UINT32 Flags);
346 void
347 AcpiDbCreateExecutionThreads (
348 char *NumThreadsArg,
349 char *NumLoopsArg,
350 char *MethodNameArg);
352 void
353 AcpiDbDeleteObjects (
354 UINT32 Count,
355 ACPI_OBJECT *Objects);
357 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
358 UINT32
359 AcpiDbGetCacheInfo (
360 ACPI_MEMORY_LIST *Cache);
361 #endif
365 * dbfileio - Debugger file I/O commands
367 ACPI_OBJECT_TYPE
368 AcpiDbMatchArgument (
369 char *UserArgument,
370 ACPI_DB_ARGUMENT_INFO *Arguments);
372 void
373 AcpiDbCloseDebugFile (
374 void);
376 void
377 AcpiDbOpenDebugFile (
378 char *Name);
380 ACPI_STATUS
381 AcpiDbLoadAcpiTable (
382 char *Filename);
384 ACPI_STATUS
385 AcpiDbLoadTables (
386 ACPI_NEW_TABLE_DESC *ListHead);
390 * dbhistry - debugger HISTORY command
392 void
393 AcpiDbAddToHistory (
394 char *CommandLine);
396 void
397 AcpiDbDisplayHistory (
398 void);
400 char *
401 AcpiDbGetFromHistory (
402 char *CommandNumArg);
404 char *
405 AcpiDbGetHistoryByIndex (
406 UINT32 CommanddNum);
410 * dbinput - user front-end to the AML debugger
412 ACPI_STATUS
413 AcpiDbCommandDispatch (
414 char *InputBuffer,
415 ACPI_WALK_STATE *WalkState,
416 ACPI_PARSE_OBJECT *Op);
418 void ACPI_SYSTEM_XFACE
419 AcpiDbExecuteThread (
420 void *Context);
422 ACPI_STATUS
423 AcpiDbUserCommands (
424 char Prompt,
425 ACPI_PARSE_OBJECT *Op);
427 char *
428 AcpiDbGetNextToken (
429 char *String,
430 char **Next,
431 ACPI_OBJECT_TYPE *ReturnType);
435 * dbobject
437 void
438 AcpiDbDecodeInternalObject (
439 ACPI_OPERAND_OBJECT *ObjDesc);
441 void
442 AcpiDbDisplayInternalObject (
443 ACPI_OPERAND_OBJECT *ObjDesc,
444 ACPI_WALK_STATE *WalkState);
446 void
447 AcpiDbDecodeArguments (
448 ACPI_WALK_STATE *WalkState);
450 void
451 AcpiDbDecodeLocals (
452 ACPI_WALK_STATE *WalkState);
454 void
455 AcpiDbDumpMethodInfo (
456 ACPI_STATUS Status,
457 ACPI_WALK_STATE *WalkState);
461 * dbstats - Generation and display of ACPI table statistics
463 void
464 AcpiDbGenerateStatistics (
465 ACPI_PARSE_OBJECT *Root,
466 BOOLEAN IsMethod);
468 ACPI_STATUS
469 AcpiDbDisplayStatistics (
470 char *TypeArg);
474 * dbutils - AML debugger utilities
476 void
477 AcpiDbSetOutputDestination (
478 UINT32 Where);
480 void
481 AcpiDbDumpExternalObject (
482 ACPI_OBJECT *ObjDesc,
483 UINT32 Level);
485 void
486 AcpiDbPrepNamestring (
487 char *Name);
489 ACPI_NAMESPACE_NODE *
490 AcpiDbLocalNsLookup (
491 char *Name);
493 void
494 AcpiDbUint32ToHexString (
495 UINT32 Value,
496 char *Buffer);
498 #endif /* __ACDEBUG_H__ */