Prefixed C library macros (MEMSET, etc.) with "ACPI_".

date	2002.02.13.18.54.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:05:54 +00:00
parent 50323ba0c5
commit ef8a76e9f2
2 changed files with 211 additions and 339 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: dsobject - Dispatcher object management routines
* $Revision: 1.86 $
* $Revision: 1.90 $
*
*****************************************************************************/
@ -9,7 +9,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@ -124,7 +124,7 @@
#include "acnamesp.h"
#define _COMPONENT ACPI_DISPATCHER
MODULE_NAME ("dsobject")
ACPI_MODULE_NAME ("dsobject")
/*******************************************************************************
@ -154,13 +154,13 @@ AcpiDsInitOneObject (
void *Context,
void **ReturnValue)
{
ACPI_OBJECT_TYPE8 Type;
ACPI_OBJECT_TYPE Type;
ACPI_STATUS Status;
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
UINT8 TableRevision;
PROC_NAME ("DsInitOneObject");
ACPI_FUNCTION_NAME ("DsInitOneObject");
Info->ObjectCount++;
@ -183,7 +183,6 @@ AcpiDsInitOneObject (
switch (Type)
{
case ACPI_TYPE_REGION:
AcpiDsInitializeRegion (ObjHandle);
@ -268,7 +267,7 @@ AcpiDsInitializeObjects (
ACPI_INIT_WALK_INFO Info;
FUNCTION_TRACE ("DsInitializeObjects");
ACPI_FUNCTION_TRACE ("DsInitializeObjects");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@ -334,7 +333,7 @@ AcpiDsInitObjectFromOp (
ACPI_OPERAND_OBJECT *ObjDesc;
PROC_NAME ("DsInitObjectFromOp");
ACPI_FUNCTION_NAME ("DsInitObjectFromOp");
ObjDesc = *RetObjDesc;
@ -391,7 +390,7 @@ AcpiDsInitObjectFromOp (
if (ObjDesc->Buffer.Length == 0)
{
ObjDesc->Buffer.Pointer = NULL;
REPORT_WARNING (("Buffer created with zero length in AML\n"));
ACPI_REPORT_WARNING (("Buffer created with zero length in AML\n"));
break;
}
@ -422,8 +421,8 @@ AcpiDsInitObjectFromOp (
return (AE_TYPE);
}
MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Data,
ObjDesc->Buffer.Length);
ACPI_MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Data,
ObjDesc->Buffer.Length);
}
break;
@ -449,7 +448,7 @@ AcpiDsInitObjectFromOp (
case ACPI_TYPE_STRING:
ObjDesc->String.Pointer = Op->Value.String;
ObjDesc->String.Length = STRLEN (Op->Value.String);
ObjDesc->String.Length = ACPI_STRLEN (Op->Value.String);
/*
* The string is contained in the ACPI table, don't ever try
@ -538,7 +537,7 @@ AcpiDsBuildInternalSimpleObj (
char *Name;
FUNCTION_TRACE ("DsBuildInternalSimpleObj");
ACPI_FUNCTION_TRACE ("DsBuildInternalSimpleObj");
if (Op->Opcode == AML_INT_NAMEPATH_OP)
@ -551,8 +550,8 @@ AcpiDsBuildInternalSimpleObj (
if (!Op->Node)
{
Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Value.String,
ACPI_TYPE_ANY, IMODE_EXECUTE,
NS_SEARCH_PARENT | NS_DONT_OPEN_SCOPE, NULL,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL,
(ACPI_NAMESPACE_NODE **) &(Op->Node));
if (ACPI_FAILURE (Status))
@ -564,14 +563,14 @@ AcpiDsBuildInternalSimpleObj (
if (Name)
{
REPORT_WARNING (("Reference %s at AML %X not found\n",
ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n",
Name, Op->AmlOffset));
ACPI_MEM_FREE (Name);
}
else
{
REPORT_WARNING (("Reference %s at AML %X not found\n",
ACPI_REPORT_WARNING (("Reference %s at AML %X not found\n",
Op->Value.String, Op->AmlOffset));
}
@ -632,7 +631,7 @@ AcpiDsBuildInternalPackageObj (
ACPI_STATUS Status = AE_OK;
FUNCTION_TRACE ("DsBuildInternalPackageObj");
ACPI_FUNCTION_TRACE ("DsBuildInternalPackageObj");
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
@ -763,7 +762,7 @@ AcpiDsCreateNode (
ACPI_OPERAND_OBJECT *ObjDesc;
FUNCTION_TRACE_PTR ("DsCreateNode", Op);
ACPI_FUNCTION_TRACE_PTR ("DsCreateNode", Op);
/*
@ -797,7 +796,7 @@ AcpiDsCreateNode (
/* Init obj */
Status = AcpiNsAttachObject (Node, ObjDesc, (UINT8) Node->Type);
Status = AcpiNsAttachObject (Node, ObjDesc, Node->Type);
/* Remove local reference to the object */

