summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/psutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/psutils.c')
-rw-r--r--sys/contrib/dev/acpica/psutils.c168
1 files changed, 87 insertions, 81 deletions
diff --git a/sys/contrib/dev/acpica/psutils.c b/sys/contrib/dev/acpica/psutils.c
index e49b9a1..e22ea74 100644
--- a/sys/contrib/dev/acpica/psutils.c
+++ b/sys/contrib/dev/acpica/psutils.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psutils - Parser miscellaneous utilities (Parser only)
- * $Revision: 32 $
+ * $Revision: 37 $
*
*****************************************************************************/
@@ -119,7 +119,7 @@
#include "acparser.h"
#include "amlcode.h"
-#define _COMPONENT PARSER
+#define _COMPONENT ACPI_PARSER
MODULE_NAME ("psutils")
@@ -185,6 +185,9 @@ AcpiPsAllocOp (
UINT8 Flags;
+ PROC_NAME ("PsAllocOp");
+
+
/* Allocate the minimum required size object */
if (AcpiPsIsDeferredOp (Opcode))
@@ -221,7 +224,7 @@ AcpiPsAllocOp (
* Check if there is an Op already available in the cache
*/
- AcpiCmAcquireMutex (ACPI_MTX_CACHES);
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
AcpiGbl_ParseCacheRequests++;
if (AcpiGbl_ParseCache)
{
@@ -235,17 +238,16 @@ AcpiPsAllocOp (
if (Op->DataType == 0xFF)
{
- DEBUG_PRINT (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
+ DEBUG_PRINTP (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
}
/* Clear the previously used Op */
MEMSET (Op, 0, sizeof (ACPI_PARSE_OBJECT));
- DEBUG_PRINT (TRACE_PARSE,
- ("PsAllocOp: Op %p from Parse Cache\n", Op));
+ DEBUG_PRINTP (TRACE_PARSE, ("Op %p from Parse Cache\n", Op));
}
- AcpiCmReleaseMutex (ACPI_MTX_CACHES);
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
}
else
@@ -257,7 +259,7 @@ AcpiPsAllocOp (
* Check if there is an Op already available in the cache
*/
- AcpiCmAcquireMutex (ACPI_MTX_CACHES);
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
AcpiGbl_ExtParseCacheRequests++;
if (AcpiGbl_ExtParseCache)
{
@@ -271,17 +273,16 @@ AcpiPsAllocOp (
if (Op->DataType == 0xFF)
{
- DEBUG_PRINT (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
+ DEBUG_PRINTP (ACPI_ERROR, ("Op %p deleted while in cache!\n", Op));
}
/* Clear the previously used Op */
MEMSET (Op, 0, sizeof (ACPI_PARSE2_OBJECT));
- DEBUG_PRINT (TRACE_PARSE,
- ("PsAllocOp: Op %p from ExtParse Cache\n", Op));
+ DEBUG_PRINTP (TRACE_PARSE, ("Op %p from ExtParse Cache\n", Op));
}
- AcpiCmReleaseMutex (ACPI_MTX_CACHES);
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
}
@@ -289,7 +290,7 @@ AcpiPsAllocOp (
if (!Op)
{
- Op = AcpiCmCallocate (Size);
+ Op = AcpiUtCallocate (Size);
}
/* Initialize the Op */
@@ -320,11 +321,12 @@ void
AcpiPsFreeOp (
ACPI_PARSE_OBJECT *Op)
{
+ PROC_NAME ("PsFreeOp");
- if (Op->Opcode == AML_RETURN_VALUE_OP)
+ if (Op->Opcode == AML_INT_RETURN_VALUE_OP)
{
- DEBUG_PRINT (ACPI_INFO, ("Free retval op: %p\n", Op));
+ DEBUG_PRINTP (ACPI_INFO, ("Free retval op: %p\n", Op));
}
if (Op->Flags == PARSEOP_GENERIC)
@@ -340,13 +342,13 @@ AcpiPsFreeOp (
MEMSET (Op, 0, sizeof (ACPI_PARSE_OBJECT));
Op->Flags = PARSEOP_IN_CACHE;
- AcpiCmAcquireMutex (ACPI_MTX_CACHES);
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
AcpiGbl_ParseCacheDepth++;
Op->Next = AcpiGbl_ParseCache;
AcpiGbl_ParseCache = Op;
- AcpiCmReleaseMutex (ACPI_MTX_CACHES);
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
return;
}
}
@@ -364,13 +366,13 @@ AcpiPsFreeOp (
MEMSET (Op, 0, sizeof (ACPI_PARSE2_OBJECT));
Op->Flags = PARSEOP_IN_CACHE;
- AcpiCmAcquireMutex (ACPI_MTX_CACHES);
+ AcpiUtAcquireMutex (ACPI_MTX_CACHES);
AcpiGbl_ExtParseCacheDepth++;
Op->Next = (ACPI_PARSE_OBJECT *) AcpiGbl_ExtParseCache;
AcpiGbl_ExtParseCache = (ACPI_PARSE2_OBJECT *) Op;
- AcpiCmReleaseMutex (ACPI_MTX_CACHES);
+ AcpiUtReleaseMutex (ACPI_MTX_CACHES);
return;
}
}
@@ -380,7 +382,7 @@ AcpiPsFreeOp (
* Not a GENERIC OP, or the cache is full, just free the Op
*/
- AcpiCmFree (Op);
+ AcpiUtFree (Op);
}
@@ -413,7 +415,7 @@ AcpiPsDeleteParseCache (
/* Delete one cached state object */
Next = AcpiGbl_ParseCache->Next;
- AcpiCmFree (AcpiGbl_ParseCache);
+ AcpiUtFree (AcpiGbl_ParseCache);
AcpiGbl_ParseCache = Next;
AcpiGbl_ParseCacheDepth--;
}
@@ -425,7 +427,7 @@ AcpiPsDeleteParseCache (
/* Delete one cached state object */
Next = AcpiGbl_ExtParseCache->Next;
- AcpiCmFree (AcpiGbl_ExtParseCache);
+ AcpiUtFree (AcpiGbl_ExtParseCache);
AcpiGbl_ExtParseCache = (ACPI_PARSE2_OBJECT *) Next;
AcpiGbl_ExtParseCacheDepth--;
}
@@ -476,28 +478,29 @@ AcpiPsIsNamespaceObjectOp (
UINT16 Opcode)
{
return ((BOOLEAN)
- (Opcode == AML_SCOPE_OP ||
- Opcode == AML_DEVICE_OP ||
- Opcode == AML_THERMAL_ZONE_OP ||
- Opcode == AML_METHOD_OP ||
- Opcode == AML_POWER_RES_OP ||
- Opcode == AML_PROCESSOR_OP ||
- Opcode == AML_DEF_FIELD_OP ||
- Opcode == AML_INDEX_FIELD_OP ||
- Opcode == AML_BANK_FIELD_OP ||
- Opcode == AML_NAMEDFIELD_OP ||
- Opcode == AML_NAME_OP ||
- Opcode == AML_ALIAS_OP ||
- Opcode == AML_MUTEX_OP ||
- Opcode == AML_EVENT_OP ||
- Opcode == AML_REGION_OP ||
- Opcode == AML_CREATE_FIELD_OP ||
- Opcode == AML_BIT_FIELD_OP ||
- Opcode == AML_BYTE_FIELD_OP ||
- Opcode == AML_WORD_FIELD_OP ||
- Opcode == AML_DWORD_FIELD_OP ||
- Opcode == AML_METHODCALL_OP ||
- Opcode == AML_NAMEPATH_OP));
+ (Opcode == AML_SCOPE_OP ||
+ Opcode == AML_DEVICE_OP ||
+ Opcode == AML_THERMAL_ZONE_OP ||
+ Opcode == AML_METHOD_OP ||
+ Opcode == AML_POWER_RES_OP ||
+ Opcode == AML_PROCESSOR_OP ||
+ Opcode == AML_FIELD_OP ||
+ Opcode == AML_INDEX_FIELD_OP ||
+ Opcode == AML_BANK_FIELD_OP ||
+ Opcode == AML_INT_NAMEDFIELD_OP ||
+ Opcode == AML_NAME_OP ||
+ Opcode == AML_ALIAS_OP ||
+ Opcode == AML_MUTEX_OP ||
+ Opcode == AML_EVENT_OP ||
+ Opcode == AML_REGION_OP ||
+ Opcode == AML_CREATE_FIELD_OP ||
+ Opcode == AML_CREATE_BIT_FIELD_OP ||
+ Opcode == AML_CREATE_BYTE_FIELD_OP ||
+ Opcode == AML_CREATE_WORD_FIELD_OP ||
+ Opcode == AML_CREATE_DWORD_FIELD_OP ||
+ Opcode == AML_CREATE_QWORD_FIELD_OP ||
+ Opcode == AML_INT_METHODCALL_OP ||
+ Opcode == AML_INT_NAMEPATH_OP));
}
BOOLEAN
@@ -511,7 +514,7 @@ AcpiPsIsNamespaceOp (
Opcode == AML_METHOD_OP ||
Opcode == AML_POWER_RES_OP ||
Opcode == AML_PROCESSOR_OP ||
- Opcode == AML_DEF_FIELD_OP ||
+ Opcode == AML_FIELD_OP ||
Opcode == AML_INDEX_FIELD_OP ||
Opcode == AML_BANK_FIELD_OP ||
Opcode == AML_NAME_OP ||
@@ -519,7 +522,7 @@ AcpiPsIsNamespaceOp (
Opcode == AML_MUTEX_OP ||
Opcode == AML_EVENT_OP ||
Opcode == AML_REGION_OP ||
- Opcode == AML_NAMEDFIELD_OP));
+ Opcode == AML_INT_NAMEDFIELD_OP));
}
@@ -534,27 +537,28 @@ AcpiPsIsNodeOp (
UINT16 Opcode)
{
return ((BOOLEAN)
- (Opcode == AML_SCOPE_OP ||
- Opcode == AML_DEVICE_OP ||
- Opcode == AML_THERMAL_ZONE_OP ||
- Opcode == AML_METHOD_OP ||
- Opcode == AML_POWER_RES_OP ||
- Opcode == AML_PROCESSOR_OP ||
- Opcode == AML_NAMEDFIELD_OP ||
- Opcode == AML_NAME_OP ||
- Opcode == AML_ALIAS_OP ||
- Opcode == AML_MUTEX_OP ||
- Opcode == AML_EVENT_OP ||
- Opcode == AML_REGION_OP ||
-
-
- Opcode == AML_CREATE_FIELD_OP ||
- Opcode == AML_BIT_FIELD_OP ||
- Opcode == AML_BYTE_FIELD_OP ||
- Opcode == AML_WORD_FIELD_OP ||
- Opcode == AML_DWORD_FIELD_OP ||
- Opcode == AML_METHODCALL_OP ||
- Opcode == AML_NAMEPATH_OP));
+ (Opcode == AML_SCOPE_OP ||
+ Opcode == AML_DEVICE_OP ||
+ Opcode == AML_THERMAL_ZONE_OP ||
+ Opcode == AML_METHOD_OP ||
+ Opcode == AML_POWER_RES_OP ||
+ Opcode == AML_PROCESSOR_OP ||
+ Opcode == AML_INT_NAMEDFIELD_OP ||
+ Opcode == AML_NAME_OP ||
+ Opcode == AML_ALIAS_OP ||
+ Opcode == AML_MUTEX_OP ||
+ Opcode == AML_EVENT_OP ||
+ Opcode == AML_REGION_OP ||
+
+
+ Opcode == AML_CREATE_FIELD_OP ||
+ Opcode == AML_CREATE_BIT_FIELD_OP ||
+ Opcode == AML_CREATE_BYTE_FIELD_OP ||
+ Opcode == AML_CREATE_WORD_FIELD_OP ||
+ Opcode == AML_CREATE_DWORD_FIELD_OP ||
+ Opcode == AML_CREATE_QWORD_FIELD_OP ||
+ Opcode == AML_INT_METHODCALL_OP ||
+ Opcode == AML_INT_NAMEPATH_OP));
}
@@ -577,7 +581,7 @@ AcpiPsIsNamedOp (
Opcode == AML_MUTEX_OP ||
Opcode == AML_EVENT_OP ||
Opcode == AML_REGION_OP ||
- Opcode == AML_NAMEDFIELD_OP));
+ Opcode == AML_INT_NAMEDFIELD_OP));
}
@@ -586,12 +590,13 @@ AcpiPsIsDeferredOp (
UINT16 Opcode)
{
return ((BOOLEAN)
- (Opcode == AML_METHOD_OP ||
- Opcode == AML_CREATE_FIELD_OP ||
- Opcode == AML_BIT_FIELD_OP ||
- Opcode == AML_BYTE_FIELD_OP ||
- Opcode == AML_WORD_FIELD_OP ||
- Opcode == AML_DWORD_FIELD_OP ||
+ (Opcode == AML_METHOD_OP ||
+ Opcode == AML_CREATE_FIELD_OP ||
+ Opcode == AML_CREATE_BIT_FIELD_OP ||
+ Opcode == AML_CREATE_BYTE_FIELD_OP ||
+ Opcode == AML_CREATE_WORD_FIELD_OP ||
+ Opcode == AML_CREATE_DWORD_FIELD_OP ||
+ Opcode == AML_CREATE_QWORD_FIELD_OP ||
Opcode == AML_REGION_OP));
}
@@ -603,7 +608,7 @@ BOOLEAN
AcpiPsIsBytelistOp (
UINT16 Opcode)
{
- return ((BOOLEAN) (Opcode == AML_BYTELIST_OP));
+ return ((BOOLEAN) (Opcode == AML_INT_BYTELIST_OP));
}
@@ -616,7 +621,7 @@ AcpiPsIsFieldOp (
{
return ((BOOLEAN)
(Opcode == AML_CREATE_FIELD_OP
- || Opcode == AML_DEF_FIELD_OP
+ || Opcode == AML_FIELD_OP
|| Opcode == AML_INDEX_FIELD_OP
|| Opcode == AML_BANK_FIELD_OP));
}
@@ -630,11 +635,12 @@ AcpiPsIsCreateFieldOp (
UINT16 Opcode)
{
return ((BOOLEAN)
- (Opcode == AML_CREATE_FIELD_OP ||
- Opcode == AML_BIT_FIELD_OP ||
- Opcode == AML_BYTE_FIELD_OP ||
- Opcode == AML_WORD_FIELD_OP ||
- Opcode == AML_DWORD_FIELD_OP));
+ (Opcode == AML_CREATE_FIELD_OP ||
+ Opcode == AML_CREATE_BIT_FIELD_OP ||
+ Opcode == AML_CREATE_BYTE_FIELD_OP ||
+ Opcode == AML_CREATE_WORD_FIELD_OP ||
+ Opcode == AML_CREATE_DWORD_FIELD_OP ||
+ Opcode == AML_CREATE_QWORD_FIELD_OP));
}
OpenPOWER on IntegriCloud