acdebug.h revision 7851:e828bbb1689c
1279377Simp/****************************************************************************** 2279377Simp * 3279377Simp * Name: acdebug.h - ACPI/AML debugger 4279377Simp * $Revision: 1.85 $ 5279377Simp * 6279377Simp *****************************************************************************/ 7279377Simp 8279377Simp/****************************************************************************** 9279377Simp * 10279377Simp * 1. Copyright Notice 11279377Simp * 12279377Simp * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. 13279377Simp * All rights reserved. 14279377Simp * 15279377Simp * 2. License 16279377Simp * 17279377Simp * 2.1. This is your license from Intel Corp. under its intellectual property 18279377Simp * rights. You may have additional license terms from the party that provided 19279377Simp * you this software, covering your right to use that party's intellectual 20279377Simp * property rights. 21279377Simp * 22279377Simp * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23279377Simp * copy of the source code appearing in this file ("Covered Code") an 24279377Simp * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25279377Simp * base code distributed originally by Intel ("Original Intel Code") to copy, 26279377Simp * make derivatives, distribute, use and display any portion of the Covered 27279377Simp * Code in any form, with the right to sublicense such rights; and 28279377Simp * 29279377Simp * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30279377Simp * license (with the right to sublicense), under only those claims of Intel 31279377Simp * patents that are infringed by the Original Intel Code, to make, use, sell, 32279377Simp * offer to sell, and import the Covered Code and derivative works thereof 33279377Simp * solely to the minimum extent necessary to exercise the above copyright 34279377Simp * license, and in no event shall the patent license extend to any additions 35279377Simp * to or modifications of the Original Intel Code. No other license or right 36279377Simp * is granted directly or by implication, estoppel or otherwise; 37279377Simp * 38279377Simp * The above copyright and patent license is granted only if the following 39279377Simp * conditions are met: 40279377Simp * 41279377Simp * 3. Conditions 42279377Simp * 43279377Simp * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44279377Simp * Redistribution of source code of any substantial portion of the Covered 45279377Simp * Code or modification with rights to further distribute source must include 46279377Simp * the above Copyright Notice, the above License, this list of Conditions, 47279377Simp * and the following Disclaimer and Export Compliance provision. In addition, 48279377Simp * Licensee must cause all Covered Code to which Licensee contributes to 49279377Simp * contain a file documenting the changes Licensee made to create that Covered 50279377Simp * Code and the date of any change. Licensee must include in that file the 51279377Simp * documentation of any changes made by any predecessor Licensee. Licensee 52279377Simp * must include a prominent statement that the modification is derived, 53279377Simp * directly or indirectly, from Original Intel Code. 54279377Simp * 55279377Simp * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56279377Simp * Redistribution of source code of any substantial portion of the Covered 57279377Simp * Code or modification without rights to further distribute source must 58279377Simp * include the following Disclaimer and Export Compliance provision in the 59279377Simp * documentation and/or other materials provided with distribution. In 60279377Simp * addition, Licensee may not authorize further sublicense of source of any 61279377Simp * portion of the Covered Code, and must include terms to the effect that the 62279377Simp * license from Licensee to its licensee is limited to the intellectual 63279377Simp * property embodied in the software Licensee provides to its licensee, and 64279377Simp * not to intellectual property embodied in modifications its licensee may 65279377Simp * make. 66279377Simp * 67279377Simp * 3.3. Redistribution of Executable. Redistribution in executable form of any 68279377Simp * substantial portion of the Covered Code or modification must reproduce the 69279377Simp * above Copyright Notice, and the following Disclaimer and Export Compliance 70279377Simp * provision in the documentation and/or other materials provided with the 71279377Simp * distribution. 72279377Simp * 73279377Simp * 3.4. Intel retains all right, title, and interest in and to the Original 74279377Simp * Intel Code. 75279377Simp * 76279377Simp * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77279377Simp * Intel shall be used in advertising or otherwise to promote the sale, use or 78279377Simp * other dealings in products derived from or relating to the Covered Code 79279377Simp * without prior written authorization from Intel. 80279377Simp * 81279377Simp * 4. Disclaimer and Export Compliance 82279377Simp * 83279377Simp * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84279377Simp * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85279377Simp * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86279377Simp * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87279377Simp * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88279377Simp * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89279377Simp * PARTICULAR PURPOSE. 90279377Simp * 91279377Simp * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92279377Simp * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93279377Simp * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94279377Simp * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95279377Simp * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96279377Simp * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97279377Simp * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98279377Simp * LIMITED REMEDY. 99279377Simp * 100279377Simp * 4.3. Licensee shall not export, either directly or indirectly, any of this 101279377Simp * software or system incorporating such software without first obtaining any 102279377Simp * required license or other approval from the U. S. Department of Commerce or 103279377Simp * any other agency or department of the United States Government. In the 104279377Simp * event Licensee exports any such software from the United States or 105279377Simp * re-exports any such software from a foreign destination, Licensee shall 106279377Simp * ensure that the distribution and export/re-export of the software is in 107279377Simp * compliance with all laws, regulations, orders, or other restrictions of the 108279377Simp * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109279377Simp * any of its subsidiaries will export/re-export any technical data, process, 110279377Simp * software, or service, directly or indirectly, to any country for which the 111279377Simp * United States government or any agency thereof requires an export license, 112279377Simp * other governmental approval, or letter of assurance, without first obtaining 113279377Simp * such license, approval or letter. 114279377Simp * 115279377Simp *****************************************************************************/ 116279377Simp 117279377Simp#ifndef __ACDEBUG_H__ 118279377Simp#define __ACDEBUG_H__ 119279377Simp 120279377Simp 121279377Simp#define ACPI_DEBUG_BUFFER_SIZE 4196 122279377Simp 123279377Simptypedef struct CommandInfo 124279377Simp{ 125279377Simp char *Name; /* Command Name */ 126279377Simp UINT8 MinArgs; /* Minimum arguments required */ 127279377Simp 128279377Simp} COMMAND_INFO; 129279377Simp 130279377Simp 131279377Simptypedef struct ArgumentInfo 132279377Simp{ 133279377Simp char *Name; /* Argument Name */ 134279377Simp 135279377Simp} ARGUMENT_INFO; 136279377Simp 137279377Simp 138279377Simp#define PARAM_LIST(pl) pl 139279377Simp#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_verbose) 140279377Simp#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ 141279377Simp AcpiOsPrintf PARAM_LIST(fp);} 142279377Simp 143279377Simp#define EX_NO_SINGLE_STEP 1 144279377Simp#define EX_SINGLE_STEP 2 145279377Simp 146279377Simp 147279377Simp/* 148279377Simp * dbxface - external debugger interfaces 149279377Simp */ 150279377SimpACPI_STATUS 151279377SimpAcpiDbInitialize ( 152279377Simp void); 153279377Simp 154279377Simpvoid 155279377SimpAcpiDbTerminate ( 156279377Simp void); 157279377Simp 158279377SimpACPI_STATUS 159279377SimpAcpiDbSingleStep ( 160279377Simp ACPI_WALK_STATE *WalkState, 161279377Simp ACPI_PARSE_OBJECT *Op, 162279377Simp UINT32 OpType); 163279377Simp 164279377Simp 165279377Simp/* 166279377Simp * dbcmds - debug commands and output routines 167279377Simp */ 168279377SimpACPI_STATUS 169279377SimpAcpiDbDisassembleMethod ( 170279377Simp char *Name); 171279377Simp 172279377Simpvoid 173279377SimpAcpiDbDisplayTableInfo ( 174279377Simp char *TableArg); 175279377Simp 176279377Simpvoid 177279377SimpAcpiDbUnloadAcpiTable ( 178279377Simp char *TableArg, 179279377Simp char *InstanceArg); 180279377Simp 181279377Simpvoid 182279377SimpAcpiDbSetMethodBreakpoint ( 183279377Simp char *Location, 184279377Simp ACPI_WALK_STATE *WalkState, 185279377Simp ACPI_PARSE_OBJECT *Op); 186279377Simp 187279377Simpvoid 188279377SimpAcpiDbSetMethodCallBreakpoint ( 189279377Simp ACPI_PARSE_OBJECT *Op); 190279377Simp 191279377Simpvoid 192279377SimpAcpiDbGetBusInfo ( 193279377Simp void); 194279377Simp 195279377Simpvoid 196279377SimpAcpiDbDisassembleAml ( 197279377Simp char *Statements, 198279377Simp ACPI_PARSE_OBJECT *Op); 199279377Simp 200279377Simpvoid 201279377SimpAcpiDbDumpNamespace ( 202279377Simp char *StartArg, 203279377Simp char *DepthArg); 204279377Simp 205279377Simpvoid 206279377SimpAcpiDbDumpNamespaceByOwner ( 207279377Simp char *OwnerArg, 208279377Simp char *DepthArg); 209279377Simp 210279377Simpvoid 211279377SimpAcpiDbSendNotify ( 212279377Simp char *Name, 213279377Simp UINT32 Value); 214279377Simp 215279377Simpvoid 216279377SimpAcpiDbSetMethodData ( 217279377Simp char *TypeArg, 218279377Simp char *IndexArg, 219279377Simp char *ValueArg); 220279377Simp 221279377SimpACPI_STATUS 222279377SimpAcpiDbDisplayObjects ( 223279377Simp char *ObjTypeArg, 224279377Simp char *DisplayCountArg); 225279377Simp 226279377SimpACPI_STATUS 227279377SimpAcpiDbFindNameInNamespace ( 228279377Simp char *NameArg); 229279377Simp 230279377Simpvoid 231279377SimpAcpiDbSetScope ( 232279377Simp char *Name); 233279377Simp 234279377SimpACPI_STATUS 235279377SimpAcpiDbSleep ( 236279377Simp char *ObjectArg); 237279377Simp 238279377Simpvoid 239279377SimpAcpiDbFindReferences ( 240 char *ObjectArg); 241 242void 243AcpiDbDisplayLocks ( 244 void); 245 246void 247AcpiDbDisplayResources ( 248 char *ObjectArg); 249 250void 251AcpiDbDisplayGpes ( 252 void); 253 254void 255AcpiDbCheckIntegrity ( 256 void); 257 258void 259AcpiDbGenerateGpe ( 260 char *GpeArg, 261 char *BlockArg); 262 263void 264AcpiDbCheckPredefinedNames ( 265 void); 266 267void 268AcpiDbBatchExecute ( 269 void); 270 271/* 272 * dbdisply - debug display commands 273 */ 274void 275AcpiDbDisplayMethodInfo ( 276 ACPI_PARSE_OBJECT *Op); 277 278void 279AcpiDbDecodeAndDisplayObject ( 280 char *Target, 281 char *OutputType); 282 283void 284AcpiDbDisplayResultObject ( 285 ACPI_OPERAND_OBJECT *ObjDesc, 286 ACPI_WALK_STATE *WalkState); 287 288ACPI_STATUS 289AcpiDbDisplayAllMethods ( 290 char *DisplayCountArg); 291 292void 293AcpiDbDisplayArguments ( 294 void); 295 296void 297AcpiDbDisplayLocals ( 298 void); 299 300void 301AcpiDbDisplayResults ( 302 void); 303 304void 305AcpiDbDisplayCallingTree ( 306 void); 307 308void 309AcpiDbDisplayObjectType ( 310 char *ObjectArg); 311 312void 313AcpiDbDisplayArgumentObject ( 314 ACPI_OPERAND_OBJECT *ObjDesc, 315 ACPI_WALK_STATE *WalkState); 316 317 318/* 319 * dbexec - debugger control method execution 320 */ 321void 322AcpiDbExecute ( 323 char *Name, 324 char **Args, 325 UINT32 Flags); 326 327void 328AcpiDbCreateExecutionThreads ( 329 char *NumThreadsArg, 330 char *NumLoopsArg, 331 char *MethodNameArg); 332 333#ifdef ACPI_DBG_TRACK_ALLOCATIONS 334UINT32 335AcpiDbGetCacheInfo ( 336 ACPI_MEMORY_LIST *Cache); 337#endif 338 339 340/* 341 * dbfileio - Debugger file I/O commands 342 */ 343ACPI_OBJECT_TYPE 344AcpiDbMatchArgument ( 345 char *UserArgument, 346 ARGUMENT_INFO *Arguments); 347 348void 349AcpiDbCloseDebugFile ( 350 void); 351 352void 353AcpiDbOpenDebugFile ( 354 char *Name); 355 356ACPI_STATUS 357AcpiDbLoadAcpiTable ( 358 char *Filename); 359 360ACPI_STATUS 361AcpiDbGetTableFromFile ( 362 char *Filename, 363 ACPI_TABLE_HEADER **Table); 364 365ACPI_STATUS 366AcpiDbReadTableFromFile ( 367 char *Filename, 368 ACPI_TABLE_HEADER **Table); 369 370 371/* 372 * dbhistry - debugger HISTORY command 373 */ 374void 375AcpiDbAddToHistory ( 376 char *CommandLine); 377 378void 379AcpiDbDisplayHistory ( 380 void); 381 382char * 383AcpiDbGetFromHistory ( 384 char *CommandNumArg); 385 386 387/* 388 * dbinput - user front-end to the AML debugger 389 */ 390ACPI_STATUS 391AcpiDbCommandDispatch ( 392 char *InputBuffer, 393 ACPI_WALK_STATE *WalkState, 394 ACPI_PARSE_OBJECT *Op); 395 396void ACPI_SYSTEM_XFACE 397AcpiDbExecuteThread ( 398 void *Context); 399 400ACPI_STATUS 401AcpiDbUserCommands ( 402 char Prompt, 403 ACPI_PARSE_OBJECT *Op); 404 405 406/* 407 * dbstats - Generation and display of ACPI table statistics 408 */ 409void 410AcpiDbGenerateStatistics ( 411 ACPI_PARSE_OBJECT *Root, 412 BOOLEAN IsMethod); 413 414ACPI_STATUS 415AcpiDbDisplayStatistics ( 416 char *TypeArg); 417 418 419/* 420 * dbutils - AML debugger utilities 421 */ 422void 423AcpiDbSetOutputDestination ( 424 UINT32 Where); 425 426void 427AcpiDbDumpExternalObject ( 428 ACPI_OBJECT *ObjDesc, 429 UINT32 Level); 430 431void 432AcpiDbPrepNamestring ( 433 char *Name); 434 435ACPI_NAMESPACE_NODE * 436AcpiDbLocalNsLookup ( 437 char *Name); 438 439void 440AcpiDbUInt32ToHexString ( 441 UINT32 Value, 442 char *Buffer); 443 444#endif /* __ACDEBUG_H__ */ 445