这篇教程C++ AcpiPsGetOpcodeName函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcpiPsGetOpcodeName函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiPsGetOpcodeName函数的具体用法?C++ AcpiPsGetOpcodeName怎么用?C++ AcpiPsGetOpcodeName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AcpiPsGetOpcodeName函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiExOpcode_1A_1T_0RACPI_STATUSAcpiExOpcode_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,
示例2: AcpiExOpcode_2A_0T_0RACPI_STATUSAcpiExOpcode_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,
示例3: AcpiExOpcode_1A_0T_0RACPI_STATUSAcpiExOpcode_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,
示例4: AcpiExOpcode_0A_0T_1RACPI_STATUSAcpiExOpcode_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,
示例5: AcpiExOpcode_3A_0T_0RACPI_STATUSAcpiExOpcode_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,
示例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,
示例7: AcpiDsEvalBankFieldOperandsACPI_STATUSAcpiDsEvalBankFieldOperands ( 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,
示例8: AcpiDsInitBufferFieldstatic ACPI_STATUSAcpiDsInitBufferField ( 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,
示例9: AcpiExOpcode_1A_0T_1RACPI_STATUSAcpiExOpcode_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,
示例10: AcpiExOpcode_3A_1T_1RACPI_STATUSAcpiExOpcode_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,
示例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,
示例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,
示例13: AcpiExOpcode_2A_0T_0RACPI_STATUSAcpiExOpcode_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,
示例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,
示例15: AcpiExOpcode_6A_0T_1RACPI_STATUSAcpiExOpcode_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,
示例16: AcpiExOpcode_3A_0T_0RACPI_STATUSAcpiExOpcode_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,
示例17: OptOptimizeNamePathvoidOptOptimizeNamePath ( 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,
示例18: AcpiExOpcode_2A_2T_1RACPI_STATUSAcpiExOpcode_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) { case AML_DIVIDE_OP: /* Divide (Dividend, Divisor, RemainderResult QuotientResult) */ ReturnDesc1 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc1) { Status = AE_NO_MEMORY; goto Cleanup; } ReturnDesc2 = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc2) { Status = AE_NO_MEMORY; goto Cleanup; } /* Quotient to ReturnDesc1, remainder to ReturnDesc2 */ Status = AcpiUtDivide (Operand[0]->Integer.Value, Operand[1]->Integer.Value, &ReturnDesc1->Integer.Value, &ReturnDesc2->Integer.Value); if (ACPI_FAILURE (Status)) { goto Cleanup; } break; default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; } /* Store the results to the target reference operands */ Status = AcpiExStore (ReturnDesc2, Operand[2], WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; } Status = AcpiExStore (ReturnDesc1, Operand[3], WalkState); if (ACPI_FAILURE (Status)) { goto Cleanup; }Cleanup: /* * Since the remainder is not returned indirectly, remove a reference to * it. Only the quotient is returned indirectly. */ AcpiUtRemoveReference (ReturnDesc2); if (ACPI_FAILURE (Status)) { /* Delete the return object */ AcpiUtRemoveReference (ReturnDesc1); } /* Save return object (the remainder) on success */ else { WalkState->ResultObj = ReturnDesc1; } return_ACPI_STATUS (Status);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:93,
示例19: AcpiExOpcode_2A_1T_1RACPI_STATUSAcpiExOpcode_2A_1T_1R ( ACPI_WALK_STATE *WalkState){ ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; UINT64 Index; ACPI_STATUS Status = AE_OK; ACPI_SIZE Length = 0; ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_1T_1R, AcpiPsGetOpcodeName (WalkState->Opcode)); /* Execute the opcode */ if (WalkState->OpInfo->Flags & AML_MATH) { /* All simple math opcodes (add, etc.) */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode, Operand[0]->Integer.Value, Operand[1]->Integer.Value); goto StoreResultToTarget; } switch (WalkState->Opcode) { case AML_MOD_OP: /* Mod (Dividend, Divisor, RemainderResult (ACPI 2.0) */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } /* ReturnDesc will contain the remainder */ Status = AcpiUtDivide (Operand[0]->Integer.Value, Operand[1]->Integer.Value, NULL, &ReturnDesc->Integer.Value); break; case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ Status = AcpiExDoConcatenate (Operand[0], Operand[1], &ReturnDesc, WalkState); break; case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */ /* * Input object is guaranteed to be a buffer at this point (it may have * been converted.) Copy the raw buffer data to a new object of * type String. */ /* * Get the length of the new string. It is the smallest of: * 1) Length of the input buffer * 2) Max length as specified in the ToString operator * 3) Length of input buffer up to a zero byte (null terminator) * * NOTE: A length of zero is ok, and will create a zero-length, null * terminated string. */ while ((Length < Operand[0]->Buffer.Length) && (Length < Operand[1]->Integer.Value) && (Operand[0]->Buffer.Pointer[Length])) { Length++; } /* Allocate a new string object */ ReturnDesc = AcpiUtCreateStringObject (Length); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } /* * Copy the raw buffer data with no transform. * (NULL terminated already) */ ACPI_MEMCPY (ReturnDesc->String.Pointer, Operand[0]->Buffer.Pointer, Length); break; case AML_CONCAT_RES_OP://.........这里部分代码省略.........
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:101,
示例20: AcpiExOpcode_1A_1T_1RACPI_STATUSAcpiExOpcode_1A_1T_1R ( ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_OPERAND_OBJECT *ReturnDesc2 = NULL; UINT32 Temp32; UINT32 i; UINT64 PowerOfTen; UINT64 Digit; ACPI_FUNCTION_TRACE_STR (ExOpcode_1A_1T_1R, AcpiPsGetOpcodeName (WalkState->Opcode)); /* Examine the AML opcode */ switch (WalkState->Opcode) { case AML_BIT_NOT_OP: case AML_FIND_SET_LEFT_BIT_OP: case AML_FIND_SET_RIGHT_BIT_OP: case AML_FROM_BCD_OP: case AML_TO_BCD_OP: case AML_COND_REF_OF_OP: /* Create a return object of type Integer for these opcodes */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } switch (WalkState->Opcode) { case AML_BIT_NOT_OP: /* Not (Operand, Result) */ ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value; break; case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; /* * Acpi specification describes Integer type as a little * endian unsigned value, so this boundary condition is valid. */ for (Temp32 = 0; ReturnDesc->Integer.Value && Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32) { ReturnDesc->Integer.Value >>= 1; } ReturnDesc->Integer.Value = Temp32; break; case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; /* * The Acpi specification describes Integer type as a little * endian unsigned value, so this boundary condition is valid. */ for (Temp32 = 0; ReturnDesc->Integer.Value && Temp32 < ACPI_INTEGER_BIT_SIZE; ++Temp32) { ReturnDesc->Integer.Value <<= 1; } /* Since the bit position is one-based, subtract from 33 (65) */ ReturnDesc->Integer.Value = Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32; break; case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */ /* * The 64-bit ACPI integer can hold 16 4-bit BCD characters * (if table is 32-bit, integer can hold 8 BCD characters) * Convert each 4-bit BCD value */ PowerOfTen = 1; ReturnDesc->Integer.Value = 0; Digit = Operand[0]->Integer.Value; /* Convert each BCD digit (each is one nybble wide) */ for (i = 0; (i < AcpiGbl_IntegerNybbleWidth) && (Digit > 0); i++) { /* Get the least significant 4-bit BCD digit */ Temp32 = ((UINT32) Digit) & 0xF;//.........这里部分代码省略.........
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:101,
示例21: AcpiExOpcode_2A_0T_1RACPI_STATUSAcpiExOpcode_2A_0T_1R ( ACPI_WALK_STATE *WalkState){ ACPI_OPERAND_OBJECT **Operand = &WalkState->Operands[0]; ACPI_OPERAND_OBJECT *ReturnDesc = NULL; ACPI_STATUS Status = AE_OK; BOOLEAN LogicalResult = FALSE; ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_0T_1R, AcpiPsGetOpcodeName (WalkState->Opcode)); /* Create the internal return object */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!ReturnDesc) { Status = AE_NO_MEMORY; goto Cleanup; } /* Execute the Opcode */ if (WalkState->OpInfo->Flags & AML_LOGICAL_NUMERIC) { /* LogicalOp (Operand0, Operand1) */ Status = AcpiExDoLogicalNumericOp (WalkState->Opcode, Operand[0]->Integer.Value, Operand[1]->Integer.Value, &LogicalResult); goto StoreLogicalResult; } else if (WalkState->OpInfo->Flags & AML_LOGICAL) { /* LogicalOp (Operand0, Operand1) */ Status = AcpiExDoLogicalOp (WalkState->Opcode, Operand[0], Operand[1], &LogicalResult); goto StoreLogicalResult; } switch (WalkState->Opcode) { case AML_ACQUIRE_OP: /* Acquire (MutexObject, Timeout) */ Status = AcpiExAcquireMutex (Operand[1], Operand[0], WalkState); if (Status == AE_TIME) { LogicalResult = TRUE; /* TRUE = Acquire timed out */ Status = AE_OK; } break; case AML_WAIT_OP: /* Wait (EventObject, Timeout) */ Status = AcpiExSystemWaitEvent (Operand[1], Operand[0]); if (Status == AE_TIME) { LogicalResult = TRUE; /* TRUE, Wait timed out */ Status = AE_OK; } break; default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", WalkState->Opcode)); Status = AE_AML_BAD_OPCODE; goto Cleanup; }StoreLogicalResult: /* * Set return value to according to LogicalResult. logical TRUE (all ones) * Default is FALSE (zero) */ if (LogicalResult) { ReturnDesc->Integer.Value = ACPI_UINT64_MAX; }Cleanup: /* Delete return object on error */ if (ACPI_FAILURE (Status)) { AcpiUtRemoveReference (ReturnDesc); } /* Save return object on success */ else { WalkState->ResultObj = ReturnDesc; }//.........这里部分代码省略.........
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:101,
示例22: AeExceptionHandlerstatic ACPI_STATUSAeExceptionHandler ( ACPI_STATUS AmlStatus, ACPI_NAME Name, UINT16 Opcode, UINT32 AmlOffset, void *Context){ ACPI_STATUS NewAmlStatus = AmlStatus; ACPI_STATUS Status; ACPI_BUFFER ReturnObj; ACPI_OBJECT_LIST ArgList; ACPI_OBJECT Arg[3]; const char *Exception; Exception = AcpiFormatException (AmlStatus); AcpiOsPrintf ("[AcpiExec] Exception %s during execution ", Exception); if (Name) { AcpiOsPrintf ("of method [%4.4s]", (char *) &Name); } else { AcpiOsPrintf ("at module level (table load)"); } AcpiOsPrintf (" Opcode [%s] @%X/n", AcpiPsGetOpcodeName (Opcode), AmlOffset); /* * Invoke the _ERR method if present * * Setup parameter object */ ArgList.Count = 3; ArgList.Pointer = Arg; Arg[0].Type = ACPI_TYPE_INTEGER; Arg[0].Integer.Value = AmlStatus; Arg[1].Type = ACPI_TYPE_STRING; Arg[1].String.Pointer = ACPI_CAST_PTR (char, Exception); Arg[1].String.Length = ACPI_STRLEN (Exception); Arg[2].Type = ACPI_TYPE_INTEGER; Arg[2].Integer.Value = AcpiOsGetThreadId(); /* Setup return buffer */ ReturnObj.Pointer = NULL; ReturnObj.Length = ACPI_ALLOCATE_BUFFER; Status = AcpiEvaluateObject (NULL, "//_ERR", &ArgList, &ReturnObj); if (ACPI_SUCCESS (Status)) { if (ReturnObj.Pointer) { /* Override original status */ NewAmlStatus = (ACPI_STATUS) ((ACPI_OBJECT *) ReturnObj.Pointer)->Integer.Value; /* Free a buffer created via ACPI_ALLOCATE_BUFFER */ AcpiOsFree (ReturnObj.Pointer); } } else if (Status != AE_NOT_FOUND) { AcpiOsPrintf ("[AcpiExec] Could not execute _ERR method, %s/n", AcpiFormatException (Status)); } /* Global override */ if (AcpiGbl_IgnoreErrors) { NewAmlStatus = AE_OK; } if (NewAmlStatus != AmlStatus) { AcpiOsPrintf ("[AcpiExec] Exception override, new status %s/n", AcpiFormatException (NewAmlStatus)); } return (NewAmlStatus);}
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:87,
示例23: AcpiDmDumpDescendingstatic ACPI_STATUSAcpiDmDumpDescending ( ACPI_PARSE_OBJECT *Op, UINT32 Level, void *Context){ ACPI_OP_WALK_INFO *Info = Context; const ACPI_OPCODE_INFO *OpInfo; char *Path; if (!Op) { return (AE_OK); } OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); Info->Count++; /* Most of the information (count, level, name) here */ AcpiOsPrintf ("% 5d [%2.2d] ", Info->Count, Level); AcpiDmIndent (Level); AcpiOsPrintf ("%-28s", AcpiPsGetOpcodeName (Op->Common.AmlOpcode)); /* Extra info is helpful */ switch (Op->Common.AmlOpcode) { case AML_BYTE_OP: case AML_WORD_OP: case AML_DWORD_OP: AcpiOsPrintf ("%X", (UINT32) Op->Common.Value.Integer); break; case AML_INT_NAMEPATH_OP: if (Op->Common.Value.String) { AcpiNsExternalizeName (ACPI_UINT32_MAX, Op->Common.Value.String, NULL, &Path); AcpiOsPrintf ("%s %p", Path, Op->Common.Node); ACPI_FREE (Path); } else { AcpiOsPrintf ("[NULL]"); } break; case AML_NAME_OP: case AML_METHOD_OP: case AML_DEVICE_OP: case AML_INT_NAMEDFIELD_OP: AcpiOsPrintf ("%4.4s", &Op->Named.Name); break; default: break; } AcpiOsPrintf ("/n"); return (AE_OK);}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:63,
示例24: AcpiDsEvalBufferFieldOperandsACPI_STATUSAcpiDsEvalBufferFieldOperands ( ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op){ ACPI_STATUS Status; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_NAMESPACE_NODE *Node; ACPI_PARSE_OBJECT *NextOp; ACPI_FUNCTION_TRACE_PTR (DsEvalBufferFieldOperands, Op); /* * This is where we evaluate the address and length fields of the * CreateXxxField declaration */ Node = Op->Common.Node; /* NextOp points to the op that holds the Buffer */ NextOp = Op->Common.Value.Arg; /* Evaluate/create the address and length operands */ Status = AcpiDsCreateOperands (WalkState, NextOp); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ObjDesc = AcpiNsGetAttachedObject (Node); if (!ObjDesc) { return_ACPI_STATUS (AE_NOT_EXIST); } /* Resolve the operands */ Status = AcpiExResolveOperands (Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X", AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Status)); return_ACPI_STATUS (Status); } /* Initialize the Buffer Field */ if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP) { /* NOTE: Slightly different operands for this opcode */ Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc, WalkState->Operands[0], WalkState->Operands[1], WalkState->Operands[2], WalkState->Operands[3]); } else { /* All other, CreateXxxField opcodes */ Status = AcpiDsInitBufferField (Op->Common.AmlOpcode, ObjDesc, WalkState->Operands[0], WalkState->Operands[1], NULL, WalkState->Operands[2]); } return_ACPI_STATUS (Status);}
开发者ID:ModeenF,项目名称:haiku,代码行数:71,
示例25: AcpiNsDumpOneObject//.........这里部分代码省略......... AcpiOsPrintf ("[Length not yet evaluated]/n"); } break; case ACPI_TYPE_STRING: AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length); AcpiUtPrintString (ObjDesc->String.Pointer, 32); AcpiOsPrintf ("/n"); break; case ACPI_TYPE_REGION: AcpiOsPrintf ("[%s]", AcpiUtGetRegionName (ObjDesc->Region.SpaceId)); if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID) { AcpiOsPrintf (" Addr %8.8X%8.8X Len %.4X/n", ACPI_HIDWORD (ObjDesc->Region.Address), ACPI_LODWORD (ObjDesc->Region.Address), ObjDesc->Region.Length); } else { AcpiOsPrintf (" [Address/Length not yet evaluated]/n"); } break; case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[%s]/n", AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode)); break; case ACPI_TYPE_BUFFER_FIELD: if (ObjDesc->BufferField.BufferObj && ObjDesc->BufferField.BufferObj->Buffer.Node) { AcpiOsPrintf ("Buf [%4.4s]", ObjDesc->BufferField.BufferObj->Buffer.Node->Name.Ascii); } break; case ACPI_TYPE_LOCAL_REGION_FIELD: AcpiOsPrintf ("Rgn [%4.4s]", ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii); break; case ACPI_TYPE_LOCAL_BANK_FIELD: AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]", ObjDesc->CommonField.RegionObj->Region.Node->Name.Ascii, ObjDesc->BankField.BankObj->CommonField.Node->Name.Ascii); break; case ACPI_TYPE_LOCAL_INDEX_FIELD: AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]",
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:67,
示例26: AcpiDsIsResultUsedBOOLEANAcpiDsIsResultUsed ( ACPI_PARSE_OBJECT *Op, ACPI_WALK_STATE *WalkState){ const ACPI_OPCODE_INFO *ParentInfo; ACPI_FUNCTION_TRACE_PTR (DsIsResultUsed, Op); /* Must have both an Op and a Result Object */ if (!Op) { ACPI_ERROR ((AE_INFO, "Null Op")); return_UINT8 (TRUE); } /* * We know that this operator is not a * Return() operator (would not come here.) The following code is the * optional support for a so-called "implicit return". Some AML code * assumes that the last value of the method is "implicitly" returned * to the caller. Just save the last result as the return value. * NOTE: this is optional because the ASL language does not actually * support this behavior. */ (void) AcpiDsDoImplicitReturn (WalkState->ResultObj, WalkState, TRUE); /* * Now determine if the parent will use the result * * If there is no parent, or the parent is a ScopeOp, we are executing * at the method level. An executing method typically has no parent, * since each method is parsed separately. A method invoked externally * via ExecuteControlMethod has a ScopeOp as the parent. */ if ((!Op->Common.Parent) || (Op->Common.Parent->Common.AmlOpcode == AML_SCOPE_OP)) { /* No parent, the return value cannot possibly be used */ ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "At Method level, result of [%s] not used/n", AcpiPsGetOpcodeName (Op->Common.AmlOpcode))); return_UINT8 (FALSE); } /* Get info on the parent. The RootOp is AML_SCOPE */ ParentInfo = AcpiPsGetOpcodeInfo (Op->Common.Parent->Common.AmlOpcode); if (ParentInfo->Class == AML_CLASS_UNKNOWN) { ACPI_ERROR ((AE_INFO, "Unknown parent opcode Op=%p", Op)); return_UINT8 (FALSE); } /* * Decide what to do with the result based on the parent. If * the parent opcode will not use the result, delete the object. * Otherwise leave it as is, it will be deleted when it is used * as an operand later. */ switch (ParentInfo->Class) { case AML_CLASS_CONTROL: switch (Op->Common.Parent->Common.AmlOpcode) { case AML_RETURN_OP: /* Never delete the return value associated with a return opcode */ goto ResultUsed; case AML_IF_OP: case AML_WHILE_OP: /* * If we are executing the predicate AND this is the predicate op, * we will use the return value */ if ((WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING) && (WalkState->ControlState->Control.PredicateOp == Op)) { goto ResultUsed; } break; default: /* Ignore other control opcodes */ break; } /* The general control opcode returns no result */ goto ResultNotUsed;//.........这里部分代码省略.........
开发者ID:ornarium,项目名称:freebsd,代码行数:101,
示例27: AcpiDmDisplayInternalObject//.........这里部分代码省略......... break; case AML_DEBUG_OP: AcpiOsPrintf ("[Debug] "); break; case AML_INDEX_OP: AcpiOsPrintf ("[Index] "); switch (ObjDesc->Reference.TargetType) { case ACPI_TYPE_BUFFER_FIELD: AcpiOsPrintf ("%p", ObjDesc->Reference.Object); AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); break; case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("%p", ObjDesc->Reference.Where); if (!ObjDesc->Reference.Where) { AcpiOsPrintf (" Uninitialized WHERE ptr"); } else { AcpiDmDecodeInternalObject (*(ObjDesc->Reference.Where)); } break; default: AcpiOsPrintf ("Unknown index target type"); break; } break; case AML_LOAD_OP: AcpiOsPrintf ("[DdbHandle] "); break; case AML_REF_OF_OP: AcpiOsPrintf ("[RefOf] "); if (!ObjDesc->Reference.Object) { AcpiOsPrintf ("Uninitialized reference subobject ptr"); break; } /* Reference can be to a Node or an Operand object */ switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object)) { case ACPI_DESC_TYPE_NAMED: AcpiDmDecodeNode (ObjDesc->Reference.Object); break; case ACPI_DESC_TYPE_OPERAND: AcpiDmDecodeInternalObject (ObjDesc->Reference.Object); break; default: break; } break; default: AcpiOsPrintf ("Unknown Reference opcode %X (%s)/n", ObjDesc->Reference.Opcode, AcpiPsGetOpcodeName (ObjDesc->Reference.Opcode)); break; } break; default: AcpiOsPrintf ("<Obj> "); AcpiDmDecodeInternalObject (ObjDesc); break; } break; default: AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> [%s]", AcpiUtGetDescriptorName (ObjDesc)); break; } AcpiOsPrintf ("/n");}
开发者ID:MarginC,项目名称:kame,代码行数:101,
注:本文中的AcpiPsGetOpcodeName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcpiPsParseAml函数代码示例 C++ AcpiPsGetOpcodeInfo函数代码示例 |