View File

@ -2,7 +2,7 @@
*
* Module Name: dsopcode - Dispatcher Op Region support and handling of
* "control" opcodes
* $Revision: 1.57 $
* $Revision: 1.73 $
*
*****************************************************************************/
@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@ -127,7 +127,114 @@
#include "actables.h"
#define _COMPONENT ACPI_DISPATCHER
MODULE_NAME ("dsopcode")
ACPI_MODULE_NAME ("dsopcode")
/*****************************************************************************
*
* FUNCTION: AcpiDsExecuteArguments
*
* PARAMETERS: Node - Parent NS node
* ExtraDesc - Has AML pointer and length
*
* RETURN: Status.
*
* DESCRIPTION: Late execution of region or field arguments
*
****************************************************************************/
ACPI_STATUS
AcpiDsExecuteArguments (
ACPI_NAMESPACE_NODE *Node,
ACPI_OPERAND_OBJECT *ExtraDesc)
{
ACPI_STATUS Status;
ACPI_PARSE_OBJECT *Op;
ACPI_WALK_STATE *WalkState;
ACPI_PARSE_OBJECT *Arg;
ACPI_FUNCTION_TRACE ("AcpiDsExecuteArguments");
/*
* Allocate a new parser op to be the root of the parsed
* BufferField tree
*/
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Save the Node for use in AcpiPsParseAml */
Op->Node = AcpiNsGetParentNode (Node);
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT, NULL, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 1);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
return_ACPI_STATUS (Status);
}
WalkState->ParseFlags = 0;
/* Pass1: Parse the entire BufferField declaration */
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE (Status))
{
AcpiPsDeleteParseTree (Op);
return_ACPI_STATUS (Status);
}
/* Get and init the actual FieldUnit Op created above */
Arg = Op->Value.Arg;
Op->Node = Node;
Arg->Node = Node;
AcpiPsDeleteParseTree (Op);
/* Evaluate the address and length arguments for the Buffer Field */
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Op->Node = AcpiNsGetParentNode (Node);
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT, NULL, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 3);
if (ACPI_FAILURE (Status))
{
AcpiDsDeleteWalkState (WalkState);
return_ACPI_STATUS (Status);
}
Status = AcpiPsParseAml (WalkState);
AcpiPsDeleteParseTree (Op);
return_ACPI_STATUS (Status);
}
/*****************************************************************************
@ -149,14 +256,10 @@ AcpiDsGetBufferFieldArguments (
{
ACPI_OPERAND_OBJECT *ExtraDesc;
ACPI_NAMESPACE_NODE *Node;
ACPI_PARSE_OBJECT *Op;
ACPI_PARSE_OBJECT *FieldOp;
ACPI_STATUS Status;
ACPI_TABLE_DESC *TableDesc;
ACPI_WALK_STATE *WalkState;
FUNCTION_TRACE_PTR ("DsGetBufferFieldArguments", ObjDesc);
ACPI_FUNCTION_TRACE_PTR ("DsGetBufferFieldArguments", ObjDesc);
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
@ -164,116 +267,18 @@ AcpiDsGetBufferFieldArguments (
return_ACPI_STATUS (AE_OK);
}
/* Get the AML pointer (method object) and BufferField node */
ExtraDesc = ObjDesc->BufferField.Extra;
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
Node = ObjDesc->BufferField.Node;
DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Field]"));
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Field]"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField JIT Init\n",
(char*)&Node->Name));
(char *) &Node->Name));
/* Execute the AML code for the TermArg arguments */
/*
* Allocate a new parser op to be the root of the parsed
* BufferField tree
*/
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return (AE_NO_MEMORY);
}
/* Save the Node for use in AcpiPsParseAml */
Op->Node = AcpiNsGetParentObject (Node);
/* Get a handle to the parent ACPI table */
Status = AcpiTbHandleToObject (Node->OwnerId, &TableDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 1);
if (ACPI_FAILURE (Status))
{
/* TBD: delete walk state */
return_ACPI_STATUS (Status);
}
/* TBD: No Walk flags?? */
WalkState->ParseFlags = 0;
/* Pass1: Parse the entire BufferField declaration */
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE (Status))
{
AcpiPsDeleteParseTree (Op);
return_ACPI_STATUS (Status);
}
/* Get and init the actual FieldUnit Op created above */
FieldOp = Op->Value.Arg;
Op->Node = Node;
FieldOp = Op->Value.Arg;
FieldOp->Node = Node;
AcpiPsDeleteParseTree (Op);
/* Evaluate the address and length arguments for the OpRegion */
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return (AE_NO_MEMORY);
}
Op->Node = AcpiNsGetParentObject (Node);
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT,
NULL, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 3);
if (ACPI_FAILURE (Status))
{
/* TBD: delete walk state */
return_ACPI_STATUS (Status);
}
Status = AcpiPsParseAml (WalkState);
AcpiPsDeleteParseTree (Op);
/*
* The pseudo-method object is no longer needed since the region is
* now initialized
*/
AcpiUtRemoveReference (ObjDesc->BufferField.Extra);
ObjDesc->BufferField.Extra = NULL;
Status = AcpiDsExecuteArguments (Node, ExtraDesc);
return_ACPI_STATUS (Status);
}
@ -295,16 +300,12 @@ ACPI_STATUS
AcpiDsGetRegionArguments (
ACPI_OPERAND_OBJECT *ObjDesc)
{
ACPI_OPERAND_OBJECT *ExtraDesc = NULL;
ACPI_NAMESPACE_NODE *Node;
ACPI_PARSE_OBJECT *Op;
ACPI_PARSE_OBJECT *RegionOp;
ACPI_STATUS Status;
ACPI_TABLE_DESC *TableDesc;
ACPI_WALK_STATE *WalkState;
ACPI_OPERAND_OBJECT *RegionObj2;
FUNCTION_TRACE_PTR ("DsGetRegionArguments", ObjDesc);
ACPI_FUNCTION_TRACE_PTR ("DsGetRegionArguments", ObjDesc);
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
@ -312,109 +313,23 @@ AcpiDsGetRegionArguments (
return_ACPI_STATUS (AE_OK);
}
RegionObj2 = AcpiNsGetSecondaryObject (ObjDesc);
if (!RegionObj2)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Get the AML pointer (method object) and region node */
ExtraDesc = ObjDesc->Region.Extra;
Node = ObjDesc->Region.Node;
DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Operation Region]"));
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (Node, " [Operation Region]"));
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Init at AML %p\n",
(char*)&Node->Name, ExtraDesc->Extra.AmlStart));
/*
* Allocate a new parser op to be the root of the parsed
* OpRegion tree
*/
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return (AE_NO_MEMORY);
}
/* Save the Node for use in AcpiPsParseAml */
Op->Node = AcpiNsGetParentObject (Node);
/* Get a handle to the parent ACPI table */
Status = AcpiTbHandleToObject (Node->OwnerId, &TableDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT,
Op, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 1);
if (ACPI_FAILURE (Status))
{
/* TBD: delete walk state */
return_ACPI_STATUS (Status);
}
/* TBD: No Walk flags?? */
WalkState->ParseFlags = 0;
/* Parse the entire OpRegion declaration, creating a parse tree */
Status = AcpiPsParseAml (WalkState);
if (ACPI_FAILURE (Status))
{
AcpiPsDeleteParseTree (Op);
return_ACPI_STATUS (Status);
}
/* Get and init the actual RegionOp created above */
RegionOp = Op->Value.Arg;
Op->Node = Node;
(char *) &Node->Name, RegionObj2->Extra.AmlStart));
RegionOp = Op->Value.Arg;
RegionOp->Node = Node;
AcpiPsDeleteParseTree (Op);
/* Evaluate the address and length arguments for the OpRegion */
Op = AcpiPsAllocOp (AML_SCOPE_OP);
if (!Op)
{
return (AE_NO_MEMORY);
}
Op->Node = AcpiNsGetParentObject (Node);
/* Create and initialize a new parser state */
WalkState = AcpiDsCreateWalkState (TABLE_ID_DSDT,
Op, NULL, NULL);
if (!WalkState)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, ExtraDesc->Extra.AmlStart,
ExtraDesc->Extra.AmlLength, NULL, NULL, 3);
if (ACPI_FAILURE (Status))
{
/* TBD: delete walk state */
return_ACPI_STATUS (Status);
}
Status = AcpiPsParseAml (WalkState);
AcpiPsDeleteParseTree (Op);
Status = AcpiDsExecuteArguments (Node, RegionObj2);
return_ACPI_STATUS (Status);
}
@ -444,7 +359,6 @@ AcpiDsInitializeRegion (
/* Namespace is NOT locked */
Status = AcpiEvInitializeRegion (ObjDesc, FALSE);
return (Status);
}
@ -460,21 +374,6 @@ AcpiDsInitializeRegion (
* DESCRIPTION: Get BufferField Buffer and Index
* Called from AcpiDsExecEndOp during BufferField parse tree walk
*
* ACPI SPECIFICATION REFERENCES:
* Each of the Buffer Field opcodes is defined as specified in in-line
* comments below. For each one, use the following definitions.
*
* DefBitField := BitFieldOp SrcBuf BitIdx Destination
* DefByteField := ByteFieldOp SrcBuf ByteIdx Destination
* DefCreateField := CreateFieldOp SrcBuf BitIdx NumBits NameString
* DefDWordField := DWordFieldOp SrcBuf ByteIdx Destination
* DefWordField := WordFieldOp SrcBuf ByteIdx Destination
* BitIndex := TermArg=>Integer
* ByteIndex := TermArg=>Integer
* Destination := NameString
* NumBits := TermArg=>Integer
* SourceBuf := TermArg=>Buffer
*
****************************************************************************/
ACPI_STATUS
@ -496,7 +395,7 @@ AcpiDsEvalBufferFieldOperands (
ACPI_OPERAND_OBJECT *SrcDesc = NULL;
FUNCTION_TRACE_PTR ("DsEvalBufferFieldOperands", Op);
ACPI_FUNCTION_TRACE_PTR ("DsEvalBufferFieldOperands", Op);
/*
@ -523,11 +422,10 @@ AcpiDsEvalBufferFieldOperands (
return_ACPI_STATUS (AE_NOT_EXIST);
}
/* Resolve the operands */
Status = AcpiExResolveOperands (Op->Opcode, WALK_OPERANDS, WalkState);
DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE, AcpiPsGetOpcodeName (Op->Opcode),
Status = AcpiExResolveOperands (Op->Opcode, ACPI_WALK_OPERANDS, WalkState);
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE, AcpiPsGetOpcodeName (Op->Opcode),
WalkState->NumOperands, "after AcpiExResolveOperands");
if (ACPI_FAILURE (Status))
@ -552,18 +450,15 @@ AcpiDsEvalBufferFieldOperands (
OffDesc = WalkState->Operands[1];
SrcDesc = WalkState->Operands[0];
Offset = (UINT32) OffDesc->Integer.Value;
Offset = (UINT32) OffDesc->Integer.Value;
/*
* If ResDesc is a Name, it will be a direct name pointer after
* AcpiExResolveOperands()
*/
if (!VALID_DESCRIPTOR_TYPE (ResDesc, ACPI_DESC_TYPE_NAMED))
if (ACPI_GET_DESCRIPTOR_TYPE (ResDesc) != ACPI_DESC_TYPE_NAMED)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a Node\n",
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "(%s) destination must be a NS Node\n",
AcpiPsGetOpcodeName (Op->Opcode)));
Status = AE_AML_OPERAND_TYPE;
@ -575,79 +470,60 @@ AcpiDsEvalBufferFieldOperands (
*/
switch (Op->Opcode)
{
/* DefCreateField */
case AML_CREATE_FIELD_OP:
/* Offset is in bits, count is in bits */
BitOffset = Offset;
BitCount = (UINT32) CntDesc->Integer.Value;
FieldFlags = ACCESS_BYTE_ACC;
FieldFlags = AML_FIELD_ACCESS_BYTE;
break;
/* DefCreateBitField */
case AML_CREATE_BIT_FIELD_OP:
/* Offset is in bits, Field is one bit */
BitOffset = Offset;
BitCount = 1;
FieldFlags = ACCESS_BYTE_ACC;
FieldFlags = AML_FIELD_ACCESS_BYTE;
break;
/* DefCreateByteField */
case AML_CREATE_BYTE_FIELD_OP:
/* Offset is in bytes, field is one byte */
BitOffset = 8 * Offset;
BitCount = 8;
FieldFlags = ACCESS_BYTE_ACC;
FieldFlags = AML_FIELD_ACCESS_BYTE;
break;
/* DefCreateWordField */
case AML_CREATE_WORD_FIELD_OP:
/* Offset is in bytes, field is one word */
BitOffset = 8 * Offset;
BitCount = 16;
FieldFlags = ACCESS_WORD_ACC;
FieldFlags = AML_FIELD_ACCESS_WORD;
break;
/* DefCreateDWordField */
case AML_CREATE_DWORD_FIELD_OP:
/* Offset is in bytes, field is one dword */
BitOffset = 8 * Offset;
BitCount = 32;
FieldFlags = ACCESS_DWORD_ACC;
FieldFlags = AML_FIELD_ACCESS_DWORD;
break;
/* DefCreateQWordField */
case AML_CREATE_QWORD_FIELD_OP:
/* Offset is in bytes, field is one qword */
BitOffset = 8 * Offset;
BitCount = 64;
FieldFlags = ACCESS_QWORD_ACC;
FieldFlags = AML_FIELD_ACCESS_QWORD;
break;
default:
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
@ -657,7 +533,6 @@ AcpiDsEvalBufferFieldOperands (
goto Cleanup;
}
/*
* Setup field according to the object type
*/
@ -678,12 +553,11 @@ AcpiDsEvalBufferFieldOperands (
goto Cleanup;
}
/*
* Initialize areas of the field object that are common to all fields
* For FieldFlags, use LOCK_RULE = 0 (NO_LOCK), UPDATE_RULE = 0 (UPDATE_PRESERVE)
*/
Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags,
Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
BitOffset, BitCount);
if (ACPI_FAILURE (Status))
{
@ -696,7 +570,6 @@ AcpiDsEvalBufferFieldOperands (
SrcDesc->Common.ReferenceCount = (UINT16) (SrcDesc->Common.ReferenceCount +
ObjDesc->Common.ReferenceCount);
break;
@ -704,13 +577,12 @@ AcpiDsEvalBufferFieldOperands (
default:
if ((SrcDesc->Common.Type > (UINT8) INTERNAL_TYPE_REFERENCE) || !AcpiUtValidObjectType (SrcDesc->Common.Type)) /* TBD: This line MUST be a single line until AcpiSrc can handle it (block deletion) */
if ((SrcDesc->Common.Type > (UINT8) INTERNAL_TYPE_REFERENCE) || !AcpiUtValidObjectType (SrcDesc->Common.Type)) /* This line MUST be a single line until AcpiSrc can handle it (block deletion) */
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
"Tried to create field in invalid object type %X\n",
SrcDesc->Common.Type));
}
else
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
@ -750,7 +622,6 @@ Cleanup:
{
AcpiUtRemoveReference (ResDesc); /* Result descriptor */
}
else
{
/* Now the address and length are valid for this BufferField */
@ -787,7 +658,7 @@ AcpiDsEvalRegionOperands (
ACPI_PARSE_OBJECT *NextOp;
FUNCTION_TRACE_PTR ("DsEvalRegionOperands", Op);
ACPI_FUNCTION_TRACE_PTR ("DsEvalRegionOperands", Op);
/*
@ -813,17 +684,16 @@ AcpiDsEvalRegionOperands (
/* Resolve the length and address operands to numbers */
Status = AcpiExResolveOperands (Op->Opcode, WALK_OPERANDS, WalkState);
Status = AcpiExResolveOperands (Op->Opcode, ACPI_WALK_OPERANDS, WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
DUMP_OPERANDS (WALK_OPERANDS, IMODE_EXECUTE,
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS, ACPI_IMODE_EXECUTE,
AcpiPsGetOpcodeName (Op->Opcode),
1, "after AcpiExResolveOperands");
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
@ -848,9 +718,9 @@ AcpiDsEvalRegionOperands (
ObjDesc->Region.Address = (ACPI_PHYSICAL_ADDRESS) OperandDesc->Integer.Value;
AcpiUtRemoveReference (OperandDesc);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
ObjDesc, HIDWORD(ObjDesc->Region.Address), LODWORD(ObjDesc->Region.Address),
ObjDesc,
ACPI_HIDWORD (ObjDesc->Region.Address), ACPI_LODWORD (ObjDesc->Region.Address),
ObjDesc->Region.Length));
/* Now the address and length are valid for this opregion */
@ -884,7 +754,7 @@ AcpiDsExecBeginControlOp (
ACPI_GENERIC_STATE *ControlState;
PROC_NAME ("DsExecBeginControlOp");
ACPI_FUNCTION_NAME ("DsExecBeginControlOp");
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", Op,
@ -906,20 +776,20 @@ AcpiDsExecBeginControlOp (
Status = AE_NO_MEMORY;
break;
}
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
/*
* Save a pointer to the predicate for multiple executions
* of a loop
*/
WalkState->ControlState->Control.AmlPredicateStart =
WalkState->ParserState.Aml - 1;
/* TBD: can this be removed? */
/*AcpiPsPkgLengthEncodingSize (GET8 (WalkState->ParserState->Aml));*/
break;
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
ControlState->Control.Opcode = Op->Opcode;
/* Push the control state on this walk's control stack */
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
break;
case AML_ELSE_OP:
/* Predicate is in the state object */
@ -932,12 +802,10 @@ AcpiDsExecBeginControlOp (
break;
case AML_RETURN_OP:
break;
default:
break;
}
@ -958,7 +826,6 @@ AcpiDsExecBeginControlOp (
* DESCRIPTION: Handles all control ops encountered during control method
* execution.
*
*
******************************************************************************/
ACPI_STATUS
@ -970,7 +837,7 @@ AcpiDsExecEndControlOp (
ACPI_GENERIC_STATE *ControlState;
PROC_NAME ("DsExecEndControlOp");
ACPI_FUNCTION_NAME ("DsExecEndControlOp");
switch (Op->Opcode)
@ -1060,7 +927,6 @@ AcpiDsExecEndControlOp (
*/
WalkState->ReturnDesc = WalkState->Operands[0];
}
else if ((WalkState->Results) &&
(WalkState->Results->Results.NumResults > 0))
{
@ -1073,20 +939,19 @@ AcpiDsExecEndControlOp (
*
* Allow references created by the Index operator to return unchanged.
*/
if (VALID_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc [0], ACPI_DESC_TYPE_INTERNAL) &&
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_INTERNAL) &&
((WalkState->Results->Results.ObjDesc [0])->Common.Type == INTERNAL_TYPE_REFERENCE) &&
((WalkState->Results->Results.ObjDesc [0])->Reference.Opcode != AML_INDEX_OP))
{
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
}
}
WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0];
}
else
{
/* No return operand */
@ -1130,30 +995,39 @@ AcpiDsExecEndControlOp (
case AML_BREAK_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Break to end of current package, Op=%p\n", Op));
/* TBD: update behavior for ACPI 2.0 */
/*
* As per the ACPI specification:
* "The break operation causes the current package
* execution to complete"
* "Break -- Stop executing the current code package
* at this point"
*
* Returning AE_FALSE here will cause termination of
* the current package, and execution will continue one
* level up, starting with the completion of the parent Op.
*/
Status = AE_CTRL_FALSE;
break;
case AML_CONTINUE_OP: /* ACPI 2.0 */
Status = AE_NOT_IMPLEMENTED;
/* Pop and delete control states until we find a while */
while (WalkState->ControlState &&
(WalkState->ControlState->Control.Opcode != AML_WHILE_OP))
{
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
AcpiUtDeleteGenericState (ControlState);
}
/* No while found? */
if (!WalkState->ControlState)
{
return (AE_AML_NO_WHILE);
}
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
/* Return status depending on opcode */
if (Op->Opcode == AML_BREAK_OP)
{
Status = AE_CTRL_BREAK;
}
else
{
Status = AE_CTRL_CONTINUE;
}
break;
@ -1166,7 +1040,6 @@ AcpiDsExecEndControlOp (
break;
}
return (Status);
}