mirror of
https://github.com/acpica/acpica/
synced 2025-01-18 15:39:18 +03:00
Remove non-ANSI (//) Comments
date 2000.06.19.21.46.00; author rmoore1; state Exp;
This commit is contained in:
parent
cbd2800f4b
commit
59ecaf870f
@ -1,6 +1,6 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
*
|
||||
* Module Name: dsutils - Dispatcher utilities
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -38,9 +38,9 @@
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
@ -48,11 +48,11 @@
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
@ -86,7 +86,7 @@
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
@ -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
|
||||
@ -141,13 +141,13 @@
|
||||
*
|
||||
* DESCRIPTION: Used after interpretation of an opcode. If there is an internal
|
||||
* result descriptor, check if the parent opcode will actually use
|
||||
* this result. If not, delete the result now so that it will
|
||||
* this result. If not, delete the result now so that it will
|
||||
* not become orphaned.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void
|
||||
DsDeleteResultIfNotUsed (
|
||||
AcpiDsDeleteResultIfNotUsed (
|
||||
ACPI_GENERIC_OP *Op,
|
||||
ACPI_OBJECT_INTERNAL *ResultObj,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
@ -174,30 +174,30 @@ DsDeleteResultIfNotUsed (
|
||||
|
||||
if (!Op->Parent)
|
||||
{
|
||||
/*
|
||||
/*
|
||||
* If there is no parent, the result can't possibly be used!
|
||||
* (An executing method typically has no parent, since each method is parsed separately
|
||||
*/
|
||||
|
||||
/* 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));
|
||||
@ -226,7 +226,7 @@ DsDeleteResultIfNotUsed (
|
||||
switch (ParentInfo->Flags & OP_INFO_TYPE)
|
||||
{
|
||||
/*
|
||||
* In these cases, the parent will never use the return object, so delete it
|
||||
* In these cases, the parent will never use the return object, so delete it
|
||||
* here and now.
|
||||
*/
|
||||
case OPTYPE_CONTROL: /* IF, ELSE, WHILE only */
|
||||
@ -237,16 +237,16 @@ 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;
|
||||
|
||||
/*
|
||||
/*
|
||||
* In all other cases. the parent will actually use the return object, so keep it.
|
||||
*/
|
||||
default:
|
||||
@ -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);
|
||||
@ -312,49 +312,49 @@ DsCreateOperand (
|
||||
/* All prefixes have been handled, and the name is in NameString */
|
||||
|
||||
/*
|
||||
* Differentiate between a namespace "create" operation versus a "lookup" operation
|
||||
* (IMODE_LoadPass2 vs. IMODE_Execute) in order to support the creation of namespace
|
||||
* Differentiate between a namespace "create" operation versus a "lookup" operation
|
||||
* (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
|
||||
* The only case where we pass through (ignore) a NOT_FOUND error is for the
|
||||
* CondRefOf opcode.
|
||||
*/
|
||||
|
||||
if (Status == AE_NOT_FOUND)
|
||||
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;
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ DsCreateOperand (
|
||||
}
|
||||
|
||||
/* Check status from the lookup */
|
||||
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@ -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 (AcpiDbDisplayArgumentObject (WalkState->Operands [WalkState->NumOperands - 1]));
|
||||
|
||||
// DEBUG_EXEC (DbDisplayArgumentObject (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,14 +489,14 @@ DsCreateOperand (
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DsCreateOperands (
|
||||
AcpiDsCreateOperands (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_GENERIC_OP *FirstArg)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_OP *Arg;
|
||||
UINT32 ArgsPushed = 0;
|
||||
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsCreateOperands", FirstArg);
|
||||
|
||||
@ -509,13 +508,13 @@ DsCreateOperands (
|
||||
while (Arg)
|
||||
{
|
||||
|
||||
Status = DsCreateOperand (WalkState, Arg);
|
||||
Status = AcpiDsCreateOperand (WalkState, Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH, ("DsCreateOperands: Arg #%d (%p) done, Arg1=%p\n",
|
||||
DEBUG_PRINT (TRACE_DISPATCH, ("DsCreateOperands: Arg #%d (%p) done, Arg1=%p\n",
|
||||
ArgsPushed, Arg, FirstArg));
|
||||
|
||||
/* Move on to next argument, if any */
|
||||
@ -528,22 +527,22 @@ DsCreateOperands (
|
||||
|
||||
|
||||
Cleanup:
|
||||
/*
|
||||
/*
|
||||
* We must undo everything done above; meaning that we must pop everything off
|
||||
* of the operand stack and delete those objects
|
||||
* 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,30 +554,29 @@ Cleanup:
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DsResolveOperands (
|
||||
AcpiDsResolveOperands (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
UINT32 i;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsResolveOperands", WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* Attempt to resolve each of the valid operands
|
||||
/*
|
||||
* Attempt to resolve each of the valid operands
|
||||
* Method arguments are passed by value, not by reference
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
@ -599,22 +597,22 @@ DsResolveOperands (
|
||||
* RETURN: The ACPI type associated with the opcode
|
||||
*
|
||||
* DESCRIPTION: Convert a raw AML opcode to the associated ACPI data type,
|
||||
* if any. If the opcode returns a value as part of the
|
||||
* if any. If the opcode returns a value as part of the
|
||||
* intepreter execution, a flag is returned in OutFlags.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
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_NAMEPATH_OP:
|
||||
DataType = ACPI_TYPE_Any;
|
||||
case AML_NAME_OP: /* NameOp - special code in original */
|
||||
case AML_NAMEPATH_OP:
|
||||
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;
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dswexec - Dispatcher method execution callbacks;
|
||||
*
|
||||
* Module Name: dswexec - Dispatcher method execution callbacks;
|
||||
* Dispatch to interpreter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
@ -39,9 +39,9 @@
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
@ -49,11 +49,11 @@
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
@ -87,7 +87,7 @@
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
@ -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
|
||||
@ -143,13 +143,13 @@
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the execution of control
|
||||
* methods. This is where most operators and operands are
|
||||
* methods. This is where most operators and operands are
|
||||
* dispatched to the interpreter.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
DsExecBeginOp (
|
||||
AcpiDsExecBeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_GENERIC_OP *Op)
|
||||
{
|
||||
@ -164,7 +164,7 @@ DsExecBeginOp (
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* If the previous opcode was a conditional, this opcode
|
||||
* must be the beginning of the associated predicate.
|
||||
@ -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 = PsGetOpcodeInfo (Op->Opcode);
|
||||
OpInfo = AcpiPsGetOpcodeInfo (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
|
||||
@ -241,13 +240,13 @@ DsExecBeginOp (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the execution of control
|
||||
* methods. The only thing we really need to do here is to
|
||||
* methods. The only thing we really need to do here is to
|
||||
* notice the beginning of IF, ELSE, and WHILE blocks.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
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,12 +487,12 @@ DsExecEndOp (
|
||||
|
||||
/* 1 Operand, 0 ExternalResult, 0 InternalResult */
|
||||
|
||||
Status = DsExecEndControlOp (WalkState, Op);
|
||||
Status = AcpiDsExecEndControlOp (WalkState, Op);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case OPTYPE_METHOD_CALL:
|
||||
case OPTYPE_METHOD_CALL:
|
||||
|
||||
DEBUG_PRINT (TRACE_DISPATCH, ("ExecEndOp: Method invocation, Op=%X\n", Op));
|
||||
|
||||
@ -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,12 +584,12 @@ DsExecEndOp (
|
||||
|
||||
|
||||
default:
|
||||
/* TBD: Nothing to do here at this time */
|
||||
/* Nothing needs to be done */
|
||||
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -605,22 +604,20 @@ DsExecEndOp (
|
||||
|
||||
|
||||
/*
|
||||
* Check if we just completed the evaluation of a conditional predicate
|
||||
* Check if we just completed the evaluation of a conditional predicate
|
||||
*/
|
||||
|
||||
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,18 +694,19 @@ 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
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user