本文整理汇总了C++中AcpiPsGetOpcodeName函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiPsGetOpcodeName函数的具体用法?C++ AcpiPsGetOpcodeName怎么用?C++ AcpiPsGetOpcodeName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AcpiPsGetOpcodeName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AcpiExOpcode_1A_1T_0R
ACPI_STATUS
AcpiExOpcode_1A_1T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the AML opcode */
switch (WalkState->Opcode)
{
case AML_LOAD_OP:
Status = AcpiExLoadOp (Operand[0], Operand[1], WalkState);
break;
default: /* Unknown opcode */
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
Cleanup:
return_ACPI_STATUS (Status);
}
开发者ID:CSharpLover,项目名称:MosquitOS,代码行数:34,代码来源:exoparg1.c
示例2: AcpiExOpcode_2A_0T_0R
ACPI_STATUS
AcpiExOpcode_2A_0T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_NAMESPACE_NODE *Node;
UINT32 Value;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_0T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the opcode */
switch (WalkState->Opcode)
{
case AML_NOTIFY_OP: /* Notify (NotifyObject, NotifyValue) */
/* The first operand is a namespace node */
Node = (ACPI_NAMESPACE_NODE *) Operand[0];
/* Second value is the notify value */
Value = (UINT32) Operand[1]->Integer.Value;
/* Are notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
ACPI_ERROR ((AE_INFO,
"Unexpected notify object type [%s]",
AcpiUtGetTypeName (Node->Type)));
Status = AE_AML_OPERAND_TYPE;
break;
}
/*
* Dispatch the notify to the appropriate handler
* NOTE: the request is queued for execution after this method
* completes. The notify handlers are NOT invoked synchronously
* from this thread -- because handlers may in turn run other
* control methods.
*/
Status = AcpiEvQueueNotifyRequest (Node, Value);
break;
default:
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
}
return_ACPI_STATUS (Status);
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:60,代码来源:exoparg2.c
示例3: AcpiExOpcode_1A_0T_0R
ACPI_STATUS
AcpiExOpcode_1A_0T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the AML opcode */
switch (WalkState->Opcode)
{
case AML_RELEASE_OP: /* Release (MutexObject) */
Status = AcpiExReleaseMutex (Operand[0], WalkState);
break;
case AML_RESET_OP: /* Reset (EventObject) */
Status = AcpiExSystemResetEvent (Operand[0]);
break;
case AML_SIGNAL_OP: /* Signal (EventObject) */
Status = AcpiExSystemSignalEvent (Operand[0]);
break;
case AML_SLEEP_OP: /* Sleep (MsecTime) */
Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value);
break;
case AML_STALL_OP: /* Stall (UsecTime) */
Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value);
break;
case AML_UNLOAD_OP: /* Unload (Handle) */
Status = AcpiExUnloadTable (Operand[0]);
break;
default: /* Unknown opcode */
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
break;
}
return_ACPI_STATUS (Status);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:56,代码来源:exoparg1.c
示例4: AcpiExOpcode_0A_0T_1R
ACPI_STATUS
AcpiExOpcode_0A_0T_1R (
ACPI_WALK_STATE *WalkState)
{
ACPI_STATUS Status = AE_OK;
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_FUNCTION_TRACE_STR (ExOpcode_0A_0T_1R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the AML opcode */
switch (WalkState->Opcode)
{
case AML_TIMER_OP: /* Timer () */
/* Create a return object of type Integer */
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
#if ACPI_MACHINE_WIDTH != 16
ReturnDesc->Integer.Value = AcpiOsGetTimer ();
#endif
break;
default: /* Unknown opcode */
ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
break;
}
Cleanup:
/* Delete return object on error */
if ((ACPI_FAILURE (Status)) || WalkState->ResultObj)
{
AcpiUtRemoveReference (ReturnDesc);
}
else
{
/* Save the return value */
WalkState->ResultObj = ReturnDesc;
}
return_ACPI_STATUS (Status);
}
开发者ID:andreiw,项目名称:polaris,代码行数:56,代码来源:exoparg1.c
示例5: AcpiExOpcode_3A_0T_0R
ACPI_STATUS
AcpiExOpcode_3A_0T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_SIGNAL_FATAL_INFO *Fatal;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR (ExOpcode_3A_0T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
switch (WalkState->Opcode)
{
case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(UINT32) Operand[0]->Integer.Value,
(UINT32) Operand[1]->Integer.Value,
(UINT32) Operand[2]->Integer.Value));
Fatal = ACPI_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
if (Fatal)
{
Fatal->Type = (UINT32) Operand[0]->Integer.Value;
Fatal->Code = (UINT32) Operand[1]->Integer.Value;
Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
}
/* Always signal the OS! */
Status = AcpiOsSignal (ACPI_SIGNAL_FATAL, Fatal);
/* Might return while OS is shutting down, just continue */
ACPI_FREE (Fatal);
break;
default:
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
Cleanup:
return_ACPI_STATUS (Status);
}
开发者ID:BillTheBest,项目名称:libuinet,代码行数:54,代码来源:exoparg3.c
示例6: AcpiExResolveNodeToValue
//.........这里部分代码省略.........
case ACPI_TYPE_INTEGER:
if (ACPI_GET_OBJECT_TYPE (SourceDesc) != ACPI_TYPE_INTEGER)
{
ACPI_ERROR ((AE_INFO, "Object not a Integer, type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* Return an additional reference to the object */
ObjDesc = SourceDesc;
AcpiUtAddReference (ObjDesc);
break;
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"FieldRead Node=%p SourceDesc=%p Type=%X\n",
Node, SourceDesc, EntryType));
Status = AcpiExReadDataFromField (WalkState, SourceDesc, &ObjDesc);
break;
/* For these objects, just return the object attached to the Node */
case ACPI_TYPE_MUTEX:
case ACPI_TYPE_METHOD:
case ACPI_TYPE_POWER:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_REGION:
/* Return an additional reference to the object */
ObjDesc = SourceDesc;
AcpiUtAddReference (ObjDesc);
break;
/* TYPE_ANY is untyped, and thus there is no object associated with it */
case ACPI_TYPE_ANY:
ACPI_ERROR ((AE_INFO,
"Untyped entry %p, no attached object!", Node));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
case ACPI_TYPE_LOCAL_REFERENCE:
switch (SourceDesc->Reference.Opcode)
{
case AML_LOAD_OP:
/* This is a DdbHandle */
/* Return an additional reference to the object */
case AML_REF_OF_OP:
ObjDesc = SourceDesc;
AcpiUtAddReference (ObjDesc);
break;
default:
/* No named references are allowed here */
ACPI_ERROR ((AE_INFO,
"Unsupported Reference opcode %X (%s)",
SourceDesc->Reference.Opcode,
AcpiPsGetOpcodeName (SourceDesc->Reference.Opcode)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
break;
default:
/* Default case is for unknown types */
ACPI_ERROR ((AE_INFO,
"Node %p - Unknown object type %X",
Node, EntryType));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
} /* switch (EntryType) */
/* Return the object descriptor */
*ObjectPtr = (void *) ObjDesc;
return_ACPI_STATUS (Status);
}
开发者ID:andreiw,项目名称:polaris,代码行数:101,代码来源:exresnte.c
示例7: AcpiDsEvalBankFieldOperands
ACPI_STATUS
AcpiDsEvalBankFieldOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_OPERAND_OBJECT *OperandDesc;
ACPI_NAMESPACE_NODE *Node;
ACPI_PARSE_OBJECT *NextOp;
ACPI_PARSE_OBJECT *Arg;
ACPI_FUNCTION_TRACE_PTR (DsEvalBankFieldOperands, Op);
/*
* This is where we evaluate the BankValue field of the
* BankField declaration
*/
/* NextOp points to the op that holds the Region */
NextOp = Op->Common.Value.Arg;
/* NextOp points to the op that holds the Bank Register */
NextOp = NextOp->Common.Next;
/* NextOp points to the op that holds the Bank Value */
NextOp = NextOp->Common.Next;
/*
* Set proper index into operand stack for AcpiDsObjStackPush
* invoked inside AcpiDsCreateOperand.
*
* We use WalkState->Operands[0] to store the evaluated BankValue
*/
WalkState->OperandIndex = 0;
Status = AcpiDsCreateOperand (WalkState, NextOp, 0);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiExResolveToValue (&WalkState->Operands[0], WalkState);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
ACPI_DUMP_OPERANDS (ACPI_WALK_OPERANDS,
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), 1);
/*
* Get the BankValue operand and save it
* (at Top of stack)
*/
OperandDesc = WalkState->Operands[0];
/* Arg points to the start Bank Field */
Arg = AcpiPsGetArg (Op, 4);
while (Arg)
{
/* Ignore OFFSET and ACCESSAS terms here */
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
{
Node = Arg->Common.Node;
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
return_ACPI_STATUS (AE_NOT_EXIST);
}
ObjDesc->BankField.Value = (UINT32) OperandDesc->Integer.Value;
}
/* Move to next field in the list */
Arg = Arg->Common.Next;
}
AcpiUtRemoveReference (OperandDesc);
return_ACPI_STATUS (Status);
}
开发者ID:ModeenF,项目名称:haiku,代码行数:89,代码来源:dsopcode.c
示例8: AcpiDsInitBufferField
static ACPI_STATUS
AcpiDsInitBufferField (
UINT16 AmlOpcode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT *BufferDesc,
ACPI_OPERAND_OBJECT *OffsetDesc,
ACPI_OPERAND_OBJECT *LengthDesc,
ACPI_OPERAND_OBJECT *ResultDesc)
{
UINT32 Offset;
UINT32 BitOffset;
UINT32 BitCount;
UINT8 FieldFlags;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_PTR (DsInitBufferField, ObjDesc);
/* Host object must be a Buffer */
if (BufferDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
"Target of Create Field is not a Buffer object - %s",
AcpiUtGetObjectTypeName (BufferDesc)));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
/*
* The last parameter to all of these opcodes (ResultDesc) started
* out as a NameString, and should therefore now be a NS node
* after resolution in AcpiExResolveOperands().
*/
if (ACPI_GET_DESCRIPTOR_TYPE (ResultDesc) != ACPI_DESC_TYPE_NAMED)
{
ACPI_ERROR ((AE_INFO,
"(%s) destination not a NS Node [%s]",
AcpiPsGetOpcodeName (AmlOpcode),
AcpiUtGetDescriptorName (ResultDesc)));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
Offset = (UINT32) OffsetDesc->Integer.Value;
/*
* Setup the Bit offsets and counts, according to the opcode
*/
switch (AmlOpcode)
{
case AML_CREATE_FIELD_OP:
/* Offset is in bits, count is in bits */
FieldFlags = AML_FIELD_ACCESS_BYTE;
BitOffset = Offset;
BitCount = (UINT32) LengthDesc->Integer.Value;
/* Must have a valid (>0) bit count */
if (BitCount == 0)
{
ACPI_ERROR ((AE_INFO,
"Attempt to CreateField of length zero"));
Status = AE_AML_OPERAND_VALUE;
goto Cleanup;
}
break;
case AML_CREATE_BIT_FIELD_OP:
/* Offset is in bits, Field is one bit */
BitOffset = Offset;
BitCount = 1;
FieldFlags = AML_FIELD_ACCESS_BYTE;
break;
case AML_CREATE_BYTE_FIELD_OP:
/* Offset is in bytes, field is one byte */
BitOffset = 8 * Offset;
BitCount = 8;
FieldFlags = AML_FIELD_ACCESS_BYTE;
break;
case AML_CREATE_WORD_FIELD_OP:
/* Offset is in bytes, field is one word */
BitOffset = 8 * Offset;
BitCount = 16;
FieldFlags = AML_FIELD_ACCESS_WORD;
break;
//.........这里部分代码省略.........
开发者ID:ModeenF,项目名称:haiku,代码行数:101,代码来源:dsopcode.c
示例9: AcpiExOpcode_1A_0T_1R
ACPI_STATUS
AcpiExOpcode_1A_0T_1R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *TempDesc;
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_STATUS Status = AE_OK;
UINT32 Type;
UINT64 Value;
ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_0T_1R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the AML opcode */
switch (WalkState->Opcode)
{
case AML_LNOT_OP: /* LNot (Operand) */
ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
/*
* Set result to ONES (TRUE) if Value == 0. Note:
* ReturnDesc->Integer.Value is initially == 0 (FALSE) from above.
*/
if (!Operand[0]->Integer.Value)
{
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
}
break;
case AML_DECREMENT_OP: /* Decrement (Operand) */
case AML_INCREMENT_OP: /* Increment (Operand) */
/*
* Create a new integer. Can't just get the base integer and
* increment it because it may be an Arg or Field.
*/
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
/*
* Since we are expecting a Reference operand, it can be either a
* NS Node or an internal object.
*/
TempDesc = Operand[0];
if (ACPI_GET_DESCRIPTOR_TYPE (TempDesc) == ACPI_DESC_TYPE_OPERAND)
{
/* Internal reference object - prevent deletion */
AcpiUtAddReference (TempDesc);
}
/*
* Convert the Reference operand to an Integer (This removes a
* reference on the Operand[0] object)
*
* NOTE: We use LNOT_OP here in order to force resolution of the
* reference operand to an actual integer.
*/
Status = AcpiExResolveOperands (AML_LNOT_OP, &TempDesc, WalkState);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
"While resolving operands for [%s]",
AcpiPsGetOpcodeName (WalkState->Opcode)));
goto Cleanup;
}
/*
* TempDesc is now guaranteed to be an Integer object --
* Perform the actual increment or decrement
*/
if (WalkState->Opcode == AML_INCREMENT_OP)
{
ReturnDesc->Integer.Value = TempDesc->Integer.Value + 1;
}
else
{
ReturnDesc->Integer.Value = TempDesc->Integer.Value - 1;
}
/* Finished with this Integer object */
AcpiUtRemoveReference (TempDesc);
/*
* Store the result back (indirectly) through the original
//.........这里部分代码省略.........
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:101,代码来源:exoparg1.c
示例10: AcpiExOpcode_3A_1T_1R
ACPI_STATUS
AcpiExOpcode_3A_1T_1R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
char *Buffer = NULL;
ACPI_STATUS Status = AE_OK;
UINT64 Index;
ACPI_SIZE Length;
ACPI_FUNCTION_TRACE_STR (ExOpcode_3A_1T_1R,
AcpiPsGetOpcodeName (WalkState->Opcode));
switch (WalkState->Opcode)
{
case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
/*
* Create the return object. The Source operand is guaranteed to be
* either a String or a Buffer, so just use its type.
*/
ReturnDesc = AcpiUtCreateInternalObject (
(Operand[0])->Common.Type);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
/* Get the Integer values from the objects */
Index = Operand[1]->Integer.Value;
Length = (ACPI_SIZE) Operand[2]->Integer.Value;
/*
* If the index is beyond the length of the String/Buffer, or if the
* requested length is zero, return a zero-length String/Buffer
*/
if (Index >= Operand[0]->String.Length)
{
Length = 0;
}
/* Truncate request if larger than the actual String/Buffer */
else if ((Index + Length) > Operand[0]->String.Length)
{
Length = (ACPI_SIZE) Operand[0]->String.Length -
(ACPI_SIZE) Index;
}
/* Strings always have a sub-pointer, not so for buffers */
switch ((Operand[0])->Common.Type)
{
case ACPI_TYPE_STRING:
/* Always allocate a new buffer for the String */
Buffer = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) Length + 1);
if (!Buffer)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
break;
case ACPI_TYPE_BUFFER:
/* If the requested length is zero, don't allocate a buffer */
if (Length > 0)
{
/* Allocate a new buffer for the Buffer */
Buffer = ACPI_ALLOCATE_ZEROED (Length);
if (!Buffer)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
}
break;
default: /* Should not happen */
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
if (Buffer)
{
/* We have a buffer, copy the portion requested */
ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index,
Length);
}
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:libuinet,代码行数:101,代码来源:exoparg3.c
示例11: AcpiDsExecEndOp
//.........这里部分代码省略.........
WalkState);
}
if (ACPI_SUCCESS (Status))
{
/*
* Dispatch the request to the appropriate interpreter handler
* routine. There is one routine per opcode "type" based upon the
* number of opcode arguments and return type.
*/
Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
}
else
{
/*
* Treat constructs of the form "Store(LocalX,LocalX)" as noops when the
* Local is uninitialized.
*/
if ((Status == AE_AML_UNINITIALIZED_LOCAL) &&
(WalkState->Opcode == AML_STORE_OP) &&
(WalkState->Operands[0]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
(WalkState->Operands[1]->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
(WalkState->Operands[0]->Reference.Class ==
WalkState->Operands[1]->Reference.Class) &&
(WalkState->Operands[0]->Reference.Value ==
WalkState->Operands[1]->Reference.Value))
{
Status = AE_OK;
}
else
{
ACPI_EXCEPTION ((AE_INFO, Status,
"While resolving operands for [%s]",
AcpiPsGetOpcodeName (WalkState->Opcode)));
}
}
/* Always delete the argument objects and clear the operand stack */
AcpiDsClearOperands (WalkState);
/*
* If a result object was returned from above, push it on the
* current result stack
*/
if (ACPI_SUCCESS (Status) &&
WalkState->ResultObj)
{
Status = AcpiDsResultPush (WalkState->ResultObj, WalkState);
}
break;
default:
switch (OpType)
{
case AML_TYPE_CONTROL: /* Type 1 opcode, IF/ELSE/WHILE/NOOP */
/* 1 Operand, 0 ExternalResult, 0 InternalResult */
Status = AcpiDsExecEndControlOp (WalkState, Op);
break;
case AML_TYPE_METHOD_CALL:
/*
开发者ID:AmirAbrams,项目名称:haiku,代码行数:67,代码来源:dswexec.c
示例12: AcpiExResolveOperands
//.........这里部分代码省略.........
/* Valid operand */
break;
default:
ACPI_ERROR ((AE_INFO,
"Needed [Region/Buffer], found [%s] %p",
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
goto NextOperand;
case ARGI_DATAREFOBJ:
/* Used by the Store() operator only */
switch (ObjDesc->Common.Type)
{
case ACPI_TYPE_INTEGER:
case ACPI_TYPE_PACKAGE:
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_BUFFER_FIELD:
case ACPI_TYPE_LOCAL_REFERENCE:
case ACPI_TYPE_LOCAL_REGION_FIELD:
case ACPI_TYPE_LOCAL_BANK_FIELD:
case ACPI_TYPE_LOCAL_INDEX_FIELD:
case ACPI_TYPE_DDB_HANDLE:
/* Valid operand */
break;
default:
if (AcpiGbl_EnableInterpreterSlack)
{
/*
* Enable original behavior of Store(), allowing any and all
* objects as the source operand. The ACPI spec does not
* allow this, however.
*/
break;
}
if (TargetOp == AML_DEBUG_OP)
{
/* Allow store of any object to the Debug object */
break;
}
ACPI_ERROR ((AE_INFO,
"Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
goto NextOperand;
default:
/* Unknown type */
ACPI_ERROR ((AE_INFO,
"Internal - Unknown ARGI (required operand) type 0x%X",
ThisArgType));
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
/*
* Make sure that the original object was resolved to the
* required object type (Simple cases only).
*/
Status = AcpiExCheckObjectType (TypeNeeded,
(*StackPtr)->Common.Type, *StackPtr);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
NextOperand:
/*
* If more operands needed, decrement StackPtr to point
* to next operand on stack
*/
if (GET_CURRENT_ARG_TYPE (ArgTypes))
{
StackPtr--;
}
}
ACPI_DUMP_OPERANDS (WalkState->Operands,
AcpiPsGetOpcodeName (Opcode), WalkState->NumOperands);
return_ACPI_STATUS (Status);
}
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:101,代码来源:exresop.c
示例13: AcpiExOpcode_2A_0T_0R
ACPI_STATUS
AcpiExOpcode_2A_0T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_NAMESPACE_NODE *Node;
UINT32 Value;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_0T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the opcode */
switch (WalkState->Opcode)
{
case AML_NOTIFY_OP: /* Notify (NotifyObject, NotifyValue) */
/* The first operand is a namespace node */
Node = (ACPI_NAMESPACE_NODE *) Operand[0];
/* Second value is the notify value */
Value = (UINT32) Operand[1]->Integer.Value;
/* Are notifies allowed on this object? */
if (!AcpiEvIsNotifyObject (Node))
{
ACPI_ERROR ((AE_INFO,
"Unexpected notify object type [%s]",
AcpiUtGetTypeName (Node->Type)));
Status = AE_AML_OPERAND_TYPE;
break;
}
#ifdef ACPI_GPE_NOTIFY_CHECK
/*
* GPE method wake/notify check. Here, we want to ensure that we
* don't receive any "DeviceWake" Notifies from a GPE _Lxx or _Exx
* GPE method during system runtime. If we do, the GPE is marked
* as "wake-only" and disabled.
*
* 1) Is the Notify() value == DeviceWake?
* 2) Is this a GPE deferred method? (An _Lxx or _Exx method)
* 3) Did the original GPE happen at system runtime?
* (versus during wake)
*
* If all three cases are true, this is a wake-only GPE that should
* be disabled at runtime.
*/
if (Value == 2) /* DeviceWake */
{
Status = AcpiEvCheckForWakeOnlyGpe (WalkState->GpeEventInfo);
if (ACPI_FAILURE (Status))
{
/* AE_WAKE_ONLY_GPE only error, means ignore this notify */
return_ACPI_STATUS (AE_OK)
}
}
#endif
/*
* Dispatch the notify to the appropriate handler
* NOTE: the request is queued for execution after this method
* completes. The notify handlers are NOT invoked synchronously
* from this thread -- because handlers may in turn run other
* control methods.
*/
Status = AcpiEvQueueNotifyRequest (Node, Value);
break;
default:
ACPI_ERROR ((AE_INFO, "Unknown AML opcode %X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
}
开发者ID:mmanley,项目名称:Antares,代码行数:84,代码来源:exoparg2.c
示例14: AcpiPsParseLoop
//.........这里部分代码省略.........
Status == AE_ALREADY_EXISTS)
{
Status = AE_OK;
}
if (Status == AE_CTRL_PARSE_CONTINUE)
{
continue;
}
if (Status == AE_CTRL_PARSE_PENDING)
{
Status = AE_OK;
}
if (Status == AE_CTRL_TERMINATE)
{
return_ACPI_STATUS (Status);
}
Status = AcpiPsCompleteOp (WalkState, &Op, Status);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
if (AcpiNsOpensScope (
AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType))
{
/*
* If the scope/device op fails to parse, skip the body of
* the scope op because the parse failure indicates that
* the device may not exist.
*/
ACPI_ERROR ((AE_INFO, "Skip parsing opcode %s",
AcpiPsGetOpcodeName (WalkState->Opcode)));
WalkState->ParserState.Aml = WalkState->Aml + 1;
WalkState->ParserState.Aml =
AcpiPsGetNextPackageEnd(&WalkState->ParserState);
WalkState->Aml = WalkState->ParserState.Aml;
}
continue;
}
AcpiExStartTraceOpcode (Op, WalkState);
}
/*
* Start ArgCount at zero because we don't know if there are
* any args yet
*/
WalkState->ArgCount = 0;
switch (Op->Common.AmlOpcode)
{
case AML_BYTE_OP:
case AML_WORD_OP:
case AML_DWORD_OP:
case AML_QWORD_OP:
break;
default:
ASL_CV_CAPTURE_COMMENTS (WalkState);
break;
}
开发者ID:jasonbking,项目名称:illumos-gate,代码行数:67,代码来源:psloop.c
示例15: AcpiExOpcode_6A_0T_1R
ACPI_STATUS
AcpiExOpcode_6A_0T_1R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
ACPI_STATUS Status = AE_OK;
UINT64 Index;
ACPI_OPERAND_OBJECT *ThisElement;
ACPI_FUNCTION_TRACE_STR (ExOpcode_6A_0T_1R,
AcpiPsGetOpcodeName (WalkState->Opcode));
switch (WalkState->Opcode)
{
case AML_MATCH_OP:
/*
* Match (SearchPkg[0], MatchOp1[1], MatchObj1[2],
* MatchOp2[3], MatchObj2[4], StartIndex[5])
*/
/* Validate both Match Term Operators (MTR, MEQ, etc.) */
if ((Operand[1]->Integer.Value > MAX_MATCH_OPERATOR) ||
(Operand[3]->Integer.Value > MAX_MATCH_OPERATOR))
{
ACPI_ERROR ((AE_INFO, "Match operator out of range"));
Status = AE_AML_OPERAND_VALUE;
goto Cleanup;
}
/* Get the package StartIndex, validate against the package length */
Index = Operand[5]->Integer.Value;
if (Index >= Operand[0]->Package.Count)
{
ACPI_ERROR ((AE_INFO,
"Index (0x%8.8X%8.8X) beyond package end (0x%X)",
ACPI_FORMAT_UINT64 (Index), Operand[0]->Package.Count));
Status = AE_AML_PACKAGE_LIMIT;
goto Cleanup;
}
/* Create an integer for the return value */
/* Default return value is ACPI_UINT64_MAX if no match found */
ReturnDesc = AcpiUtCreateIntegerObject (ACPI_UINT64_MAX);
if (!ReturnDesc)
{
Status = AE_NO_MEMORY;
goto Cleanup;
}
/*
* Examine each element until a match is found. Both match conditions
* must be satisfied for a match to occur. Within the loop,
* "continue" signifies that the current element does not match
* and the next should be examined.
*
* Upon finding a match, the loop will terminate via "break" at
* the bottom. If it terminates "normally", MatchValue will be
* ACPI_UINT64_MAX (Ones) (its initial value) indicating that no
* match was found.
*/
for ( ; Index < Operand[0]->Package.Count; Index++)
{
/* Get the current package element */
ThisElement = Operand[0]->Package.Elements[Index];
/* Treat any uninitialized (NULL) elements as non-matching */
if (!ThisElement)
{
continue;
}
/*
* Both match conditions must be satisfied. Execution of a continue
* (proceed to next iteration of enclosing for loop) signifies a
* non-match.
*/
if (!AcpiExDoMatch ((UINT32) Operand[1]->Integer.Value,
ThisElement, Operand[2]))
{
continue;
}
if (!AcpiExDoMatch ((UINT32) Operand[3]->Integer.Value,
ThisElement, Operand[4]))
{
continue;
}
/* Match found: Index is the return value */
ReturnDesc->Integer.Value = Index;
//.........这里部分代码省略.........
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:101,代码来源:exoparg6.c
示例16: AcpiExOpcode_3A_0T_0R
ACPI_STATUS
AcpiExOpcode_3A_0T_0R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_SIGNAL_FATAL_INFO *Fatal;
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR (ExOpcode_3A_0T_0R,
AcpiPsGetOpcodeName (WalkState->Opcode));
switch (WalkState->Opcode)
{
case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
(UINT32) Operand[0]->Integer.Value,
(UINT32) Operand[1]->Integer.Value,
(UINT32) Operand[2]->Integer.Value));
Fatal = ACPI_ALLOCATE (sizeof (ACPI_SIGNAL_FATAL_INFO));
if (Fatal)
{
Fatal->Type = (UINT32) Operand[0]->Integer.Value;
Fatal->Code = (UINT32) Operand[1]->Integer.Value;
Fatal->Argument = (UINT32) Operand[2]->Integer.Value;
}
/* Always signal the OS! */
Status = AcpiOsSignal (ACPI_SIGNAL_FATAL, Fatal);
/* Might return while OS is shutting down, just continue */
ACPI_FREE (Fatal);
goto Cleanup;
case AML_EXTERNAL_OP:
/*
* If the interpreter sees this opcode, just ignore it. The External
* op is intended for use by disassemblers in order to properly
* disassemble control method invocations. The opcode or group of
* opcodes should be surrounded by an "if (0)" clause to ensure that
* AML interpreters never see the opcode.
*/
Status = AE_OK;
goto Cleanup;
default:
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}
Cleanup:
return_ACPI_STATUS (Status);
}
开发者ID:yazshel,项目名称:netbsd-kernel,代码行数:64,代码来源:exoparg3.c
示例17: OptOptimizeNamePath
void
OptOptimizeNamePath (
ACPI_PARSE_OBJECT *Op,
UINT32 Flags,
ACPI_WALK_STATE *WalkState,
char *AmlNameString,
ACPI_NAMESPACE_NODE *TargetNode)
{
ACPI_STATUS Status;
ACPI_BUFFER TargetPath;
ACPI_BUFFER CurrentPath;
ACPI_SIZE AmlNameStringLength;
ACPI_NAMESPACE_NODE *CurrentNode;
char *ExternalNameString;
char *NewPath = NULL;
ACPI_SIZE HowMuchShorter;
ACPI_PARSE_OBJECT *NextOp;
ACPI_FUNCTION_TRACE (OptOptimizeNamePath);
/* This is an optional optimization */
if (!Gbl_ReferenceOptimizationFlag)
{
return_VOID;
}
/* Various required items */
if (!TargetNode || !WalkState || !AmlNameString || !Op->Common.Parent)
{
return_VOID;
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
Op->Asl.LogicalLineNumber,
AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
if (!(Flags & (AML_NAMED | AML_CREATE)))
{
if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
{
/* We don't want to fuss with actual name declaration nodes here */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"******* NAME DECLARATION\n"));
return_VOID;
}
}
/*
* The original path must be longer than one NameSeg (4 chars) for there
* to be any possibility that it can be optimized to a shorter string
*/
AmlNameStringLength = strlen (AmlNameString);
if (AmlNameStringLength <= ACPI_NAME_SIZE)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
"NAMESEG %4.4s\n", AmlNameString));
return_VOID;
}
/*
* We need to obtain the node that represents the current scope -- where
* we are right now in the namespace. We will compare this path
* against the Namepath, looking for commonality.
*/
CurrentNode = AcpiGbl_RootNode;
if (WalkState->ScopeInfo)
{
CurrentNode = WalkState->ScopeInfo->Scope.Node;
}
if (Flags & (AML_NAMED | AML_CREATE))
{
/* This is the declaration of a new name */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n"));
/*
* The node of interest is the parent of this node (the containing
* scope). The actual namespace node may be up more than one level
* of parse op or it may not exist at all (if we traverse back
* up to the root.)
*/
NextOp = Op->Asl.Parent;
while (NextOp && (!NextOp->Asl.Node))
{
NextOp = NextOp->Asl.Parent;
}
if (NextOp && NextOp->Asl.Node)
{
CurrentNode = NextOp->Asl.Node;
}
else
//.........这里部分代码省略.........
开发者ID:cailianchun,项目名称:acpica,代码行数:101,代码来源:aslopt.c
示例18: AcpiExOpcode_2A_2T_1R
ACPI_STATUS
AcpiExOpcode_2A_2T_1R (
ACPI_WALK_STATE *WalkState)
{
ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0];
ACPI_OPERAND_OBJECT *ReturnDesc1 = NULL;
ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_2T_1R,
AcpiPsGetOpcodeName (WalkState->Opcode));
/* Execute the opcode */
switch (WalkState->Opcode)
{
ca
|
请发表评论