Remove non-ANSI (//) Comments

date	2000.06.19.21.46.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:09:01 +00:00
parent cbd2800f4b
commit 59ecaf870f
4 changed files with 652 additions and 754 deletions

View File

@ -116,13 +116,13 @@
#define __DSUTILS_C__
#include <acpi.h>
#include <parser.h>
#include <amlcode.h>
#include <dispatch.h>
#include <interp.h>
#include <namesp.h>
#include <debugger.h>
#include "acpi.h"
#include "parser.h"
#include "amlcode.h"
#include "dispatch.h"
#include "interp.h"
#include "namesp.h"
#include "debugger.h"
#define _COMPONENT PARSER
MODULE_NAME ("dsutils");
@ -131,7 +131,7 @@
/*****************************************************************************
*
* FUNCTION: DsDeleteResultIfNotUsed
* FUNCTION: AcpiDsDeleteResultIfNotUsed
*
* PARAMETERS: Op
* ResultObj
@ -147,7 +147,7 @@
****************************************************************************/
void
DsDeleteResultIfNotUsed (
AcpiDsDeleteResultIfNotUsed (
ACPI_GENERIC_OP *Op,
ACPI_OBJECT_INTERNAL *ResultObj,
ACPI_WALK_STATE *WalkState)
@ -181,23 +181,23 @@ DsDeleteResultIfNotUsed (
/* Must pop the result stack (ObjDesc should be equal to ResultObj) */
Status = DsResultStackPop (&ObjDesc, WalkState);
Status = AcpiDsResultStackPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return;
}
CmDeleteInternalObject (ResultObj);
AcpiCmRemoveReference (ResultObj);
return_VOID;
}
/*
* Get info on the parent. The root Op is AML_Scope
* Get info on the parent. The root Op is AML_SCOPE
*/
ParentInfo = PsGetOpcodeInfo (Op->Parent->Opcode);
ParentInfo = AcpiPsGetOpcodeInfo (Op->Parent->Opcode);
if (!ParentInfo)
{
DEBUG_PRINT (ACPI_ERROR, ("DsDeleteResultIfNotUsed: Unknown parent opcode. Op=%X\n",
@ -209,7 +209,7 @@ DsDeleteResultIfNotUsed (
/* Never delete the return value associated with a return opcode */
if (Op->Parent->Opcode == AML_ReturnOp)
if (Op->Parent->Opcode == AML_RETURN_OP)
{
DEBUG_PRINT (TRACE_DISPATCH, ("DsDeleteResultIfNotUsed: No delete, [RETURN] opcode=%X Op=%X\n",
Op->Opcode, Op));
@ -237,13 +237,13 @@ DsDeleteResultIfNotUsed (
/* Must pop the result stack (ObjDesc should be equal to ResultObj) */
Status = DsResultStackPop (&ObjDesc, WalkState);
Status = AcpiDsResultStackPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_VOID;
}
CmDeleteInternalObject (ResultObj);
AcpiCmRemoveReference (ResultObj);
break;
/*
@ -261,7 +261,7 @@ DsDeleteResultIfNotUsed (
/*****************************************************************************
*
* FUNCTION: DsCreateOperand
* FUNCTION: AcpiDsCreateOperand
*
* PARAMETERS: WalkState
* Arg
@ -276,14 +276,14 @@ DsDeleteResultIfNotUsed (
****************************************************************************/
ACPI_STATUS
DsCreateOperand (
AcpiDsCreateOperand (
ACPI_WALK_STATE *WalkState,
ACPI_GENERIC_OP *Arg)
{
ACPI_STATUS Status = AE_OK;
char *NameString;
UINT32 NameLength;
ACPI_OBJECT_TYPE DataType;
OBJECT_TYPE_INTERNAL DataType;
ACPI_OBJECT_INTERNAL *ObjDesc;
ACPI_GENERIC_OP *ParentOp;
UINT16 Opcode;
@ -303,7 +303,7 @@ DsCreateOperand (
/* Get the entire name string from the AML stream */
Status = AmlGetNameString (ACPI_TYPE_Any, Arg->Value.Buffer, &NameString, &NameLength);
Status = AcpiAmlGetNameString (ACPI_TYPE_ANY, Arg->Value.Buffer, &NameString, &NameLength);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -313,33 +313,33 @@ DsCreateOperand (
/*
* Differentiate between a namespace "create" operation versus a "lookup" operation
* (IMODE_LoadPass2 vs. IMODE_Execute) in order to support the creation of namespace
* (IMODE_LOAD_PASS2 vs. IMODE_EXECUTE) in order to support the creation of namespace
* objects during the execution of control methods.
*/
ParentOp = Arg->Parent;
if ((PsIsNamedObjectOp (ParentOp->Opcode)) &&
if ((AcpiPsIsNamedObjectOp (ParentOp->Opcode)) &&
(ParentOp->Opcode != AML_METHODCALL_OP) &&
(ParentOp->Opcode != AML_NAMEPATH_OP))
{
/* Enter name into namespace if not found */
InterpreterMode = IMODE_LoadPass2;
InterpreterMode = IMODE_LOAD_PASS2;
}
else
{
/* Return a failure if name not found */
InterpreterMode = IMODE_Execute;
InterpreterMode = IMODE_EXECUTE;
}
Status = NsLookup (WalkState->ScopeInfo, NameString, ACPI_TYPE_Any, InterpreterMode,
Status = AcpiNsLookup (WalkState->ScopeInfo, NameString, ACPI_TYPE_ANY, InterpreterMode,
NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, WalkState, (NAME_TABLE_ENTRY **) &ObjDesc);
/* Free the namestring created above */
CmFree (NameString);
AcpiCmFree (NameString);
/*
* The only case where we pass through (ignore) a NOT_FOUND error is for the
@ -348,13 +348,13 @@ DsCreateOperand (
if (Status == AE_NOT_FOUND)
{
if (ParentOp->Opcode == AML_CondRefOfOp)
if (ParentOp->Opcode == AML_COND_REF_OF_OP)
{
/*
* For the Conditional Reference op, it's OK if the name is not found; We
* just need a way to indicate this to the interpreter, set the object to the root
*/
ObjDesc = (ACPI_OBJECT_INTERNAL *) Gbl_RootObject;
ObjDesc = (ACPI_OBJECT_INTERNAL *) AcpiGbl_RootObject;
Status = AE_OK;
}
@ -375,12 +375,12 @@ DsCreateOperand (
/* Put the resulting object onto the current object stack */
Status = DsObjStackPush (ObjDesc, WalkState);
Status = AcpiDsObjStackPush (ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
DEBUG_EXEC (DbDisplayArgumentObject (ObjDesc));
DEBUG_EXEC (AcpiDbDisplayArgumentObject (ObjDesc));
}
@ -392,13 +392,13 @@ DsCreateOperand (
{
/*
* If the name is null, this means that this is an optional result parameter that was
* not specified in the original ASL. Create an Lvalue for a placeholder
* not specified in the original ASL. Create an Reference for a placeholder
*/
Opcode = AML_ZeroOp; /* Has no arguments! */
Opcode = AML_ZERO_OP; /* Has no arguments! */
DEBUG_PRINT (TRACE_DISPATCH, ("DsCreateOperand: Null namepath: Arg=%p\n", Arg));
/* TBD: anything else needed for the zero op lvalue? */
/* TBD: [Investigate] anything else needed for the zero op lvalue? */
}
else
@ -409,8 +409,8 @@ DsCreateOperand (
/* Get the data type of the argument */
DataType = DsMapOpcodeToDataType (Opcode, &Flags);
if (DataType == INTERNAL_TYPE_Invalid)
DataType = AcpiDsMapOpcodeToDataType (Opcode, &Flags);
if (DataType == INTERNAL_TYPE_INVALID)
{
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
}
@ -418,14 +418,13 @@ DsCreateOperand (
if (Flags & OP_HAS_RETURN_VALUE)
{
DEBUG_PRINT (TRACE_DISPATCH, ("DsCreateOperand: Argument previously created, already stacked \n"));
// DEBUG_EXEC (DbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1]));
DEBUG_EXEC (AcpiDbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1]));
/*
* Use value that was already previously returned by the evaluation of this argument
*/
Status = DsResultStackPop (&ObjDesc, WalkState);
Status = AcpiDsResultStackPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
/*
@ -441,7 +440,7 @@ DsCreateOperand (
{
/* Create an ACPI_INTERNAL_OBJECT for the argument */
ObjDesc = CmCreateInternalObject (DataType);
ObjDesc = AcpiCmCreateInternalObject (DataType);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@ -449,23 +448,23 @@ DsCreateOperand (
/* Initialize the new object */
Status = DsInitObjectFromOp (WalkState, Arg, Opcode, ObjDesc);
Status = AcpiDsInitObjectFromOp (WalkState, Arg, Opcode, ObjDesc);
if (ACPI_FAILURE (Status))
{
CmFree (ObjDesc);
AcpiCmFree (ObjDesc);
return_ACPI_STATUS (Status);
}
}
/* Put the operand object on the object stack */
Status = DsObjStackPush (ObjDesc, WalkState);
Status = AcpiDsObjStackPush (ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
DEBUG_EXEC (DbDisplayArgumentObject (ObjDesc));
DEBUG_EXEC (AcpiDbDisplayArgumentObject (ObjDesc));
}
@ -477,7 +476,7 @@ DsCreateOperand (
/*****************************************************************************
*
* FUNCTION: DsCreateOperands
* FUNCTION: AcpiDsCreateOperands
*
* PARAMETERS: FirstArg - First argument of a parser argument tree
*
@ -490,7 +489,7 @@ DsCreateOperand (
****************************************************************************/
ACPI_STATUS
DsCreateOperands (
AcpiDsCreateOperands (
ACPI_WALK_STATE *WalkState,
ACPI_GENERIC_OP *FirstArg)
{
@ -509,7 +508,7 @@ DsCreateOperands (
while (Arg)
{
Status = DsCreateOperand (WalkState, Arg);
Status = AcpiDsCreateOperand (WalkState, Arg);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -533,17 +532,17 @@ Cleanup:
* of the operand stack and delete those objects
*/
DsObjStackPopAndDelete (ArgsPushed, WalkState);
AcpiDsObjStackPopAndDelete (ArgsPushed, WalkState);
DEBUG_PRINT (ACPI_ERROR, ("DsCreateOperands: Error while creating Arg %d - %s\n",
(ArgsPushed+1), CmFormatException (Status)));
(ArgsPushed+1), AcpiCmFormatException (Status)));
return_ACPI_STATUS (Status);
}
/*****************************************************************************
*
* FUNCTION: DsResolveOperands
* FUNCTION: AcpiDsResolveOperands
*
* PARAMETERS: WalkState - Current walk state with operands on stack
*
@ -555,7 +554,7 @@ Cleanup:
****************************************************************************/
ACPI_STATUS
DsResolveOperands (
AcpiDsResolveOperands (
ACPI_WALK_STATE *WalkState)
{
UINT32 i;
@ -571,14 +570,13 @@ DsResolveOperands (
*/
/*
* TBD: Note from previous parser:
*
* TBD: RefOf problem with AmlGetRvalue() conversion.
* TBD: [Investigate] Note from previous parser:
* RefOf problem with AcpiAmlResolveToValue() conversion.
*/
for (i = 0; i < WalkState->NumOperands; i++)
{
Status = AmlGetRvalue (&WalkState->Operands[i]);
Status = AcpiAmlResolveToValue (&WalkState->Operands[i]);
if (ACPI_FAILURE (Status))
{
break;
@ -591,7 +589,7 @@ DsResolveOperands (
/*****************************************************************************
*
* FUNCTION: DsMapOpcodeToDataType
* FUNCTION: AcpiDsMapOpcodeToDataType
*
* PARAMETERS: Opcode - AML opcode to map
* OutFlags - Additional info about the opcode
@ -604,17 +602,17 @@ DsResolveOperands (
*
****************************************************************************/
ACPI_OBJECT_TYPE
DsMapOpcodeToDataType (
OBJECT_TYPE_INTERNAL
AcpiDsMapOpcodeToDataType (
UINT16 Opcode,
UINT32 *OutFlags)
{
ACPI_OBJECT_TYPE DataType = INTERNAL_TYPE_Invalid;
OBJECT_TYPE_INTERNAL DataType = INTERNAL_TYPE_INVALID;
ACPI_OP_INFO *OpInfo;
UINT32 Flags = 0;
OpInfo = PsGetOpcodeInfo (Opcode);
OpInfo = AcpiPsGetOpcodeInfo (Opcode);
if (!OpInfo)
{
/* Unknown opcode */
@ -629,21 +627,21 @@ DsMapOpcodeToDataType (
switch (Opcode)
{
case AML_ByteOp:
case AML_WordOp:
case AML_DWordOp:
case AML_BYTE_OP:
case AML_WORD_OP:
case AML_DWORD_OP:
DataType = ACPI_TYPE_Number;
DataType = ACPI_TYPE_NUMBER;
break;
case AML_StringOp:
case AML_STRING_OP:
DataType = ACPI_TYPE_String;
DataType = ACPI_TYPE_STRING;
break;
case AML_NAMEPATH_OP:
DataType = INTERNAL_TYPE_Reference;
DataType = INTERNAL_TYPE_REFERENCE;
break;
}
@ -654,14 +652,14 @@ DsMapOpcodeToDataType (
switch (Opcode)
{
case AML_BufferOp:
case AML_BUFFER_OP:
DataType = ACPI_TYPE_Buffer;
DataType = ACPI_TYPE_BUFFER;
break;
case AML_PackageOp:
case AML_PACKAGE_OP:
DataType = ACPI_TYPE_Package;
DataType = ACPI_TYPE_PACKAGE;
break;
}
@ -672,7 +670,7 @@ DsMapOpcodeToDataType (
case OPTYPE_METHOD_ARGUMENT:
case OPTYPE_LOCAL_VARIABLE:
DataType = INTERNAL_TYPE_Lvalue;
DataType = INTERNAL_TYPE_REFERENCE;
break;
@ -685,21 +683,21 @@ DsMapOpcodeToDataType (
case OPTYPE_MATCH:
Flags = OP_HAS_RETURN_VALUE;
DataType = ACPI_TYPE_Any;
DataType = ACPI_TYPE_ANY;
break;
case OPTYPE_METHOD_CALL:
Flags = OP_HAS_RETURN_VALUE;
DataType = ACPI_TYPE_Method;
DataType = ACPI_TYPE_METHOD;
break;
case OPTYPE_NAMED_OBJECT:
DataType = DsMapNamedOpcodeToDataType (Opcode);
DataType = AcpiDsMapNamedOpcodeToDataType (Opcode);
break;
@ -732,7 +730,7 @@ DsMapOpcodeToDataType (
/*****************************************************************************
*
* FUNCTION: DsMapNamedOpcodeToDataType
* FUNCTION: AcpiDsMapNamedOpcodeToDataType
*
* PARAMETERS: Opcode - The Named AML opcode to map
*
@ -743,81 +741,81 @@ DsMapOpcodeToDataType (
*
****************************************************************************/
ACPI_OBJECT_TYPE
DsMapNamedOpcodeToDataType (
OBJECT_TYPE_INTERNAL
AcpiDsMapNamedOpcodeToDataType (
UINT16 Opcode)
{
ACPI_OBJECT_TYPE DataType;
OBJECT_TYPE_INTERNAL DataType;
/* Decode Opcode */
switch (Opcode)
{
case AML_ScopeOp:
DataType = INTERNAL_TYPE_Scope;
case AML_SCOPE_OP:
DataType = INTERNAL_TYPE_SCOPE;
break;
case AML_DeviceOp:
DataType = ACPI_TYPE_Device;
case AML_DEVICE_OP:
DataType = ACPI_TYPE_DEVICE;
break;
case AML_ThermalZoneOp:
DataType = ACPI_TYPE_Thermal;
case AML_THERMAL_ZONE_OP:
DataType = ACPI_TYPE_THERMAL;
break;
case AML_MethodOp:
DataType = ACPI_TYPE_Method;
case AML_METHOD_OP:
DataType = ACPI_TYPE_METHOD;
break;
case AML_PowerResOp:
DataType = ACPI_TYPE_Power;
case AML_POWER_RES_OP:
DataType = ACPI_TYPE_POWER;
break;
case AML_ProcessorOp:
DataType = ACPI_TYPE_Processor;
case AML_PROCESSOR_OP:
DataType = ACPI_TYPE_PROCESSOR;
break;
case AML_DefFieldOp: /* DefFieldOp */
DataType = INTERNAL_TYPE_DefFieldDefn;
case AML_DEF_FIELD_OP: /* DefFieldOp */
DataType = INTERNAL_TYPE_DEF_FIELD_DEFN;
break;
case AML_IndexFieldOp: /* IndexFieldOp */
DataType = INTERNAL_TYPE_IndexFieldDefn;
case AML_INDEX_FIELD_OP: /* IndexFieldOp */
DataType = INTERNAL_TYPE_INDEX_FIELD_DEFN;
break;
case AML_BankFieldOp: /* BankFieldOp */
DataType = INTERNAL_TYPE_BankFieldDefn;
case AML_BANK_FIELD_OP: /* BankFieldOp */
DataType = INTERNAL_TYPE_BANK_FIELD_DEFN;
break;
case AML_NAMEDFIELD_OP: /* NO CASE IN ORIGINAL */
DataType = ACPI_TYPE_Any;
DataType = ACPI_TYPE_ANY;
break;
case AML_NameOp: /* NameOp - special code in original */
case AML_NAME_OP: /* NameOp - special code in original */
case AML_NAMEPATH_OP:
DataType = ACPI_TYPE_Any;
DataType = ACPI_TYPE_ANY;
break;
case AML_AliasOp:
DataType = INTERNAL_TYPE_Alias;
case AML_ALIAS_OP:
DataType = INTERNAL_TYPE_ALIAS;
break;
case AML_MutexOp:
DataType = ACPI_TYPE_Mutex;
case AML_MUTEX_OP:
DataType = ACPI_TYPE_MUTEX;
break;
case AML_EventOp:
DataType = ACPI_TYPE_Event;
case AML_EVENT_OP:
DataType = ACPI_TYPE_EVENT;
break;
case AML_RegionOp:
DataType = ACPI_TYPE_Region;
case AML_REGION_OP:
DataType = ACPI_TYPE_REGION;
break;
default:
DataType = ACPI_TYPE_Any;
DataType = ACPI_TYPE_ANY;
break;
}

View File

@ -117,13 +117,13 @@
#define __DSWEXEC_C__
#include <acpi.h>
#include <parser.h>
#include <amlcode.h>
#include <dispatch.h>
#include <interp.h>
#include <namesp.h>
#include <debugger.h>
#include "acpi.h"
#include "parser.h"
#include "amlcode.h"
#include "dispatch.h"
#include "interp.h"
#include "namesp.h"
#include "debugger.h"
#define _COMPONENT DISPATCHER
@ -134,7 +134,7 @@
/*****************************************************************************
*
* FUNCTION: DsExecBeginOp
* FUNCTION: AcpiDsExecBeginOp
*
* PARAMETERS: WalkState - Current state of the parse tree walk
* Op - Op that has been just been reached in the
@ -149,7 +149,7 @@
****************************************************************************/
ACPI_STATUS
DsExecBeginOp (
AcpiDsExecBeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_GENERIC_OP *Op)
{
@ -172,54 +172,53 @@ DsExecBeginOp (
*/
if ((WalkState->ControlState) &&
(WalkState->ControlState->Exec == CONTROL_CONDITIONAL_EXECUTING))
(WalkState->ControlState->Common.State == CONTROL_CONDITIONAL_EXECUTING))
{
DEBUG_PRINT (TRACE_EXEC, ("BeginOp: Exec predicate Op=%X State=%X\n",
Op, WalkState));
WalkState->ControlState->Exec = CONTROL_PREDICATE_EXECUTING;
WalkState->ControlState->PredicateOp = Op; /* Save start of predicate */
WalkState->ControlState->Common.State = CONTROL_PREDICATE_EXECUTING;
WalkState->ControlState->Control.PredicateOp = Op; /* Save start of predicate */
}
/*
if (Op->Opcode != AML_MethodOp)
{
return_ACPI_STATUS (AE_OK);
}
*/
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
OpInfo = PsGetOpcodeInfo (Op->Opcode);
/* We want to send name paths to the load code */
/* We want to send namepaths to the load code */
if (Op->Opcode == AML_NAMEPATH_OP)
{
OpInfo->Flags = OPTYPE_NAMED_OBJECT;
}
/*
* Handle the opcode based upon the opcode type
*/
switch (OpInfo->Flags & OP_INFO_TYPE)
{
case OPTYPE_CONTROL:
Status = DsExecBeginControlOp (WalkState, Op);
Status = AcpiDsExecBeginControlOp (WalkState, Op);
break;
case OPTYPE_NAMED_OBJECT:
if (WalkState->Origin->Opcode == AML_MethodOp)
if (WalkState->Origin->Opcode == AML_METHOD_OP)
{
/*
* Found a named object declaration during method execution; we must enter
* this object into the namespace.
*
* TBD: make this a temporary namespace object
* this object into the namespace. The created object is temporary and
* will be deleted upon completion of the execution of this method.
*/
Status = DsLoad2BeginOp (WalkState, Op);
Status = AcpiDsLoad2BeginOp (WalkState, Op);
}
break;
default:
break;
}
@ -232,7 +231,7 @@ DsExecBeginOp (
/*****************************************************************************
*
* FUNCTION: DsExecEndOp
* FUNCTION: AcpiDsExecEndOp
*
* PARAMETERS: WalkState - Current state of the parse tree walk
* Op - Op that has been just been completed in the
@ -247,7 +246,7 @@ DsExecBeginOp (
****************************************************************************/
ACPI_STATUS
DsExecEndOp (
AcpiDsExecEndOp (
ACPI_WALK_STATE *WalkState,
ACPI_GENERIC_OP *Op)
{
@ -269,7 +268,7 @@ DsExecEndOp (
Opcode = (UINT16) Op->Opcode;
OpInfo = PsGetOpcodeInfo (Op->Opcode);
OpInfo = AcpiPsGetOpcodeInfo (Op->Opcode);
if (!OpInfo)
{
DEBUG_PRINT (ACPI_ERROR, ("ExecEndOp: Unknown opcode. Op=%X\n",
@ -289,7 +288,7 @@ DsExecEndOp (
/* Call debugger for single step support (DEBUG build only) */
DEBUG_EXEC (Status = DbSingleStep (WalkState, Op, Optype));
DEBUG_EXEC (Status = AcpiDbSingleStep (WalkState, Op, Optype));
DEBUG_EXEC (if (Status != AE_OK) {return_ACPI_STATUS (Status);});
@ -327,12 +326,13 @@ DsExecEndOp (
case OPTYPE_DYADIC2:
case OPTYPE_DYADIC2R:
case OPTYPE_DYADIC2S:
case OPTYPE_RECONFIGURATION:
case OPTYPE_INDEX:
case OPTYPE_MATCH:
case OPTYPE_CREATE_FIELD:
case OPTYPE_FATAL:
Status = DsCreateOperands (WalkState, FirstArg);
Status = AcpiDsCreateOperands (WalkState, FirstArg);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -347,7 +347,7 @@ DsExecEndOp (
/* 1 Operand, 0 ExternalResult, 0 InternalResult */
Status = AmlExecMonadic1 (Opcode, WalkState);
Status = AcpiAmlExecMonadic1 (Opcode, WalkState);
break;
@ -355,10 +355,10 @@ DsExecEndOp (
/* 1 Operand, 0 ExternalResult, 1 InternalResult */
Status = AmlExecMonadic2 (Opcode, WalkState, &ResultObj);
Status = AcpiAmlExecMonadic2 (Opcode, WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -368,10 +368,10 @@ DsExecEndOp (
/* 1 Operand, 1 ExternalResult, 1 InternalResult */
Status = AmlExecMonadic2R (Opcode, WalkState, &ResultObj);
Status = AcpiAmlExecMonadic2R (Opcode, WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -381,7 +381,7 @@ DsExecEndOp (
/* 2 Operands, 0 ExternalResult, 0 InternalResult */
Status = AmlExecDyadic1 (Opcode, WalkState);
Status = AcpiAmlExecDyadic1 (Opcode, WalkState);
break;
@ -390,10 +390,10 @@ DsExecEndOp (
/* 2 Operands, 0 ExternalResult, 1 InternalResult */
Status = AmlExecDyadic2 (Opcode, WalkState, &ResultObj);
Status = AcpiAmlExecDyadic2 (Opcode, WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -407,10 +407,10 @@ DsExecEndOp (
/* NEW INTERFACE:
* Pass in WalkState, keep result obj but let interpreter push the result */
Status = AmlExecDyadic2R (Opcode, WalkState, &ResultObj);
Status = AcpiAmlExecDyadic2R (Opcode, WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -420,21 +420,28 @@ DsExecEndOp (
/* 2 Operands, 0 ExternalResult, 1 InternalResult */
Status = AmlExecDyadic2S (Opcode, WalkState, &ResultObj);
Status = AcpiAmlExecDyadic2S (Opcode, WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
case OPTYPE_RECONFIGURATION:
/* 1 or 2 operands, 0 Internal Result */
Status = AcpiAmlExecReconfiguration (Opcode, WalkState);
break;
case OPTYPE_CREATE_FIELD:
/* 3 or 4 Operands, 0 ExternalResult, 0 InternalResult */
Status = AmlExecCreateField (Opcode, WalkState);
Status = AcpiAmlExecCreateField (Opcode, WalkState);
break;
@ -442,7 +449,7 @@ DsExecEndOp (
/* 3 Operands, 0 ExternalResult, 0 InternalResult */
Status = AmlExecFatal (WalkState);
Status = AcpiAmlExecFatal (WalkState);
break;
@ -450,10 +457,10 @@ DsExecEndOp (
/* 3 Operands, 1 ExternalResult, 1 InternalResult */
Status = AmlExecIndex (WalkState, &ResultObj);
Status = AcpiAmlExecIndex (WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -463,10 +470,10 @@ DsExecEndOp (
/* 6 Operands, 0 ExternalResult, 1 InternalResult */
Status = AmlExecMatch (WalkState, &ResultObj);
Status = AcpiAmlExecMatch (WalkState, &ResultObj);
if (ACPI_SUCCESS (Status))
{
Status = DsResultStackPush (ResultObj, WalkState);
Status = AcpiDsResultStackPush (ResultObj, WalkState);
}
break;
@ -480,7 +487,7 @@ DsExecEndOp (
/* 1 Operand, 0 ExternalResult, 0 InternalResult */
Status = DsExecEndControlOp (WalkState, Op);
Status = AcpiDsExecEndControlOp (WalkState, Op);
break;
@ -502,7 +509,7 @@ DsExecEndOp (
* Get the method's arguments and put them on the operand stack
*/
Status = DsCreateOperands (WalkState, NextOp);
Status = AcpiDsCreateOperands (WalkState, NextOp);
if (ACPI_FAILURE (Status))
{
break;
@ -513,7 +520,7 @@ DsExecEndOp (
* resolve all local references here (Local variables, arguments to *this* method, etc.)
*/
Status = DsResolveOperands (WalkState);
Status = AcpiDsResolveOperands (WalkState);
if (ACPI_FAILURE (Status))
{
break;
@ -521,7 +528,7 @@ DsExecEndOp (
/* Open new scope on the scope stack */
/*
Status = NsScopeStackPushEntry (Entry);
Status = AcpiNsScopeStackPushEntry (Entry);
if (ACPI_FAILURE (Status))
{
DEBUG_PRINT (ACPI_ERROR, ("ExecEndOp: Could not push Scope Stack\n"));
@ -531,7 +538,7 @@ DsExecEndOp (
/* Tell the walk loop to preempt this running method and execute the new method */
Status = AE_PENDING;
Status = AE_CTRL_PENDING;
/* Return now; we don't want to disturb anything, especially the operand count! */
@ -539,45 +546,37 @@ DsExecEndOp (
break;
case OPTYPE_RECONFIGURATION:
DEBUG_PRINT (ACPI_ERROR, ("ExecEndOp: Unimplemented reconfig opcode=%X Op=%X\n",
Op->Opcode, Op));
Status = AE_NOT_IMPLEMENTED;
break;
case OPTYPE_NAMED_OBJECT:
if ((WalkState->Origin->Opcode == AML_MethodOp) &&
if ((WalkState->Origin->Opcode == AML_METHOD_OP) &&
(WalkState->Origin != Op))
{
DsLoad2EndOp (WalkState, Op);
Status = AcpiDsLoad2EndOp (WalkState, Op);
if (ACPI_FAILURE (Status))
{
break;
}
}
switch (Op->Opcode)
{
case AML_RegionOp:
case AML_REGION_OP:
DEBUG_PRINT (TRACE_EXEC, ("ExecEndOp: Executing OpRegion Address/Length Op=%X\n",
Op));
Status = DsEvalRegionOperands (WalkState, Op);
Status = AcpiDsEvalRegionOperands (WalkState, Op);
break;
case AML_MethodOp:
/* End of execution, nothing else to do */
case AML_METHOD_OP:
break;
case AML_AliasOp:
case AML_ALIAS_OP:
/* Alias creation was already handled by call to psxload above */
@ -585,7 +584,7 @@ DsExecEndOp (
default:
/* TBD: Nothing to do here at this time */
/* Nothing needs to be done */
Status = AE_OK;
break;
@ -609,18 +608,16 @@ DsExecEndOp (
*/
if ((WalkState->ControlState) &&
(WalkState->ControlState->Exec == CONTROL_PREDICATE_EXECUTING) &&
(WalkState->ControlState->PredicateOp == Op))
(WalkState->ControlState->Common.State == CONTROL_PREDICATE_EXECUTING) &&
(WalkState->ControlState->Control.PredicateOp == Op))
{
/* Completed the predicate, the result must be a number */
WalkState->ControlState->Exec = 0;
/* TBD: REDO now that we have the resultobj mechanism */
WalkState->ControlState->Common.State = 0;
if (ResultObj)
{
Status = DsResultStackPop (&ObjDesc, WalkState);
Status = AcpiDsResultStackPop (&ObjDesc, WalkState);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -629,13 +626,13 @@ DsExecEndOp (
else
{
Status = DsCreateOperand (WalkState, Op);
Status = AcpiDsCreateOperand (WalkState, Op);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
Status = AmlGetRvalue (&WalkState->Operands [0]);
Status = AcpiAmlResolveToValue (&WalkState->Operands [0]);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -653,7 +650,7 @@ DsExecEndOp (
goto Cleanup;
}
if (ObjDesc->Common.Type != ACPI_TYPE_Number)
if (ObjDesc->Common.Type != ACPI_TYPE_NUMBER)
{
DEBUG_PRINT (ACPI_ERROR, ("ExecEndOp: Bad predicate ObjDesc=%X State=%X\n",
ObjDesc, WalkState));
@ -665,31 +662,29 @@ DsExecEndOp (
if (ObjDesc->Number.Value)
{
WalkState->ControlState->Predicate = TRUE;
WalkState->ControlState->Common.Value = TRUE;
}
else
{
/* Predicate is FALSE, we will just toss the rest of the package */
WalkState->ControlState->Predicate = FALSE;
Status = AE_FALSE;
WalkState->ControlState->Common.Value = FALSE;
Status = AE_CTRL_FALSE;
}
DEBUG_PRINT (TRACE_EXEC, ("ExecEndOp: Completed a predicate eval=%X Op=%X\n",
WalkState->ControlState->Predicate, Op));
WalkState->ControlState->Common.Value, Op));
/* Break to debugger to display result */
DEBUG_EXEC (DbDisplayResultObject (ObjDesc));
DEBUG_EXEC (AcpiDbDisplayResultObject (ObjDesc));
/* Delete the predicate result object (we know that we don't need it anymore) and cleanup the stack */
CmDeleteInternalObject (ObjDesc);
AcpiCmRemoveReference (ObjDesc);
ResultObj = NULL;
//DsObjStackPop (1, WalkState);
WalkState->ControlState->Exec = CONTROL_NORMAL;
WalkState->ControlState->Common.State = CONTROL_NORMAL;
}
@ -699,17 +694,18 @@ Cleanup:
{
/* Break to debugger to display result */
DEBUG_EXEC (DbDisplayResultObject (ResultObj));
DEBUG_EXEC (AcpiDbDisplayResultObject (ResultObj));
/* Delete the result op IFF:
/*
* Delete the result op if and only if:
* Parent will not use the result -- such as any non-nested type2 op in a method (parent will be method)
*/
DsDeleteResultIfNotUsed (Op, ResultObj, WalkState);
AcpiDsDeleteResultIfNotUsed (Op, ResultObj, WalkState);
}
/* Always clear the object stack */
WalkState->NumOperands = 0; /* TBD Clear stack of return value, but don't delete it */
WalkState->NumOperands = 0; /* TBD: [Investigate] Clear stack of return value, but don't delete it */
return_ACPI_STATUS (Status);
}

File diff suppressed because it is too large Load Diff

View File

@ -118,19 +118,20 @@
#define __AMCONFIG_C__
#include "acpi.h"
#include "acparser.h"
#include "acinterp.h"
#include "parser.h"
#include "interp.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "acevents.h"
#include "actables.h"
#include "acdispat.h"
#include "namesp.h"
#include "events.h"
#include "tables.h"
#include "dispatch.h"
#define _COMPONENT INTERPRETER
MODULE_NAME ("amconfig");
/*****************************************************************************
*
* FUNCTION: AcpiAmlExecLoadTable
@ -151,8 +152,8 @@ AcpiAmlExecLoadTable (
{
ACPI_STATUS Status;
ACPI_OBJECT_INTERNAL *TableDesc = NULL;
INT8 *TablePtr;
INT8 *TableDataPtr;
char *TablePtr;
char *TableDataPtr;
ACPI_TABLE_HEADER TableHeader;
ACPI_TABLE_DESC TableInfo;
UINT32 i;
@ -168,8 +169,8 @@ AcpiAmlExecLoadTable (
TableHeader.Length = 0;
for (i = 0; i < sizeof (ACPI_TABLE_HEADER); i++)
{
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ADDRESS_SPACE_READ,
i, 8, (UINT32 *) ((INT8 *) &TableHeader + i));
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ADDRESS_SPACE_READ, i, 8,
(UINT32 *) ((char *) &TableHeader + i));
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@ -194,8 +195,8 @@ AcpiAmlExecLoadTable (
for (i = 0; i < TableHeader.Length; i++)
{
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ADDRESS_SPACE_READ,
i, 8, (UINT32 *) (TableDataPtr + i));
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ADDRESS_SPACE_READ, i, 8,
(UINT32 *) (TableDataPtr + i));
if (ACPI_FAILURE (Status))
{
goto Cleanup;
@ -205,16 +206,10 @@ AcpiAmlExecLoadTable (
/* Table must be either an SSDT or a PSDT */
if ((!STRNCMP (TableHeader.Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_PSDT].Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_PSDT].SigLength)) &&
(!STRNCMP (TableHeader.Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].Signature,
AcpiGbl_AcpiTableData[ACPI_TABLE_SSDT].SigLength)))
if ((!STRNCMP (TableHeader.Signature, AcpiGbl_AcpiTableData[TABLE_PSDT].Signature, AcpiGbl_AcpiTableData[TABLE_PSDT].SigLength)) &&
(!STRNCMP (TableHeader.Signature, AcpiGbl_AcpiTableData[TABLE_SSDT].Signature, AcpiGbl_AcpiTableData[TABLE_SSDT].SigLength)))
{
DEBUG_PRINT (ACPI_ERROR,
("Table has invalid signature [%4.4s], must be SSDT or PSDT\n",
TableHeader.Signature));
DEBUG_PRINT (ACPI_ERROR, ("Table has invalid signature [%4.4s], must be SSDT or PSDT\n", TableHeader.Signature));
Status = AE_BAD_SIGNATURE;
goto Cleanup;
}
@ -301,9 +296,8 @@ AcpiAmlExecUnloadTable (
/* TBD: [Errors] Wasn't this done earlier? */
if ((!DdbHandle) ||
(!VALID_DESCRIPTOR_TYPE (DdbHandle, ACPI_DESC_TYPE_INTERNAL)) ||
(((ACPI_OBJECT_INTERNAL *)DdbHandle)->Common.Type !=
INTERNAL_TYPE_REFERENCE))
(!VALID_DESCRIPTOR_TYPE (DdbHandle, DESC_TYPE_ACPI_OBJ)) ||
(((ACPI_OBJECT_INTERNAL *)DdbHandle)->Common.Type != INTERNAL_TYPE_REFERENCE))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@ -365,13 +359,11 @@ AcpiAmlExecReconfiguration (
/* Resolve the operands */
Status = AcpiAmlResolveOperands (Opcode, WALK_OPERANDS);
DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Opcode),
2, "after AcpiAmlResolveOperands");
DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Opcode), 2, "after AcpiAmlResolveOperands");
/* Get the table handle, common for both opcodes */
Status |= AcpiDsObjStackPopObject ((ACPI_OBJECT_INTERNAL **) &DdbHandle,
WalkState);
Status |= AcpiDsObjStackPopObject ((ACPI_OBJECT_INTERNAL **) &DdbHandle, WalkState);
switch (Opcode)
{
@ -381,29 +373,22 @@ AcpiAmlExecReconfiguration (
/* Get the region or field descriptor */
Status |= AcpiDsObjStackPopObject (&RegionDesc, WalkState);
if (ACPI_FAILURE (Status))
if (Status != AE_OK)
{
DEBUG_PRINT (ACPI_ERROR,
("ExecReconfiguration/AML_LOAD_OP: bad operand(s) (0x%X)\n",
Status));
AcpiCmRemoveReference (RegionDesc);
return_ACPI_STATUS (Status);
AcpiAmlAppendOperandDiag (_THIS_MODULE, __LINE__, Opcode, WALK_OPERANDS, 2);
goto Cleanup2;
}
Status = AcpiAmlExecLoadTable (RegionDesc, DdbHandle);
break;
case AML_UNLOAD_OP:
case AML_UN_LOAD_OP:
if (ACPI_FAILURE (Status))
if (Status != AE_OK)
{
DEBUG_PRINT (ACPI_ERROR,
("ExecReconfiguration/AML_UNLOAD_OP: bad operand(s) (0x%X)\n",
Status));
return_ACPI_STATUS (Status);
AcpiAmlAppendOperandDiag (_THIS_MODULE, __LINE__, Opcode, WALK_OPERANDS, 1);
goto Cleanup1;
}
Status = AcpiAmlExecUnloadTable (DdbHandle);
@ -412,14 +397,17 @@ AcpiAmlExecReconfiguration (
default:
DEBUG_PRINT (ACPI_ERROR, ("AmlExecReconfiguration: bad opcode=%X\n",
Opcode));
DEBUG_PRINT (ACPI_ERROR, ("AmlExecReconfiguration: bad opcode=%X\n", Opcode));
Status = AE_AML_BAD_OPCODE;
break;
}
Cleanup2:
AcpiCmRemoveReference (RegionDesc);
Cleanup1:
return_ACPI_STATUS (Status);
}