All interpreter operand objects (both arguments and targets) are now

deleted in the dispatcher.  ExStore no longer deletes targets.  Simplifies
operand deletion and error handling.


date	2001.10.10.22.53.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:11:56 +00:00
parent ea2a4cab64
commit a3bf0ae1c3
2 changed files with 116 additions and 41 deletions

View File

@ -2,7 +2,7 @@
*
* Module Name: dswexec - Dispatcher method execution callbacks;
* dispatch to interpreter.
* $Revision: 1.73 $
* $Revision: 1.77 $
*
*****************************************************************************/
@ -129,19 +129,21 @@
#define _COMPONENT ACPI_DISPATCHER
MODULE_NAME ("dswexec")
ACPI_EXECUTE_OP AcpiGbl_OpClassDispatch [] = {
AcpiExMonadic1,
AcpiExMonadic2,
AcpiExMonadic2R,
AcpiExDyadic1,
AcpiExDyadic2,
AcpiExDyadic2R,
AcpiExDyadicType21,
AcpiExTriadic,
AcpiExHexadic};
/*
* Dispatch tables for opcode classes
*/
ACPI_EXECUTE_OP AcpiGbl_OpTypeDispatch [] = {
AcpiExOpcode_1A_0T_0R,
AcpiExOpcode_1A_0T_1R,
AcpiExOpcode_1A_1T_0R,
AcpiExOpcode_1A_1T_1R,
AcpiExOpcode_2A_0T_0R,
AcpiExOpcode_2A_0T_1R,
AcpiExOpcode_2A_1T_1R,
AcpiExOpcode_2A_2T_1R,
AcpiExOpcode_3A_0T_0R,
AcpiExOpcode_3A_1T_1R,
AcpiExOpcode_6A_0T_1R};
/*****************************************************************************
*
@ -340,7 +342,7 @@ AcpiDsExecBeginOp (
}
OpcodeClass = ACPI_GET_OP_CLASS (WalkState->OpInfo);
OpcodeClass = WalkState->OpInfo->Class;
/* We want to send namepaths to the load code */
@ -443,8 +445,8 @@ AcpiDsExecEndOp (
Op = WalkState->Op;
OpType = ACPI_GET_OP_TYPE (WalkState->OpInfo);
OpClass = ACPI_GET_OP_CLASS (WalkState->OpInfo);
OpType = WalkState->OpInfo->Type;
OpClass = WalkState->OpInfo->Class;
if (OpClass == AML_CLASS_UNKNOWN)
{
@ -528,15 +530,21 @@ AcpiDsExecEndOp (
* routine. There is one routine per opcode "type" based upon the
* number of opcode arguments and return type.
*/
Status = AcpiGbl_OpClassDispatch [OpType] (WalkState);
Status = AcpiGbl_OpTypeDispatch [OpType] (WalkState);
/* Clear the operand stack */
/* Delete argument objects and clear the operand stack */
for (i = 0; i < WalkState->NumOperands; i++)
{
/*
* Remove a reference to all operands, including both
* "Arguments" and "Targets".
*/
AcpiUtRemoveReference (WalkState->Operands[i]);
WalkState->Operands[i] = NULL;
}
WalkState->NumOperands = 0;
/*

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dswload - Dispatcher namespace load callbacks
* $Revision: 1.45 $
* $Revision: 1.49 $
*
*****************************************************************************/
@ -129,6 +129,55 @@
MODULE_NAME ("dswload")
/*******************************************************************************
*
* FUNCTION: AcpiDsInitCallbacks
*
* PARAMETERS: WalkState - Current state of the parse tree walk
* PassNumber - 1, 2, or 3
*
* RETURN: Status
*
* DESCRIPTION: Init walk state callbacks
*
******************************************************************************/
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber)
{
switch (PassNumber)
{
case 1:
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
WalkState->AscendingCallback = AcpiDsLoad1EndOp;
break;
case 2:
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsLoad2BeginOp;
WalkState->AscendingCallback = AcpiDsLoad2EndOp;
break;
case 3:
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsExecBeginOp;
WalkState->AscendingCallback = AcpiDsExecEndOp;
break;
default:
return (AE_BAD_PARAMETER);
break;
}
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiDsLoad1BeginOp
@ -180,7 +229,7 @@ AcpiDsLoad1BeginOp (
}
}
Path = AcpiPsGetNextNamestring (WalkState->ParserState);
Path = AcpiPsGetNextNamestring (&WalkState->ParserState);
/* Map the raw opcode into an internal object type */
@ -230,7 +279,7 @@ AcpiDsLoad1BeginOp (
* can get it again quickly when this scope is closed
*/
Op->Node = Node;
AcpiPsAppendArg (AcpiPsGetParentScope (WalkState->ParserState), Op);
AcpiPsAppendArg (AcpiPsGetParentScope (&WalkState->ParserState), Op);
*OutOp = Op;
return (Status);
@ -380,7 +429,7 @@ AcpiDsLoad2BeginOp (
else
{
BufferPtr = AcpiPsGetNextNamestring (WalkState->ParserState);
BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
}
@ -560,28 +609,29 @@ AcpiDsLoad2EndOp (
/*
* Named operations are as follows:
*
* AML_SCOPE
* AML_DEVICE
* AML_THERMALZONE
* AML_METHOD
* AML_POWERRES
* AML_PROCESSOR
* AML_FIELD
* AML_INDEXFIELD
* AML_BANKFIELD
* AML_NAMEDFIELD
* AML_NAME
* AML_ALIAS
* AML_MUTEX
* AML_EVENT
* AML_OPREGION
* AML_CREATEFIELD
* AML_BANKFIELD
* AML_CREATEBITFIELD
* AML_CREATEBYTEFIELD
* AML_CREATEWORDFIELD
* AML_CREATEDWORDFIELD
* AML_CREATEFIELD
* AML_CREATEQWORDFIELD
* AML_CREATEWORDFIELD
* AML_DATA_REGION
* AML_DEVICE
* AML_EVENT
* AML_FIELD
* AML_INDEXFIELD
* AML_METHOD
* AML_METHODCALL
* AML_MUTEX
* AML_NAME
* AML_NAMEDFIELD
* AML_OPREGION
* AML_POWERRES
* AML_PROCESSOR
* AML_SCOPE
* AML_THERMALZONE
*/
@ -835,7 +885,7 @@ AcpiDsLoad2EndOp (
}
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"LOADING-Opregion: Op=%p State=%p NamedObj=%p\n",
"LOADING-OpRegion: Op=%p State=%p NamedObj=%p\n",
Op, WalkState, Node));
/*
@ -852,6 +902,22 @@ AcpiDsLoad2EndOp (
break;
case AML_DATA_REGION_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
"LOADING-DataRegion: Op=%p State=%p NamedObj=%p\n",
Op, WalkState, Node));
Status = AcpiDsCreateOperands (WalkState, Arg);
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
Status = AcpiExCreateTableRegion (WalkState);
break;
/* Namespace Modifier Opcodes */
case AML_ALIAS_OP:
@ -904,7 +970,8 @@ Cleanup:
/* Remove the Node pushed at the very beginning */
AcpiDsObjStackPop (1, WalkState);
WalkState->Operands[0] = NULL;
WalkState->NumOperands = 0;
return (Status);
}