summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/utmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/utmisc.c')
-rw-r--r--sys/contrib/dev/acpica/utmisc.c96
1 files changed, 57 insertions, 39 deletions
diff --git a/sys/contrib/dev/acpica/utmisc.c b/sys/contrib/dev/acpica/utmisc.c
index 4862b7d..91b2382 100644
--- a/sys/contrib/dev/acpica/utmisc.c
+++ b/sys/contrib/dev/acpica/utmisc.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: utmisc - common utility procedures
- * $Revision: 86 $
+ * $Revision: 93 $
*
******************************************************************************/
@@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -301,42 +301,70 @@ AcpiUtSetIntegerWidth (
* FUNCTION: AcpiUtDisplayInitPathname
*
* PARAMETERS: ObjHandle - Handle whose pathname will be displayed
- * Path - Additional path string to be appended
+ * Path - Additional path string to be appended.
+ * (NULL if no extra path)
*
* RETURN: ACPI_STATUS
*
- * DESCRIPTION: Display full pathnbame of an object, DEBUG ONLY
+ * DESCRIPTION: Display full pathname of an object, DEBUG ONLY
*
******************************************************************************/
void
AcpiUtDisplayInitPathname (
- ACPI_HANDLE ObjHandle,
+ UINT8 Type,
+ ACPI_NAMESPACE_NODE *ObjHandle,
char *Path)
{
ACPI_STATUS Status;
ACPI_BUFFER Buffer;
- ACPI_FUNCTION_NAME ("UtDisplayInitPathname");
+ ACPI_FUNCTION_ENTRY ();
- Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
+ /* Only print the path if the appropriate debug level is enabled */
+
+ if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
+ {
+ return;
+ }
+ /* Get the full pathname to the node */
+
+ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
- if (ACPI_SUCCESS (Status))
+ if (ACPI_FAILURE (Status))
{
- if (Path)
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s.%s\n", (char *) Buffer.Pointer, Path));
- }
- else
- {
- ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s\n", (char *) Buffer.Pointer));
- }
+ return;
+ }
+
+ /* Print what we're doing */
+
+ switch (Type)
+ {
+ case ACPI_TYPE_METHOD:
+ AcpiOsPrintf ("Executing ");
+ break;
+
+ default:
+ AcpiOsPrintf ("Initializing ");
+ break;
+ }
+
+ /* Print the object type and pathname */
- ACPI_MEM_FREE (Buffer.Pointer);
+ AcpiOsPrintf ("%-12s %s", AcpiUtGetTypeName (Type), (char *) Buffer.Pointer);
+
+ /* Extra path is used to append names like _STA, _INI, etc. */
+
+ if (Path)
+ {
+ AcpiOsPrintf (".%s", Path);
}
+ AcpiOsPrintf ("\n");
+
+ ACPI_MEM_FREE (Buffer.Pointer);
}
#endif
@@ -360,7 +388,7 @@ BOOLEAN
AcpiUtValidAcpiName (
UINT32 Name)
{
- NATIVE_CHAR *NamePtr = (NATIVE_CHAR *) &Name;
+ char *NamePtr = (char *) &Name;
UINT32 i;
@@ -395,7 +423,7 @@ AcpiUtValidAcpiName (
BOOLEAN
AcpiUtValidAcpiCharacter (
- NATIVE_CHAR Character)
+ char Character)
{
ACPI_FUNCTION_ENTRY ();
@@ -424,7 +452,7 @@ AcpiUtValidAcpiCharacter (
ACPI_STATUS
AcpiUtStrtoul64 (
- NATIVE_CHAR *String,
+ char *String,
UINT32 Base,
ACPI_INTEGER *RetInteger)
{
@@ -581,11 +609,11 @@ ErrorExit:
*
******************************************************************************/
-NATIVE_CHAR *
+char *
AcpiUtStrupr (
- NATIVE_CHAR *SrcString)
+ char *SrcString)
{
- NATIVE_CHAR *String;
+ char *String;
ACPI_FUNCTION_ENTRY ();
@@ -599,7 +627,6 @@ AcpiUtStrupr (
String++;
}
-
return (SrcString);
}
@@ -703,7 +730,6 @@ AcpiUtCreateMutex (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
-
if (!AcpiGbl_AcpiMutexInfo[MutexId].Mutex)
{
Status = AcpiOsCreateSemaphore (1, 1,
@@ -743,7 +769,6 @@ AcpiUtDeleteMutex (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
-
Status = AcpiOsDeleteSemaphore (AcpiGbl_AcpiMutexInfo[MutexId].Mutex);
AcpiGbl_AcpiMutexInfo[MutexId].Mutex = NULL;
@@ -782,7 +807,6 @@ AcpiUtAcquireMutex (
return (AE_BAD_PARAMETER);
}
-
ThisThreadId = AcpiOsGetThreadId ();
/*
@@ -813,7 +837,6 @@ AcpiUtAcquireMutex (
}
}
-
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
"Thread %X attempting to acquire Mutex [%s]\n",
ThisThreadId, AcpiUtGetMutexName (MutexId)));
@@ -828,7 +851,6 @@ AcpiUtAcquireMutex (
AcpiGbl_AcpiMutexInfo[MutexId].UseCount++;
AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ThisThreadId;
}
-
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Thread %X could not acquire Mutex [%s] %s\n",
@@ -874,7 +896,6 @@ AcpiUtReleaseMutex (
return (AE_BAD_PARAMETER);
}
-
/*
* Mutex must be acquired in order to release it!
*/
@@ -887,7 +908,6 @@ AcpiUtReleaseMutex (
return (AE_NOT_ACQUIRED);
}
-
/*
* Deadlock prevention. Check if this thread owns any mutexes of value
* greater than this one. If so, the thread has violated the mutex
@@ -911,7 +931,6 @@ AcpiUtReleaseMutex (
}
}
-
/* Mark unlocked FIRST */
AcpiGbl_AcpiMutexInfo[MutexId].OwnerId = ACPI_MUTEX_NOT_ACQUIRED;
@@ -973,7 +992,6 @@ AcpiUtCreateUpdateStateAndPush (
return (AE_NO_MEMORY);
}
-
AcpiUtPushGenericState (StateList, State);
return (AE_OK);
}
@@ -1012,7 +1030,6 @@ AcpiUtCreatePkgStateAndPush (
return (AE_NO_MEMORY);
}
-
AcpiUtPushGenericState (StateList, State);
return (AE_OK);
}
@@ -1281,7 +1298,6 @@ AcpiUtCreateControlState (
return_PTR (NULL);
}
-
/* Init fields specific to the control struct */
State->Common.DataType = ACPI_DESC_TYPE_STATE_CONTROL;
@@ -1378,6 +1394,8 @@ AcpiUtWalkPackageTree (
while (State)
{
+ /* Get one element of the package */
+
ThisIndex = State->Pkg.Index;
ThisSourceObj = (ACPI_OPERAND_OBJECT *)
State->Pkg.SourceObject->Package.Elements[ThisIndex];
@@ -1485,6 +1503,7 @@ AcpiUtGenerateChecksum (
UINT32 i;
signed char Sum = 0;
+
for (i = 0; i < Length; i++)
{
Sum = (signed char) (Sum + Buffer[i]);
@@ -1568,7 +1587,7 @@ AcpiUtGetResourceEndTag (
void
AcpiUtReportError (
- NATIVE_CHAR *ModuleName,
+ char *ModuleName,
UINT32 LineNumber,
UINT32 ComponentId)
{
@@ -1595,7 +1614,7 @@ AcpiUtReportError (
void
AcpiUtReportWarning (
- NATIVE_CHAR *ModuleName,
+ char *ModuleName,
UINT32 LineNumber,
UINT32 ComponentId)
{
@@ -1621,7 +1640,7 @@ AcpiUtReportWarning (
void
AcpiUtReportInfo (
- NATIVE_CHAR *ModuleName,
+ char *ModuleName,
UINT32 LineNumber,
UINT32 ComponentId)
{
@@ -1630,4 +1649,3 @@ AcpiUtReportInfo (
}
-
OpenPOWER on IntegriCloud