summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/dsutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/dsutils.c')
-rw-r--r--sys/contrib/dev/acpica/dsutils.c139
1 files changed, 61 insertions, 78 deletions
diff --git a/sys/contrib/dev/acpica/dsutils.c b/sys/contrib/dev/acpica/dsutils.c
index 9e4d0da..8d89f67 100644
--- a/sys/contrib/dev/acpica/dsutils.c
+++ b/sys/contrib/dev/acpica/dsutils.c
@@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: dsutils - Dispatcher utilities
- * $Revision: 52 $
+ * $Revision: 58 $
*
******************************************************************************/
@@ -124,7 +124,7 @@
#include "acnamesp.h"
#include "acdebug.h"
-#define _COMPONENT PARSER
+#define _COMPONENT ACPI_DISPATCHER
MODULE_NAME ("dsutils")
@@ -157,7 +157,7 @@ AcpiDsIsResultUsed (
if (!Op)
{
- DEBUG_PRINT (ACPI_ERROR, ("DsIsResultUsed: Null Op\n"));
+ DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
return_VALUE (TRUE);
}
@@ -181,10 +181,7 @@ AcpiDsIsResultUsed (
ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode);
if (ACPI_GET_OP_TYPE (ParentInfo) != ACPI_OP_TYPE_OPCODE)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsIsResultUsed: Unknown parent opcode. Op=%X\n",
- Op));
-
+ DEBUG_PRINTP (ACPI_ERROR, ("Unknown parent opcode. Op=%X\n", Op));
return_VALUE (FALSE);
}
@@ -209,9 +206,8 @@ AcpiDsIsResultUsed (
/* Never delete the return value associated with a return opcode */
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsIsResultUsed: Result used, [RETURN] opcode=%X Op=%X\n",
- Op->Opcode, Op));
+ DEBUG_PRINTP (TRACE_DISPATCH,
+ ("Result used, [RETURN] opcode=%X Op=%X\n", Op->Opcode, Op));
return_VALUE (TRUE);
break;
@@ -226,8 +222,8 @@ AcpiDsIsResultUsed (
if ((WalkState->ControlState->Common.State == CONTROL_PREDICATE_EXECUTING) &&
(WalkState->ControlState->Control.PredicateOp == Op))
{
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsIsResultUsed: Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
+ DEBUG_PRINTP (TRACE_DISPATCH,
+ ("Result used as a predicate, [IF/WHILE] opcode=%X Op=%X\n",
Op->Opcode, Op));
return_VALUE (TRUE);
}
@@ -245,23 +241,22 @@ AcpiDsIsResultUsed (
* These opcodes allow TermArg(s) as operands and therefore
* method calls. The result is used.
*/
- if ((Op->Parent->Opcode == AML_REGION_OP) ||
- (Op->Parent->Opcode == AML_CREATE_FIELD_OP) ||
- (Op->Parent->Opcode == AML_BIT_FIELD_OP) ||
- (Op->Parent->Opcode == AML_BYTE_FIELD_OP) ||
- (Op->Parent->Opcode == AML_WORD_FIELD_OP) ||
- (Op->Parent->Opcode == AML_DWORD_FIELD_OP) ||
- (Op->Parent->Opcode == AML_QWORD_FIELD_OP))
+ if ((Op->Parent->Opcode == AML_REGION_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_FIELD_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_BIT_FIELD_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_BYTE_FIELD_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_WORD_FIELD_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_DWORD_FIELD_OP) ||
+ (Op->Parent->Opcode == AML_CREATE_QWORD_FIELD_OP))
{
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsIsResultUsed: Result used, [Region or CreateField] opcode=%X Op=%X\n",
+ DEBUG_PRINTP (TRACE_DISPATCH,
+ ("Result used, [Region or CreateField] opcode=%X Op=%X\n",
Op->Opcode, Op));
return_VALUE (TRUE);
}
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsIsResultUsed: Result not used, Parent opcode=%X Op=%X\n",
- Op->Opcode, Op));
+ DEBUG_PRINTP (TRACE_DISPATCH,
+ ("Result not used, Parent opcode=%X Op=%X\n", Op->Opcode, Op));
return_VALUE (FALSE);
break;
@@ -310,9 +305,7 @@ AcpiDsDeleteResultIfNotUsed (
if (!Op)
{
- DEBUG_PRINT (ACPI_ERROR,
- ("DsDeleteResultIfNotUsed: Null Op=%X\n",
- Op));
+ DEBUG_PRINTP (ACPI_ERROR, ("Null Op\n"));
return_VOID;
}
@@ -332,7 +325,7 @@ AcpiDsDeleteResultIfNotUsed (
Status = AcpiDsResultPop (&ObjDesc, WalkState);
if (ACPI_SUCCESS (Status))
{
- AcpiCmRemoveReference (ResultObj);
+ AcpiUtRemoveReference (ResultObj);
}
}
@@ -365,7 +358,7 @@ AcpiDsCreateOperand (
ACPI_STATUS Status = AE_OK;
NATIVE_CHAR *NameString;
UINT32 NameLength;
- OBJECT_TYPE_INTERNAL DataType;
+ ACPI_OBJECT_TYPE8 DataType;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_PARSE_OBJECT *ParentOp;
UINT16 Opcode;
@@ -378,18 +371,15 @@ AcpiDsCreateOperand (
/* A valid name must be looked up in the namespace */
- if ((Arg->Opcode == AML_NAMEPATH_OP) &&
+ if ((Arg->Opcode == AML_INT_NAMEPATH_OP) &&
(Arg->Value.String))
{
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsCreateOperand: Getting a name: Arg=%p\n", Arg));
+ DEBUG_PRINTP (TRACE_DISPATCH, ("Getting a name: Arg=%p\n", Arg));
/* Get the entire name string from the AML stream */
- Status = AcpiAmlGetNameString (ACPI_TYPE_ANY,
- Arg->Value.Buffer,
- &NameString,
- &NameLength);
+ Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Value.Buffer,
+ &NameString, &NameLength);
if (ACPI_FAILURE (Status))
{
@@ -410,9 +400,9 @@ AcpiDsCreateOperand (
ParentOp = Arg->Parent;
if ((AcpiPsIsNodeOp (ParentOp->Opcode)) &&
- (ParentOp->Opcode != AML_METHODCALL_OP) &&
+ (ParentOp->Opcode != AML_INT_METHODCALL_OP) &&
(ParentOp->Opcode != AML_REGION_OP) &&
- (ParentOp->Opcode != AML_NAMEPATH_OP))
+ (ParentOp->Opcode != AML_INT_NAMEPATH_OP))
{
/* Enter name into namespace if not found */
@@ -434,7 +424,7 @@ AcpiDsCreateOperand (
/* Free the namestring created above */
- AcpiCmFree (NameString);
+ AcpiUtFree (NameString);
/*
* The only case where we pass through (ignore) a NOT_FOUND
@@ -487,7 +477,7 @@ AcpiDsCreateOperand (
{
/* Check for null name case */
- if (Arg->Opcode == AML_NAMEPATH_OP)
+ if (Arg->Opcode == AML_INT_NAMEPATH_OP)
{
/*
* If the name is null, this means that this is an
@@ -497,8 +487,7 @@ AcpiDsCreateOperand (
*/
Opcode = AML_ZERO_OP; /* Has no arguments! */
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsCreateOperand: Null namepath: Arg=%p\n", Arg));
+ DEBUG_PRINTP (TRACE_DISPATCH, ("Null namepath: Arg=%p\n", Arg));
/*
* TBD: [Investigate] anything else needed for the
@@ -522,8 +511,8 @@ AcpiDsCreateOperand (
if (Flags & OP_HAS_RETURN_VALUE)
{
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsCreateOperand: Argument previously created, already stacked \n"));
+ DEBUG_PRINTP (TRACE_DISPATCH,
+ ("Argument previously created, already stacked \n"));
DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1], WalkState));
@@ -531,7 +520,6 @@ AcpiDsCreateOperand (
* Use value that was already previously returned
* by the evaluation of this argument
*/
-
Status = AcpiDsResultPopFromBottom (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
@@ -539,8 +527,8 @@ AcpiDsCreateOperand (
* Only error is underflow, and this indicates
* a missing or null operand!
*/
- DEBUG_PRINT (ACPI_ERROR,
- ("DsCreateOperand: Missing or null operand, %s\n", AcpiCmFormatException (Status)));
+ DEBUG_PRINTP (ACPI_ERROR, ("Missing or null operand, %s\n",
+ AcpiUtFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -550,7 +538,7 @@ AcpiDsCreateOperand (
{
/* Create an ACPI_INTERNAL_OBJECT for the argument */
- ObjDesc = AcpiCmCreateInternalObject (DataType);
+ ObjDesc = AcpiUtCreateInternalObject (DataType);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -562,7 +550,7 @@ AcpiDsCreateOperand (
Opcode, &ObjDesc);
if (ACPI_FAILURE (Status))
{
- AcpiCmDeleteObjectDesc (ObjDesc);
+ AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (Status);
}
}
@@ -619,8 +607,7 @@ AcpiDsCreateOperands (
goto Cleanup;
}
- DEBUG_PRINT (TRACE_DISPATCH,
- ("DsCreateOperands: Arg #%d (%p) done, Arg1=%p\n",
+ DEBUG_PRINTP (TRACE_DISPATCH, ("Arg #%d (%p) done, Arg1=%p\n",
ArgCount, Arg, FirstArg));
/* Move on to next argument, if any */
@@ -641,9 +628,8 @@ Cleanup:
AcpiDsObjStackPopAndDelete (ArgCount, WalkState);
- DEBUG_PRINT (ACPI_ERROR,
- ("DsCreateOperands: Error while creating Arg %d - %s\n",
- (ArgCount + 1), AcpiCmFormatException (Status)));
+ DEBUG_PRINTP (ACPI_ERROR, ("While creating Arg %d - %s\n",
+ (ArgCount + 1), AcpiUtFormatException (Status)));
return_ACPI_STATUS (Status);
}
@@ -680,12 +666,12 @@ AcpiDsResolveOperands (
/*
* TBD: [Investigate] Note from previous parser:
- * RefOf problem with AcpiAmlResolveToValue() conversion.
+ * RefOf problem with AcpiExResolveToValue() conversion.
*/
for (i = 0; i < WalkState->NumOperands; i++)
{
- Status = AcpiAmlResolveToValue (&WalkState->Operands[i], WalkState);
+ Status = AcpiExResolveToValue (&WalkState->Operands[i], WalkState);
if (ACPI_FAILURE (Status))
{
break;
@@ -711,25 +697,25 @@ AcpiDsResolveOperands (
*
******************************************************************************/
-OBJECT_TYPE_INTERNAL
+ACPI_OBJECT_TYPE8
AcpiDsMapOpcodeToDataType (
UINT16 Opcode,
UINT32 *OutFlags)
{
- OBJECT_TYPE_INTERNAL DataType = INTERNAL_TYPE_INVALID;
+ ACPI_OBJECT_TYPE8 DataType = INTERNAL_TYPE_INVALID;
ACPI_OPCODE_INFO *OpInfo;
UINT32 Flags = 0;
+ PROC_NAME ("DsMapOpcodeToDataType");
+
+
OpInfo = AcpiPsGetOpcodeInfo (Opcode);
if (ACPI_GET_OP_TYPE (OpInfo) != ACPI_OP_TYPE_OPCODE)
{
/* Unknown opcode */
- DEBUG_PRINT (ACPI_ERROR,
- ("MapOpcode: Unknown AML opcode: %x\n",
- Opcode));
-
+ DEBUG_PRINTP (ACPI_ERROR, ("Unknown AML opcode: %x\n", Opcode));
return (DataType);
}
@@ -753,14 +739,13 @@ AcpiDsMapOpcodeToDataType (
DataType = ACPI_TYPE_STRING;
break;
- case AML_NAMEPATH_OP:
+ case AML_INT_NAMEPATH_OP:
DataType = INTERNAL_TYPE_REFERENCE;
break;
default:
- DEBUG_PRINT (ACPI_ERROR,
- ("MapOpcode: Unknown (type LITERAL) AML opcode: %x\n",
- Opcode));
+ DEBUG_PRINTP (ACPI_ERROR,
+ ("Unknown (type LITERAL) AML opcode: %x\n", Opcode));
break;
}
break;
@@ -781,9 +766,8 @@ AcpiDsMapOpcodeToDataType (
break;
default:
- DEBUG_PRINT (ACPI_ERROR,
- ("MapOpcode: Unknown (type DATA_TERM) AML opcode: %x\n",
- Opcode));
+ DEBUG_PRINTP (ACPI_ERROR,
+ ("Unknown (type DATA_TERM) AML opcode: %x\n", Opcode));
break;
}
break;
@@ -833,9 +817,8 @@ AcpiDsMapOpcodeToDataType (
default:
- DEBUG_PRINT (ACPI_ERROR,
- ("MapOpcode: Unimplemented data type opcode: %x\n",
- Opcode));
+ DEBUG_PRINTP (ACPI_ERROR,
+ ("Unimplemented data type opcode: %x\n", Opcode));
break;
}
@@ -863,11 +846,11 @@ AcpiDsMapOpcodeToDataType (
*
******************************************************************************/
-OBJECT_TYPE_INTERNAL
+ACPI_OBJECT_TYPE8
AcpiDsMapNamedOpcodeToDataType (
UINT16 Opcode)
{
- OBJECT_TYPE_INTERNAL DataType;
+ ACPI_OBJECT_TYPE8 DataType;
/* Decode Opcode */
@@ -898,8 +881,8 @@ AcpiDsMapNamedOpcodeToDataType (
DataType = ACPI_TYPE_PROCESSOR;
break;
- case AML_DEF_FIELD_OP: /* DefFieldOp */
- DataType = INTERNAL_TYPE_DEF_FIELD_DEFN;
+ case AML_FIELD_OP: /* FieldOp */
+ DataType = INTERNAL_TYPE_FIELD_DEFN;
break;
case AML_INDEX_FIELD_OP: /* IndexFieldOp */
@@ -910,12 +893,12 @@ AcpiDsMapNamedOpcodeToDataType (
DataType = INTERNAL_TYPE_BANK_FIELD_DEFN;
break;
- case AML_NAMEDFIELD_OP: /* NO CASE IN ORIGINAL */
+ case AML_INT_NAMEDFIELD_OP: /* NO CASE IN ORIGINAL */
DataType = ACPI_TYPE_ANY;
break;
case AML_NAME_OP: /* NameOp - special code in original */
- case AML_NAMEPATH_OP:
+ case AML_INT_NAMEPATH_OP:
DataType = ACPI_TYPE_ANY;
break;
OpenPOWER on IntegriCloud