summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dbutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dbutils.c')
-rw-r--r--sys/contrib/dev/acpica/dbutils.c170
1 files changed, 90 insertions, 80 deletions
diff --git a/sys/contrib/dev/acpica/dbutils.c b/sys/contrib/dev/acpica/dbutils.c
index a27b846..173e50e 100644
--- a/sys/contrib/dev/acpica/dbutils.c
+++ b/sys/contrib/dev/acpica/dbutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dbutils - AML debugger utilities
- * $Revision: 68 $
+ * $Revision: 1.76 $
*
******************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -116,11 +116,8 @@
#include <contrib/dev/acpica/acpi.h>
-#include <contrib/dev/acpica/acparser.h>
-#include <contrib/dev/acpica/amlcode.h>
#include <contrib/dev/acpica/acnamesp.h>
#include <contrib/dev/acpica/acdebug.h>
-#include <contrib/dev/acpica/acdispat.h>
#include <contrib/dev/acpica/acdisasm.h>
@@ -129,6 +126,18 @@
#define _COMPONENT ACPI_CA_DEBUGGER
ACPI_MODULE_NAME ("dbutils")
+/* Local prototypes */
+
+#ifdef ACPI_OBSOLETE_FUNCTIONS
+ACPI_STATUS
+AcpiDbSecondPassParse (
+ ACPI_PARSE_OBJECT *Root);
+
+void
+AcpiDbDumpBuffer (
+ UINT32 Address);
+#endif
+
/*******************************************************************************
*
@@ -178,7 +187,7 @@ AcpiDbMatchArgument (
*
* RETURN: None
*
- * DESCRIPTION: Set the current destination for debugger output. Alos sets
+ * DESCRIPTION: Set the current destination for debugger output. Also sets
* the debug output level accordingly.
*
******************************************************************************/
@@ -203,32 +212,7 @@ AcpiDbSetOutputDestination (
/*******************************************************************************
*
- * FUNCTION: AcpiDbDumpBuffer
- *
- * PARAMETERS: Address - Pointer to the buffer
- *
- * RETURN: None
- *
- * DESCRIPTION: Print a portion of a buffer
- *
- ******************************************************************************/
-
-void
-AcpiDbDumpBuffer (
- UINT32 Address)
-{
-
- AcpiOsPrintf ("\nLocation %X:\n", Address);
-
- AcpiDbgLevel |= ACPI_LV_TABLES;
- AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
- ACPI_UINT32_MAX);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiDbDumpObject
+ * FUNCTION: AcpiDbDumpExternalObject
*
* PARAMETERS: ObjDesc - External ACPI object to dump
* Level - Nesting level.
@@ -240,7 +224,7 @@ AcpiDbDumpBuffer (
******************************************************************************/
void
-AcpiDbDumpObject (
+AcpiDbDumpExternalObject (
ACPI_OBJECT *ObjDesc,
UINT32 Level)
{
@@ -262,7 +246,7 @@ AcpiDbDumpObject (
{
case ACPI_TYPE_ANY:
- AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
+ AcpiOsPrintf ("[Object Reference] = %p", ObjDesc->Reference.Handle);
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
break;
@@ -302,19 +286,19 @@ AcpiDbDumpObject (
case ACPI_TYPE_PACKAGE:
- AcpiOsPrintf ("[Package] Contains %d Elements: \n",
+ AcpiOsPrintf ("[Package] Contains %d Elements:\n",
ObjDesc->Package.Count);
for (i = 0; i < ObjDesc->Package.Count; i++)
{
- AcpiDbDumpObject (&ObjDesc->Package.Elements[i], Level+1);
+ AcpiDbDumpExternalObject (&ObjDesc->Package.Elements[i], Level+1);
}
break;
case ACPI_TYPE_LOCAL_REFERENCE:
- AcpiOsPrintf ("[Object Reference] = ", ObjDesc->Reference.Handle);
+ AcpiOsPrintf ("[Object Reference] = %p", ObjDesc->Reference.Handle);
AcpiDmDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
break;
@@ -333,7 +317,7 @@ AcpiDbDumpObject (
default:
- AcpiOsPrintf ("[Unknown Type] %X \n", ObjDesc->Type);
+ AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Type);
break;
}
}
@@ -356,13 +340,12 @@ AcpiDbPrepNamestring (
char *Name)
{
-
if (!Name)
{
return;
}
- ACPI_STRUPR (Name);
+ AcpiUtStrupr (Name);
/* Convert a leading forward slash to a backslash */
@@ -395,6 +378,59 @@ AcpiDbPrepNamestring (
/*******************************************************************************
*
+ * FUNCTION: AcpiDbLocalNsLookup
+ *
+ * PARAMETERS: Name - Name to lookup
+ *
+ * RETURN: Pointer to a namespace node, null on failure
+ *
+ * DESCRIPTION: Lookup a name in the ACPI namespace
+ *
+ * Note: Currently begins search from the root. Could be enhanced to use
+ * the current prefix (scope) node as the search beginning point.
+ *
+ ******************************************************************************/
+
+ACPI_NAMESPACE_NODE *
+AcpiDbLocalNsLookup (
+ char *Name)
+{
+ char *InternalPath;
+ ACPI_STATUS Status;
+ ACPI_NAMESPACE_NODE *Node = NULL;
+
+
+ AcpiDbPrepNamestring (Name);
+
+ /* Build an internal namestring */
+
+ Status = AcpiNsInternalizeName (Name, &InternalPath);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Invalid namestring: %s\n", Name);
+ return (NULL);
+ }
+
+ /*
+ * Lookup the name.
+ * (Uses root node as the search starting point)
+ */
+ Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
+ ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
+ if (ACPI_FAILURE (Status))
+ {
+ AcpiOsPrintf ("Could not locate name: %s %s\n",
+ Name, AcpiFormatException (Status));
+ }
+
+ ACPI_MEM_FREE (InternalPath);
+ return (Node);
+}
+
+
+#ifdef ACPI_OBSOLETE_FUNCTIONS
+/*******************************************************************************
+ *
* FUNCTION: AcpiDbSecondPassParse
*
* PARAMETERS: Root - Root of the parse tree
@@ -443,7 +479,8 @@ AcpiDbSecondPassParse (
WalkState->ParserState.Aml =
WalkState->ParserState.AmlStart = Method->Named.Data;
WalkState->ParserState.AmlEnd =
- WalkState->ParserState.PkgEnd = Method->Named.Data + Method->Named.Length;
+ WalkState->ParserState.PkgEnd = Method->Named.Data +
+ Method->Named.Length;
WalkState->ParserState.StartScope = Op;
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
@@ -488,55 +525,28 @@ AcpiDbSecondPassParse (
/*******************************************************************************
*
- * FUNCTION: AcpiDbLocalNsLookup
- *
- * PARAMETERS: Name - Name to lookup
+ * FUNCTION: AcpiDbDumpBuffer
*
- * RETURN: Pointer to a namespace node
+ * PARAMETERS: Address - Pointer to the buffer
*
- * DESCRIPTION: Lookup a name in the ACPI namespace
+ * RETURN: None
*
- * Note: Currently begins search from the root. Could be enhanced to use
- * the current prefix (scope) node as the search beginning point.
+ * DESCRIPTION: Print a portion of a buffer
*
******************************************************************************/
-ACPI_NAMESPACE_NODE *
-AcpiDbLocalNsLookup (
- char *Name)
+void
+AcpiDbDumpBuffer (
+ UINT32 Address)
{
- char *InternalPath;
- ACPI_STATUS Status;
- ACPI_NAMESPACE_NODE *Node = NULL;
+ AcpiOsPrintf ("\nLocation %X:\n", Address);
- AcpiDbPrepNamestring (Name);
-
- /* Build an internal namestring */
-
- Status = AcpiNsInternalizeName (Name, &InternalPath);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Invalid namestring: %s\n", Name);
- return (NULL);
- }
-
- /*
- * Lookup the name.
- * (Uses root node as the search starting point)
- */
- Status = AcpiNsLookup (NULL, InternalPath, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
- ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not locate name: %s %s\n",
- Name, AcpiFormatException (Status));
- }
-
- ACPI_MEM_FREE (InternalPath);
- return (Node);
+ AcpiDbgLevel |= ACPI_LV_TABLES;
+ AcpiUtDumpBuffer (ACPI_TO_POINTER (Address), 64, DB_BYTE_DISPLAY,
+ ACPI_UINT32_MAX);
}
-
+#endif
#endif /* ACPI_DEBUGGER */
OpenPOWER on IntegriCloud