freebsd-dev/sys/contrib/dev/acpica/include/acdebug.h

498 lines
10 KiB
C
Raw Normal View History

/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
*
*****************************************************************************/
2011-01-13 16:12:34 +00:00
/*
2016-01-11 22:10:31 +00:00
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
2011-01-13 16:12:34 +00:00
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACDEBUG_H__
#define __ACDEBUG_H__
2015-08-25 19:41:12 +00:00
/* The debugger is used in conjunction with the disassembler most of time */
#ifdef ACPI_DISASSEMBLER
2015-08-26 17:13:47 +00:00
#include <contrib/dev/acpica/include/acdisasm.h>
2015-08-25 19:41:12 +00:00
#endif
2010-12-09 20:04:14 +00:00
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
2012-09-14 22:53:11 +00:00
typedef struct acpi_db_command_info
{
2016-03-18 21:13:19 +00:00
const char *Name; /* Command Name */
UINT8 MinArgs; /* Minimum arguments required */
2012-09-14 22:53:11 +00:00
} ACPI_DB_COMMAND_INFO;
2012-09-14 22:53:11 +00:00
typedef struct acpi_db_command_help
{
UINT8 LineCount; /* Number of help lines */
char *Invocation; /* Command Invocation */
char *Description; /* Command Description */
} ACPI_DB_COMMAND_HELP;
typedef struct acpi_db_argument_info
{
2016-03-18 21:13:19 +00:00
const char *Name; /* Argument Name */
2012-09-14 22:53:11 +00:00
} ACPI_DB_ARGUMENT_INFO;
2012-09-14 22:53:11 +00:00
typedef struct acpi_db_execute_walk
2009-10-13 21:27:35 +00:00
{
UINT32 Count;
UINT32 MaxCount;
2012-09-14 22:53:11 +00:00
} ACPI_DB_EXECUTE_WALK;
2009-10-13 21:27:35 +00:00
#define PARAM_LIST(pl) pl
#define EX_NO_SINGLE_STEP 1
#define EX_SINGLE_STEP 2
/*
* dbxface - external debugger interfaces
*/
2015-11-25 21:04:42 +00:00
ACPI_DBR_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiDbSingleStep (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
2015-11-25 21:04:42 +00:00
UINT32 OpType))
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbSignalBreakPoint (
ACPI_WALK_STATE *WalkState))
/*
* dbcmds - debug commands and output routines
*/
2011-02-11 22:56:14 +00:00
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString);
void
AcpiDbDisplayTableInfo (
char *TableArg);
2011-11-23 18:05:37 +00:00
void
AcpiDbDisplayTemplate (
char *BufferArg);
void
AcpiDbUnloadAcpiTable (
2012-07-11 16:51:47 +00:00
char *Name);
void
2011-02-11 22:56:14 +00:00
AcpiDbSendNotify (
char *Name,
UINT32 Value);
void
2011-02-11 22:56:14 +00:00
AcpiDbDisplayInterfaces (
char *ActionArg,
char *InterfaceNameArg);
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg);
2015-07-20 22:31:50 +00:00
void
AcpiDbTrace (
char *EnableArg,
char *MethodArg,
char *OnceArg);
void
2011-02-11 22:56:14 +00:00
AcpiDbDisplayLocks (
void);
void
2011-02-11 22:56:14 +00:00
AcpiDbDisplayResources (
char *ObjectArg);
2012-02-16 00:24:10 +00:00
ACPI_HW_DEPENDENT_RETURN_VOID (
void
2011-02-11 22:56:14 +00:00
AcpiDbDisplayGpes (
2012-02-16 00:24:10 +00:00
void))
void
2011-02-11 22:56:14 +00:00
AcpiDbDisplayHandlers (
void);
2012-02-16 00:24:10 +00:00
ACPI_HW_DEPENDENT_RETURN_VOID (
void
2011-02-11 22:56:14 +00:00
AcpiDbGenerateGpe (
char *GpeArg,
2012-02-16 00:24:10 +00:00
char *BlockArg))
2011-02-11 22:56:14 +00:00
2013-08-23 18:01:58 +00:00
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbGenerateSci (
void))
2011-02-11 22:56:14 +00:00
2014-01-15 00:10:20 +00:00
void
AcpiDbExecuteTest (
char *TypeArg);
2013-01-02 19:01:21 +00:00
/*
* dbconvert - miscellaneous conversion routines
*/
ACPI_STATUS
AcpiDbHexCharToValue (
int HexChar,
UINT8 *ReturnValue);
ACPI_STATUS
AcpiDbConvertToPackage (
char *String,
ACPI_OBJECT *Object);
ACPI_STATUS
AcpiDbConvertToObject (
ACPI_OBJECT_TYPE Type,
char *String,
ACPI_OBJECT *Object);
UINT8 *
AcpiDbEncodePldBuffer (
ACPI_PLD_INFO *PldInfo);
void
AcpiDbDumpPldBuffer (
ACPI_OBJECT *ObjDesc);
2011-02-11 22:56:14 +00:00
/*
* dbmethod - control method commands
*/
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
void
AcpiDbSetMethodCallBreakpoint (
ACPI_PARSE_OBJECT *Op);
void
AcpiDbSetMethodData (
char *TypeArg,
char *IndexArg,
char *ValueArg);
ACPI_STATUS
2011-02-11 22:56:14 +00:00
AcpiDbDisassembleMethod (
char *Name);
2010-08-06 17:28:40 +00:00
void
2011-02-11 22:56:14 +00:00
AcpiDbDisassembleAml (
char *Statements,
ACPI_PARSE_OBJECT *Op);
void
2016-08-31 21:40:51 +00:00
AcpiDbEvaluatePredefinedNames (
void);
2010-08-06 17:28:40 +00:00
2011-02-11 22:56:14 +00:00
/*
* dbnames - namespace commands
*/
void
AcpiDbSetScope (
char *Name);
void
2011-02-11 22:56:14 +00:00
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg);
2013-08-23 18:01:58 +00:00
void
AcpiDbDumpNamespacePaths (
void);
void
2011-02-11 22:56:14 +00:00
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg);
2011-02-11 22:56:14 +00:00
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg);
void
2011-02-11 22:56:14 +00:00
AcpiDbCheckPredefinedNames (
void);
2011-02-11 22:56:14 +00:00
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg);
void
AcpiDbCheckIntegrity (
void);
void
2011-02-11 22:56:14 +00:00
AcpiDbFindReferences (
char *ObjectArg);
void
2011-02-11 22:56:14 +00:00
AcpiDbGetBusInfo (
void);
/*
* dbdisply - debug display commands
*/
void
AcpiDbDisplayMethodInfo (
ACPI_PARSE_OBJECT *Op);
void
AcpiDbDecodeAndDisplayObject (
char *Target,
char *OutputType);
2015-11-25 21:04:42 +00:00
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayResultObject (
ACPI_OPERAND_OBJECT *ObjDesc,
2015-11-25 21:04:42 +00:00
ACPI_WALK_STATE *WalkState))
ACPI_STATUS
AcpiDbDisplayAllMethods (
char *DisplayCountArg);
void
AcpiDbDisplayArguments (
void);
void
AcpiDbDisplayLocals (
void);
void
AcpiDbDisplayResults (
void);
void
AcpiDbDisplayCallingTree (
void);
2003-07-13 22:44:13 +00:00
void
AcpiDbDisplayObjectType (
char *ObjectArg);
2015-11-25 21:04:42 +00:00
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayArgumentObject (
ACPI_OPERAND_OBJECT *ObjDesc,
2015-11-25 21:04:42 +00:00
ACPI_WALK_STATE *WalkState))
/*
* dbexec - debugger control method execution
*/
void
AcpiDbExecute (
char *Name,
char **Args,
2011-05-31 17:33:30 +00:00
ACPI_OBJECT_TYPE *Types,
UINT32 Flags);
void
AcpiDbCreateExecutionThreads (
char *NumThreadsArg,
char *NumLoopsArg,
char *MethodNameArg);
2013-01-02 19:01:21 +00:00
void
AcpiDbDeleteObjects (
UINT32 Count,
ACPI_OBJECT *Objects);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
UINT32
AcpiDbGetCacheInfo (
ACPI_MEMORY_LIST *Cache);
#endif
/*
* dbfileio - Debugger file I/O commands
*/
ACPI_OBJECT_TYPE
AcpiDbMatchArgument (
char *UserArgument,
2012-09-14 22:53:11 +00:00
ACPI_DB_ARGUMENT_INFO *Arguments);
void
AcpiDbCloseDebugFile (
void);
void
AcpiDbOpenDebugFile (
char *Name);
ACPI_STATUS
AcpiDbLoadAcpiTable (
char *Filename);
ACPI_STATUS
2015-11-25 21:04:42 +00:00
AcpiDbLoadTables (
ACPI_NEW_TABLE_DESC *ListHead);
/*
* dbhistry - debugger HISTORY command
*/
void
AcpiDbAddToHistory (
char *CommandLine);
void
AcpiDbDisplayHistory (
void);
char *
AcpiDbGetFromHistory (
char *CommandNumArg);
2013-10-17 00:06:42 +00:00
char *
AcpiDbGetHistoryByIndex (
UINT32 CommanddNum);
/*
* dbinput - user front-end to the AML debugger
*/
ACPI_STATUS
AcpiDbCommandDispatch (
char *InputBuffer,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
void ACPI_SYSTEM_XFACE
AcpiDbExecuteThread (
void *Context);
ACPI_STATUS
AcpiDbUserCommands (
2016-12-23 04:35:14 +00:00
void);
2011-05-31 17:33:30 +00:00
char *
AcpiDbGetNextToken (
char *String,
char **Next,
ACPI_OBJECT_TYPE *ReturnType);
2015-07-20 22:31:50 +00:00
/*
* dbobject
*/
void
AcpiDbDecodeInternalObject (
ACPI_OPERAND_OBJECT *ObjDesc);
void
AcpiDbDisplayInternalObject (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState);
void
AcpiDbDecodeArguments (
ACPI_WALK_STATE *WalkState);
void
AcpiDbDecodeLocals (
ACPI_WALK_STATE *WalkState);
void
AcpiDbDumpMethodInfo (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState);
/*
* dbstats - Generation and display of ACPI table statistics
*/
void
AcpiDbGenerateStatistics (
ACPI_PARSE_OBJECT *Root,
BOOLEAN IsMethod);
ACPI_STATUS
AcpiDbDisplayStatistics (
char *TypeArg);
/*
* dbutils - AML debugger utilities
*/
void
AcpiDbSetOutputDestination (
UINT32 Where);
void
AcpiDbDumpExternalObject (
ACPI_OBJECT *ObjDesc,
UINT32 Level);
void
AcpiDbPrepNamestring (
char *Name);
ACPI_NAMESPACE_NODE *
AcpiDbLocalNsLookup (
char *Name);
void
2012-06-20 17:51:04 +00:00
AcpiDbUint32ToHexString (
UINT32 Value,
char *Buffer);
#endif /* __ACDEBUG_H__ */