这篇教程C++ AcpiUtGetObjectTypeName函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AcpiUtGetObjectTypeName函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiUtGetObjectTypeName函数的具体用法?C++ AcpiUtGetObjectTypeName怎么用?C++ AcpiUtGetObjectTypeName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AcpiUtGetObjectTypeName函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AcpiDmDecodeInternalObjectvoidAcpiDmDecodeInternalObject ( ACPI_OPERAND_OBJECT *ObjDesc){ UINT32 i; if (!ObjDesc) { AcpiOsPrintf (" Uninitialized"); return; } if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) { AcpiOsPrintf (" %p", ObjDesc); return; } AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc)); switch (ACPI_GET_OBJECT_TYPE (ObjDesc)) { case ACPI_TYPE_INTEGER: AcpiOsPrintf (" %8.8X%8.8X", ACPI_HIDWORD (ObjDesc->Integer.Value), ACPI_LODWORD (ObjDesc->Integer.Value)); break; case ACPI_TYPE_STRING: AcpiOsPrintf ("(%d) /"%.24s", ObjDesc->String.Length, ObjDesc->String.Pointer); if (ObjDesc->String.Length > 24) { AcpiOsPrintf ("..."); } else { AcpiOsPrintf ("/""); } break; case ACPI_TYPE_BUFFER: AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length); for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++) { AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]); } break; default: AcpiOsPrintf (" %p", ObjDesc); break; }}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:62,
示例2: AcpiNsCheckObjectType//.........这里部分代码省略......... if (ACPI_SUCCESS (Status)) { return (AE_OK); /* Repair was successful */ } goto TypeErrorExit; } /* A Namespace node should not get here, but make sure */ if (ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED) { ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, "Invalid return type - Found a Namespace node [%4.4s] type %s", ReturnObject->Node.Name.Ascii, AcpiUtGetTypeName (ReturnObject->Node.Type))); return (AE_AML_OPERAND_TYPE); } /* * Convert the object type (ACPI_TYPE_xxx) to a bitmapped object type. * The bitmapped type allows multiple possible return types. * * Note, the cases below must handle all of the possible types returned * from all of the predefined names (including elements of returned * packages) */ switch (ReturnObject->Common.Type) { case ACPI_TYPE_INTEGER: ReturnBtype = ACPI_RTYPE_INTEGER; break; case ACPI_TYPE_BUFFER: ReturnBtype = ACPI_RTYPE_BUFFER; break; case ACPI_TYPE_STRING: ReturnBtype = ACPI_RTYPE_STRING; break; case ACPI_TYPE_PACKAGE: ReturnBtype = ACPI_RTYPE_PACKAGE; break; case ACPI_TYPE_LOCAL_REFERENCE: ReturnBtype = ACPI_RTYPE_REFERENCE; break; default: /* Not one of the supported objects, must be incorrect */ goto TypeErrorExit; } /* Is the object one of the expected types? */ if (ReturnBtype & ExpectedBtypes) { /* For reference objects, check that the reference type is correct */ if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) { Status = AcpiNsCheckReference (Data, ReturnObject); } return (Status); } /* Type mismatch -- attempt repair of the returned object */ Status = AcpiNsRepairObject (Data, ExpectedBtypes, PackageIndex, ReturnObjectPtr); if (ACPI_SUCCESS (Status)) { return (AE_OK); /* Repair was successful */ }TypeErrorExit: /* Create a string with all expected types for this predefined object */ AcpiNsGetExpectedTypes (TypeBuffer, ExpectedBtypes); if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, "Return type mismatch - found %s, expected %s", AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } else { ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, "Return Package type mismatch at index %u - " "found %s, expected %s", PackageIndex, AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } return (AE_AML_OPERAND_TYPE);}
开发者ID:ErfanBagheri,项目名称:haiku,代码行数:101,
示例3: AcpiUtGetSimpleObjectSize//.........这里部分代码省略......... { /* * Object is NULL, just return the length of ACPI_OBJECT * (A NULL ACPI_OBJECT is an object of all zeroes.) */ *ObjLength = ACPI_ROUND_UP_TO_NATIVE_WORD (Length); return_ACPI_STATUS (AE_OK); } /* A Namespace Node should never appear here */ if (ACPI_GET_DESCRIPTOR_TYPE (InternalObject) == ACPI_DESC_TYPE_NAMED) { /* A namespace node should never get here */ ACPI_ERROR ((AE_INFO, "Received a namespace node [%4.4s] " "where an operand object is required", ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, InternalObject)->Name.Ascii)); return_ACPI_STATUS (AE_AML_INTERNAL); } /* * The final length depends on the object type * Strings and Buffers are packed right up against the parent object and * must be accessed bytewise or there may be alignment problems on * certain processors */ switch (InternalObject->Common.Type) { case ACPI_TYPE_STRING: Length += (ACPI_SIZE) InternalObject->String.Length + 1; break; case ACPI_TYPE_BUFFER: Length += (ACPI_SIZE) InternalObject->Buffer.Length; break; case ACPI_TYPE_INTEGER: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: /* No extra data for these types */ break; case ACPI_TYPE_LOCAL_REFERENCE: switch (InternalObject->Reference.Class) { case ACPI_REFCLASS_NAME: /* * Get the actual length of the full pathname to this object. * The reference will be converted to the pathname to the object */ Size = AcpiNsGetPathnameLength (InternalObject->Reference.Node); if (!Size) { return_ACPI_STATUS (AE_BAD_PARAMETER); } Length += ACPI_ROUND_UP_TO_NATIVE_WORD (Size); break; default: /* * No other reference opcodes are supported. * Notably, Locals and Args are not supported, but this may be * required eventually. */ ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " "unsupported Reference Class [%s] 0x%X in object %p", AcpiUtGetReferenceName (InternalObject), InternalObject->Reference.Class, InternalObject)); Status = AE_TYPE; break; } break; default: ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " "unsupported type [%s] 0x%X in object %p", AcpiUtGetObjectTypeName (InternalObject), InternalObject->Common.Type, InternalObject)); Status = AE_TYPE; break; } /* * Account for the space required by the object rounded up to the next * multiple of the machine word size. This keeps each object aligned * on a machine word boundary. (preventing alignment faults on some * machines.) */ *ObjLength = ACPI_ROUND_UP_TO_NATIVE_WORD (Length); return_ACPI_STATUS (Status);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:101,
示例4: AcpiExGetObjectReferenceACPI_STATUSAcpiExGetObjectReference ( ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ReturnDesc, ACPI_WALK_STATE *WalkState){ ACPI_OPERAND_OBJECT *ReferenceObj; ACPI_OPERAND_OBJECT *ReferencedObj; ACPI_FUNCTION_TRACE_PTR (ExGetObjectReference, ObjDesc); *ReturnDesc = NULL; switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) { case ACPI_DESC_TYPE_OPERAND: if (ObjDesc->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* * Must be a reference to a Local or Arg */ switch (ObjDesc->Reference.Class) { case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_DEBUG: /* The referenced object is the pseudo-node for the local/arg */ ReferencedObj = ObjDesc->Reference.Object; break; default: ACPI_ERROR ((AE_INFO, "Invalid Reference Class 0x%2.2X", ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } break; case ACPI_DESC_TYPE_NAMED: /* * A named reference that has already been resolved to a Node */ ReferencedObj = ObjDesc; break; default: ACPI_ERROR ((AE_INFO, "Invalid descriptor type 0x%X", ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))); return_ACPI_STATUS (AE_TYPE); } /* Create a new reference object */ ReferenceObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE); if (!ReferenceObj) { return_ACPI_STATUS (AE_NO_MEMORY); } ReferenceObj->Reference.Class = ACPI_REFCLASS_REFOF; ReferenceObj->Reference.Object = ReferencedObj; *ReturnDesc = ReferenceObj; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Object %p Type [%s], returning Reference %p/n", ObjDesc, AcpiUtGetObjectTypeName (ObjDesc), *ReturnDesc)); return_ACPI_STATUS (AE_OK);}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:79,
示例5: AcpiDsResultPushACPI_STATUSAcpiDsResultPush ( ACPI_OPERAND_OBJECT *Object, ACPI_WALK_STATE *WalkState){ ACPI_GENERIC_STATE *State; ACPI_STATUS Status; UINT32 Index; ACPI_FUNCTION_NAME (DsResultPush); if (WalkState->ResultCount > WalkState->ResultSize) { ACPI_ERROR ((AE_INFO, "Result stack is full")); return (AE_AML_INTERNAL); } else if (WalkState->ResultCount == WalkState->ResultSize) { /* Extend the result stack */ Status = AcpiDsResultStackPush (WalkState); if (ACPI_FAILURE (Status)) { ACPI_ERROR ((AE_INFO, "Failed to extend the result stack")); return (Status); } } if (!(WalkState->ResultCount < WalkState->ResultSize)) { ACPI_ERROR ((AE_INFO, "No free elements in result stack")); return (AE_AML_INTERNAL); } State = WalkState->Results; if (!State) { ACPI_ERROR ((AE_INFO, "No result stack frame during push")); return (AE_AML_INTERNAL); } if (!Object) { ACPI_ERROR ((AE_INFO, "Null Object! Obj=%p State=%p Num=%u", Object, WalkState, WalkState->ResultCount)); return (AE_BAD_PARAMETER); } /* Assign the address of object to the top free element of result stack */ Index = (UINT32) WalkState->ResultCount % ACPI_RESULTS_FRAME_OBJ_NUM; State->Results.ObjDesc [Index] = Object; WalkState->ResultCount++; ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X/n", Object, AcpiUtGetObjectTypeName ((ACPI_OPERAND_OBJECT *) Object), WalkState, WalkState->ResultCount, WalkState->CurrentResult)); return (AE_OK);}
开发者ID:JasonFord53,项目名称:freebsd,代码行数:63,
示例6: AcpiExStoreObjectToNodeACPI_STATUSAcpiExStoreObjectToNode ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_NAMESPACE_NODE *Node, ACPI_WALK_STATE *WalkState, UINT8 ImplicitConversion){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *TargetDesc; ACPI_OPERAND_OBJECT *NewDesc; ACPI_OBJECT_TYPE TargetType; ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToNode, SourceDesc); /* Get current type of the node, and object attached to Node */ TargetType = AcpiNsGetType (Node); TargetDesc = AcpiNsGetAttachedObject (Node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p [%s] to node %p [%s]/n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), Node, AcpiUtGetTypeName (TargetType))); /* Only limited target types possible for everything except CopyObject */ if (WalkState->Opcode != AML_COPY_OBJECT_OP) { /* * Only CopyObject allows all object types to be overwritten. For * TargetRef(s), there are restrictions on the object types that * are allowed. * * Allowable operations/typing for Store: * * 1) Simple Store * Integer --> Integer (Named/Local/Arg) * String --> String (Named/Local/Arg) * Buffer --> Buffer (Named/Local/Arg) * Package --> Package (Named/Local/Arg) * * 2) Store with implicit conversion * Integer --> String or Buffer (Named) * String --> Integer or Buffer (Named) * Buffer --> Integer or String (Named) */ switch (TargetType) { case ACPI_TYPE_PACKAGE: /* * Here, can only store a package to an existing package. * Storing a package to a Local/Arg is OK, and handled * elsewhere. */ if (WalkState->Opcode == AML_STORE_OP) { if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE) { ACPI_ERROR ((AE_INFO, "Cannot assign type [%s] to [Package] " "(source must be type Pkg)", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_TARGET_TYPE); } break; } /* Fallthrough */ case ACPI_TYPE_DEVICE: case ACPI_TYPE_EVENT: case ACPI_TYPE_MUTEX: case ACPI_TYPE_REGION: case ACPI_TYPE_POWER: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: ACPI_ERROR ((AE_INFO, "Target must be [Buffer/Integer/String/Reference]" ", found [%s] (%4.4s)", AcpiUtGetTypeName (Node->Type), Node->Name.Ascii)); return_ACPI_STATUS (AE_AML_TARGET_TYPE); default: break; } } /* * Resolve the source object to an actual value * (If it is a reference object) */ Status = AcpiExResolveObject (&SourceDesc, TargetType, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); }//.........这里部分代码省略.........
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:101,
示例7: AcpiExDoDebugObjectvoidAcpiExDoDebugObject ( ACPI_OPERAND_OBJECT *SourceDesc, UINT32 Level, UINT32 Index){ UINT32 i; UINT32 Timer; ACPI_OPERAND_OBJECT *ObjectDesc; UINT32 Value; ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); /* Output must be enabled via the DebugObject global or the DbgLevel */ if (!AcpiGbl_EnableAmlDebugObject && !(AcpiDbgLevel & ACPI_LV_DEBUG_OBJECT)) { return_VOID; } /* * We will emit the current timer value (in microseconds) with each * debug output. Only need the lower 26 bits. This allows for 67 * million microseconds or 67 seconds before rollover. */ Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */ Timer &= 0x03FFFFFF; /* * Print line header as long as we are not in the middle of an * object display */ if (!((Level > 0) && Index == 0)) { AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " "); } /* Display the index for package output only */ if (Index > 0) { AcpiOsPrintf ("(%.2u) ", Index-1); } if (!SourceDesc) { AcpiOsPrintf ("[Null Object]/n"); return_VOID; } if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) { AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); if (!AcpiUtValidInternalObject (SourceDesc)) { AcpiOsPrintf ("%p, Invalid Internal Object!/n", SourceDesc); return_VOID; } } else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) { AcpiOsPrintf ("%s: %p/n", AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), SourceDesc); return_VOID; } else { return_VOID; } /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: /* Output correct integer width */ if (AcpiGbl_IntegerByteWidth == 4) { AcpiOsPrintf ("0x%8.8X/n", (UINT32) SourceDesc->Integer.Value); } else { AcpiOsPrintf ("0x%8.8X%8.8X/n", ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value)); } break; case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[0x%.2X]/n", (UINT32) SourceDesc->Buffer.Length); AcpiUtDumpBuffer (SourceDesc->Buffer.Pointer, (SourceDesc->Buffer.Length < 256) ?//.........这里部分代码省略.........
开发者ID:imgits,项目名称:ChaiOS,代码行数:101,
示例8: AcpiNsEvaluate//.........这里部分代码省略......... else { /* * 2) Object is not a method, return its current value * * Disallow certain object types. For these, "evaluation" is undefined. */ switch (Info->ResolvedNode->Type) { case ACPI_TYPE_DEVICE: case ACPI_TYPE_EVENT: case ACPI_TYPE_MUTEX: case ACPI_TYPE_REGION: case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_SCOPE: ACPI_ERROR ((AE_INFO, "[%4.4s] Evaluation of object type [%s] is not supported", Info->ResolvedNode->Name.Ascii, AcpiUtGetTypeName (Info->ResolvedNode->Type))); return_ACPI_STATUS (AE_TYPE); default: break; } /* * Objects require additional resolution steps (e.g., the Node may be * a field that must be read, etc.) -- we can't just grab the object * out of the node. * * Use ResolveNodeToValue() to get the associated value. * * NOTE: we can get away with passing in NULL for a walk state because * ResolvedNode is guaranteed to not be a reference to either a method * local or a method argument (because this interface is never called * from a running method.) * * Even though we do not directly invoke the interpreter for object * resolution, we must lock it because we could access an opregion. * The opregion access code assumes that the interpreter is locked. */ AcpiExEnterInterpreter (); /* Function has a strange interface */ Status = AcpiExResolveNodeToValue (&Info->ResolvedNode, NULL); AcpiExExitInterpreter (); /* * If AcpiExResolveNodeToValue() succeeded, the return value was placed * in ResolvedNode. */ if (ACPI_SUCCESS (Status)) { Status = AE_CTRL_RETURN_VALUE; Info->ReturnObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Info->ResolvedNode); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]/n", Info->ReturnObject, AcpiUtGetObjectTypeName (Info->ReturnObject))); } } /* * Check input argument count against the ASL-defined count for a method. * Also check predefined names: argument count and return value against * the ACPI specification. Some incorrect return value types are repaired. */ (void) AcpiNsCheckPredefinedNames (Node, Info->ParamCount, Status, &Info->ReturnObject); /* Check if there is a return value that must be dealt with */ if (Status == AE_CTRL_RETURN_VALUE) { /* If caller does not want the return value, delete it */ if (Info->Flags & ACPI_IGNORE_RETURN_VALUE) { AcpiUtRemoveReference (Info->ReturnObject); Info->ReturnObject = NULL; } /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ Status = AE_OK; } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed evaluation of object %s ***/n", Info->Pathname)); /* * Namespace was unlocked by the handling AcpiNs* function, so we * just return */ return_ACPI_STATUS (Status);}
开发者ID:cloudius-systems,项目名称:acpica,代码行数:101,
示例9: AcpiExStoreObjectToNodeACPI_STATUSAcpiExStoreObjectToNode ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_NAMESPACE_NODE *Node, ACPI_WALK_STATE *WalkState, UINT8 ImplicitConversion){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *TargetDesc; ACPI_OPERAND_OBJECT *NewDesc; ACPI_OBJECT_TYPE TargetType; ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToNode, SourceDesc); /* Get current type of the node, and object attached to Node */ TargetType = AcpiNsGetType (Node); TargetDesc = AcpiNsGetAttachedObject (Node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)/n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), Node, AcpiUtGetTypeName (TargetType))); /* * Resolve the source object to an actual value * (If it is a reference object) */ Status = AcpiExResolveObject (&SourceDesc, TargetType, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Do the actual store operation */ switch (TargetType) { case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: /* * The simple data types all support implicit source operand * conversion before the store. */ if ((WalkState->Opcode == AML_COPY_OP) || !ImplicitConversion) { /* * However, CopyObject and Stores to ArgX do not perform * an implicit conversion, as per the ACPI specification. * A direct store is performed instead. */ Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState); break; } /* Store with implicit source operand conversion support */ Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc, &NewDesc, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } if (NewDesc != TargetDesc) { /* * Store the new NewDesc as the new value of the Name, and set * the Name's type to that of the value being stored in it. * SourceDesc reference count is incremented by AttachObject. * * Note: This may change the type of the node if an explicit * store has been performed such that the node/object type * has been changed. */ Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Store %s into %s via Convert/Attach/n", AcpiUtGetObjectTypeName (SourceDesc), AcpiUtGetObjectTypeName (NewDesc))); } break; case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: /* * For all fields, always write the source data to the target * field. Any required implicit source operand conversion is * performed in the function below as necessary. Note, field * objects must retain their original type permanently. *///.........这里部分代码省略.........
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:101,
示例10: AcpiExStoreObjectToNodeACPI_STATUSAcpiExStoreObjectToNode ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_NAMESPACE_NODE *Node, ACPI_WALK_STATE *WalkState, UINT8 ImplicitConversion){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *TargetDesc; ACPI_OPERAND_OBJECT *NewDesc; ACPI_OBJECT_TYPE TargetType; ACPI_FUNCTION_TRACE_PTR (ExStoreObjectToNode, SourceDesc); /* Get current type of the node, and object attached to Node */ TargetType = AcpiNsGetType (Node); TargetDesc = AcpiNsGetAttachedObject (Node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)/n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), Node, AcpiUtGetTypeName (TargetType))); /* * Resolve the source object to an actual value * (If it is a reference object) */ Status = AcpiExResolveObject (&SourceDesc, TargetType, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* If no implicit conversion, drop into the default case below */ if ((!ImplicitConversion) || ((WalkState->Opcode == AML_COPY_OP) && (TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) && (TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) && (TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD))) { /* * Force execution of default (no implicit conversion). Note: * CopyObject does not perform an implicit conversion, as per the ACPI * spec -- except in case of region/bank/index fields -- because these * objects must retain their original type permanently. */ TargetType = ACPI_TYPE_ANY; } /* Do the actual store operation */ switch (TargetType) { case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: /* For fields, copy the source data to the target field. */ Status = AcpiExWriteDataToField (SourceDesc, TargetDesc, &WalkState->ResultObj); break; case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: /* * These target types are all of type Integer/String/Buffer, and * therefore support implicit conversion before the store. * * Copy and/or convert the source object to a new target object */ Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc, &NewDesc, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } if (NewDesc != TargetDesc) { /* * Store the new NewDesc as the new value of the Name, and set * the Name's type to that of the value being stored in it. * SourceDesc reference count is incremented by AttachObject. * * Note: This may change the type of the node if an explicit store * has been performed such that the node/object type has been * changed. */ Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Store %s into %s via Convert/Attach/n",//.........这里部分代码省略.........
开发者ID:NoSuchProcess,项目名称:phantomuserland,代码行数:101,
示例11: AcpiExSetupRegionstatic ACPI_STATUSAcpiExSetupRegion ( ACPI_OPERAND_OBJECT *ObjDesc, UINT32 FieldDatumByteOffset){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RgnDesc; UINT8 SpaceId; ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset); RgnDesc = ObjDesc->CommonField.RegionObj; /* We must have a valid region */ if (RgnDesc->Common.Type != ACPI_TYPE_REGION) { ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)", RgnDesc->Common.Type, AcpiUtGetObjectTypeName (RgnDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } SpaceId = RgnDesc->Region.SpaceId; /* Validate the Space ID */ if (!AcpiIsValidSpaceId (SpaceId)) { ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); } /* * If the Region Address and Length have not been previously evaluated, * evaluate them now and save the results. */ if (!(RgnDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetRegionArguments (RgnDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear * address space and the request cannot be directly validated */ if (SpaceId == ACPI_ADR_SPACE_SMBUS || SpaceId == ACPI_ADR_SPACE_GSBUS || SpaceId == ACPI_ADR_SPACE_IPMI) { /* SMBus or IPMI has a non-linear address space */ return_ACPI_STATUS (AE_OK); }#ifdef ACPI_UNDER_DEVELOPMENT /* * If the Field access is AnyAcc, we can now compute the optimal * access (because we know know the length of the parent region) */ if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) { if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } }#endif /* * Validate the request. The entire request from the byte offset for a * length of one field datum (access width) must fit within the region. * (Region length is specified in bytes) */ if (RgnDesc->Region.Length < (ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset + ObjDesc->CommonField.AccessByteWidth)) { if (AcpiGbl_EnableInterpreterSlack) { /* * Slack mode only: We will go ahead and allow access to this * field if it is within the region length rounded up to the next * access width boundary. ACPI_SIZE cast for 64-bit compile. */ if (ACPI_ROUND_UP (RgnDesc->Region.Length, ObjDesc->CommonField.AccessByteWidth) >= ((ACPI_SIZE) ObjDesc->CommonField.BaseByteOffset + ObjDesc->CommonField.AccessByteWidth + FieldDatumByteOffset)) { return_ACPI_STATUS (AE_OK);//.........这里部分代码省略.........
开发者ID:derekmarcotte,项目名称:freebsd,代码行数:101,
示例12: AcpiExStoreACPI_STATUSAcpiExStore ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RefDesc = DestDesc; ACPI_FUNCTION_TRACE_PTR (ExStore, DestDesc); /* Validate parameters */ if (!SourceDesc || !DestDesc) { ACPI_ERROR ((AE_INFO, "Null parameter")); return_ACPI_STATUS (AE_AML_NO_OPERAND); } /* DestDesc can be either a namespace node or an ACPI object */ if (ACPI_GET_DESCRIPTOR_TYPE (DestDesc) == ACPI_DESC_TYPE_NAMED) { /* * Dest is a namespace node, * Storing an object into a Named node. */ Status = AcpiExStoreObjectToNode (SourceDesc, (ACPI_NAMESPACE_NODE *) DestDesc, WalkState, ACPI_IMPLICIT_CONVERSION); return_ACPI_STATUS (Status); } /* Destination object must be a Reference or a Constant object */ switch (DestDesc->Common.Type) { case ACPI_TYPE_LOCAL_REFERENCE: break; case ACPI_TYPE_INTEGER: /* Allow stores to Constants -- a Noop as per ACPI spec */ if (DestDesc->Common.Flags & AOPOBJ_AML_CONSTANT) { return_ACPI_STATUS (AE_OK); } /*lint -fallthrough */ default: /* Destination is not a Reference object */ ACPI_ERROR ((AE_INFO, "Target is not a Reference or Constant object - [%s] %p", AcpiUtGetObjectTypeName (DestDesc), DestDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* * Examine the Reference class. These cases are handled: * * 1) Store to Name (Change the object associated with a name) * 2) Store to an indexed area of a Buffer or Package * 3) Store to a Method Local or Arg * 4) Store to the debug object */ switch (RefDesc->Reference.Class) { case ACPI_REFCLASS_REFOF: /* Storing an object into a Name "container" */ Status = AcpiExStoreObjectToNode (SourceDesc, RefDesc->Reference.Object, WalkState, ACPI_IMPLICIT_CONVERSION); break; case ACPI_REFCLASS_INDEX: /* Storing to an Index (pointer into a packager or buffer) */ Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState); break; case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: /* Store to a method local/arg */ Status = AcpiDsStoreObjectToLocal (RefDesc->Reference.Class, RefDesc->Reference.Value, SourceDesc, WalkState); break;//.........这里部分代码省略.........
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:101,
示例13: AcpiExResolveNodeToValueACPI_STATUSAcpiExResolveNodeToValue ( ACPI_NAMESPACE_NODE **ObjectPtr, ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *SourceDesc; ACPI_OPERAND_OBJECT *ObjDesc = NULL; ACPI_NAMESPACE_NODE *Node; ACPI_OBJECT_TYPE EntryType; ACPI_FUNCTION_TRACE (ExResolveNodeToValue); /* * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the * object that is attached to the Node. */ Node = *ObjectPtr; SourceDesc = AcpiNsGetAttachedObject (Node); EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]/n", Node, SourceDesc, AcpiUtGetTypeName (EntryType))); if ((EntryType == ACPI_TYPE_LOCAL_ALIAS) || (EntryType == ACPI_TYPE_LOCAL_METHOD_ALIAS)) { /* There is always exactly one level of indirection */ Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Node->Object); SourceDesc = AcpiNsGetAttachedObject (Node); EntryType = AcpiNsGetType ((ACPI_HANDLE) Node); *ObjectPtr = Node; } /* * Several object types require no further processing: * 1) Device/Thermal objects don't have a "real" subobject, return the Node * 2) Method locals and arguments have a pseudo-Node * 3) 10/2007: Added method type to assist with Package construction. */ if ((EntryType == ACPI_TYPE_DEVICE) || (EntryType == ACPI_TYPE_THERMAL) || (EntryType == ACPI_TYPE_METHOD) || (Node->Flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL))) { return_ACPI_STATUS (AE_OK); } if (!SourceDesc) { ACPI_ERROR ((AE_INFO, "No object attached to node %p", Node)); return_ACPI_STATUS (AE_AML_NO_OPERAND); } /* * Action is based on the type of the Node, which indicates the type * of the attached object or pointer */ switch (EntryType) { case ACPI_TYPE_PACKAGE: if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE) { ACPI_ERROR ((AE_INFO, "Object not a Package, type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } Status = AcpiDsGetPackageArguments (SourceDesc); if (ACPI_SUCCESS (Status)) { /* Return an additional reference to the object */ ObjDesc = SourceDesc; AcpiUtAddReference (ObjDesc); } break; case ACPI_TYPE_BUFFER: if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, "Object not a Buffer, type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } Status = AcpiDsGetBufferArguments (SourceDesc); if (ACPI_SUCCESS (Status)) { /* Return an additional reference to the object */ ObjDesc = SourceDesc;//.........这里部分代码省略.........
开发者ID:libkeiser,项目名称:illumos-nexenta,代码行数:101,
示例14: AcpiExStoreObjectToIndex//.........这里部分代码省略......... if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } if (ObjDesc) { /* Decrement reference count by the ref count of the parent package */ for (i = 0; i < ((ACPI_OPERAND_OBJECT *) IndexDesc->Reference.Object)->Common.ReferenceCount; i++) { AcpiUtRemoveReference (ObjDesc); } } *(IndexDesc->Reference.Where) = NewDesc; /* Increment ref count by the ref count of the parent package-1 */ for (i = 1; i < ((ACPI_OPERAND_OBJECT *) IndexDesc->Reference.Object)->Common.ReferenceCount; i++) { AcpiUtAddReference (NewDesc); } break; case ACPI_TYPE_BUFFER_FIELD: /* * Store into a Buffer or String (not actually a real BufferField) * at a location defined by an Index. * * The first 8-bit element of the source object is written to the * 8-bit Buffer location defined by the Index destination object, * according to the ACPI 2.0 specification. */ /* * Make sure the target is a Buffer or String. An error should * not happen here, since the ReferenceObject was constructed * by the INDEX_OP code. */ ObjDesc = IndexDesc->Reference.Object; if ((ObjDesc->Common.Type != ACPI_TYPE_BUFFER) && (ObjDesc->Common.Type != ACPI_TYPE_STRING)) { return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* * The assignment of the individual elements will be slightly * different for each source type. */ switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: /* Use the least-significant byte of the integer */ Value = (UINT8) (SourceDesc->Integer.Value); break; case ACPI_TYPE_BUFFER: case ACPI_TYPE_STRING: /* Note: Takes advantage of common string/buffer fields */ Value = SourceDesc->Buffer.Pointer[0]; break; default: /* All other types are invalid */ ACPI_ERROR ((AE_INFO, "Source must be type [Integer/Buffer/String], found [%s]", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Store the source value into the target buffer byte */ ObjDesc->Buffer.Pointer[IndexDesc->Reference.Value] = Value; break; default: ACPI_ERROR ((AE_INFO, "Target is not of type [Package/BufferField]")); Status = AE_AML_TARGET_TYPE; break; } return_ACPI_STATUS (Status);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:101,
示例15: AcpiExWriteDataToFieldACPI_STATUSAcpiExWriteDataToField ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ResultDesc){ ACPI_STATUS Status; UINT32 Length; void *Buffer; ACPI_OPERAND_OBJECT *BufferDesc; UINT32 Function; UINT16 AccessorType; ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc); /* Parameter validation */ if (!SourceDesc || !ObjDesc) { return_ACPI_STATUS (AE_AML_NO_OPERAND); } if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) { /* * If the BufferField arguments have not been previously evaluated, * evaluate them now and save the results. */ if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetBufferFieldArguments (ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* * This is an SMBus, GSBus or IPMI write. We will bypass the entire * field mechanism and handoff the buffer directly to the handler. * For these address spaces, the buffer is bi-directional; on a * write, return data is returned in the same buffer. * * Source must be a buffer of sufficient size: * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or * ACPI_IPMI_BUFFER_SIZE. * * Note: SMBus and GSBus protocol type is passed in upper 16-bits * of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, "SMBus/IPMI/GenericSerialBus write requires " "Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) { AccessorType = ObjDesc->Field.Attribute; Length = AcpiExGetSerialAccessLength ( AccessorType, ObjDesc->Field.AccessLength); /* * Add additional 2 bytes for the GenericSerialBus data buffer: * * Status; (Byte 0 of the data buffer) * Length; (Byte 1 of the data buffer) * Data[x-1]: (Bytes 2-x of the arbitrary length data buffer) */ Length += 2; Function = ACPI_WRITE | (AccessorType << 16); } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; Function = ACPI_WRITE; } if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, "SMBus/IPMI/GenericSerialBus write requires "//.........这里部分代码省略.........
开发者ID:CSRedRat,项目名称:reactos,代码行数:101,
示例16: AcpiExConvertToTargetTypeACPI_STATUSAcpiExConvertToTargetType ( ACPI_OBJECT_TYPE DestinationType, ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT **ResultDesc, ACPI_WALK_STATE *WalkState){ ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_TRACE (ExConvertToTargetType); /* Default behavior */ *ResultDesc = SourceDesc; /* * If required by the target, * perform implicit conversion on the source before we store it. */ switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs)) { case ARGI_SIMPLE_TARGET: case ARGI_FIXED_TARGET: case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */ switch (DestinationType) { case ACPI_TYPE_LOCAL_REGION_FIELD: /* * Named field can always handle conversions */ break; default: /* No conversion allowed for these types */ if (DestinationType != SourceDesc->Common.Type) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Explicit operator, will store (%s) over existing type (%s)/n", AcpiUtGetObjectTypeName (SourceDesc), AcpiUtGetTypeName (DestinationType))); Status = AE_TYPE; } } break; case ARGI_TARGETREF: switch (DestinationType) { case ACPI_TYPE_INTEGER: case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: case ACPI_TYPE_LOCAL_INDEX_FIELD: /* * These types require an Integer operand. We can convert * a Buffer or a String to an Integer if necessary. */ Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16); break; case ACPI_TYPE_STRING: /* * The operand must be a String. We can convert an * Integer or Buffer if necessary */ Status = AcpiExConvertToString (SourceDesc, ResultDesc, ACPI_IMPLICIT_CONVERT_HEX); break; case ACPI_TYPE_BUFFER: /* * The operand must be a Buffer. We can convert an * Integer or String if necessary */ Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc); break; default: ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X", DestinationType)); Status = AE_AML_INTERNAL; break; } break; case ARGI_REFERENCE: /* * CreateXxxxField cases - we are storing the field object into the name */ break; default://.........这里部分代码省略.........
开发者ID:littleyu9403,项目名称:acpica-1,代码行数:101,
示例17: AcpiRsCreatePciRoutingTableACPI_STATUSAcpiRsCreatePciRoutingTable ( ACPI_OPERAND_OBJECT *PackageObject, ACPI_BUFFER *OutputBuffer){ UINT8 *Buffer; ACPI_OPERAND_OBJECT **TopObjectList; ACPI_OPERAND_OBJECT **SubObjectList; ACPI_OPERAND_OBJECT *ObjDesc; ACPI_SIZE BufferSizeNeeded = 0; UINT32 NumberOfElements; UINT32 Index; ACPI_PCI_ROUTING_TABLE *UserPrt; ACPI_NAMESPACE_NODE *Node; ACPI_STATUS Status; ACPI_BUFFER PathBuffer; ACPI_FUNCTION_TRACE (RsCreatePciRoutingTable); /* Params already validated, so we don't re-validate here */ /* Get the required buffer length */ Status = AcpiRsGetPciRoutingTableLength (PackageObject, &BufferSizeNeeded); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "BufferSizeNeeded = %X/n", (UINT32) BufferSizeNeeded)); /* Validate/Allocate/Clear caller buffer */ Status = AcpiUtInitializeBuffer (OutputBuffer, BufferSizeNeeded); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a * package that in turn contains an UINT64 Address, a UINT8 Pin, * a Name, and a UINT8 SourceIndex. */ TopObjectList = PackageObject->Package.Elements; NumberOfElements = PackageObject->Package.Count; Buffer = OutputBuffer->Pointer; UserPrt = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer); for (Index = 0; Index < NumberOfElements; Index++) { /* * Point UserPrt past this current structure * * NOTE: On the first iteration, UserPrt->Length will * be zero because we cleared the return buffer earlier */ Buffer += UserPrt->Length; UserPrt = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer); /* * Fill in the Length field with the information we have at this point. * The minus four is to subtract the size of the UINT8 Source[4] member * because it is added below. */ UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4); /* Each subpackage must be of length 4 */ if ((*TopObjectList)->Package.Count != 4) { ACPI_ERROR ((AE_INFO, "(PRT[%u]) Need package of length 4, found length %u", Index, (*TopObjectList)->Package.Count)); return_ACPI_STATUS (AE_AML_PACKAGE_LIMIT); } /* * Dereference the subpackage. * The SubObjectList will now point to an array of the four IRQ * elements: [Address, Pin, Source, SourceIndex] */ SubObjectList = (*TopObjectList)->Package.Elements; /* 1) First subobject: Dereference the PRT.Address */ ObjDesc = SubObjectList[0]; if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } UserPrt->Address = ObjDesc->Integer.Value;//.........这里部分代码省略.........
开发者ID:Stichting-MINIX-Research-Foundation,项目名称:minix,代码行数:101,
示例18: 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:Alkzndr,项目名称:freebsd,代码行数:101,
示例19: AcpiExWriteDataToFieldACPI_STATUSAcpiExWriteDataToField ( ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *ObjDesc, ACPI_OPERAND_OBJECT **ResultDesc){ ACPI_STATUS Status; UINT32 Length; void *Buffer; ACPI_OPERAND_OBJECT *BufferDesc; UINT32 Function; ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc); /* Parameter validation */ if (!SourceDesc || !ObjDesc) { return_ACPI_STATUS (AE_AML_NO_OPERAND); } if (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD) { /* * If the BufferField arguments have not been previously evaluated, * evaluate them now and save the results. */ if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)) { Status = AcpiDsGetBufferFieldArguments (ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* * This is an SMBus, GSBus or IPMI write. We will bypass the entire field * mechanism and handoff the buffer directly to the handler. For * these address spaces, the buffer is bi-directional; on a write, * return data is returned in the same buffer. * * Source must be a buffer of sufficient size: * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) { Length = ACPI_GSBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; Function = ACPI_WRITE; } if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); } /* Create the bi-directional buffer */ BufferDesc = AcpiUtCreateBufferObject (Length); if (!BufferDesc) { return_ACPI_STATUS (AE_NO_MEMORY); } Buffer = BufferDesc->Buffer.Pointer; ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length); /* Lock entire transaction if requested *///.........这里部分代码省略.........
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:101,
示例20: AcpiNsCheckObjectTypeACPI_STATUSAcpiNsCheckObjectType ( ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr, UINT32 ExpectedBtypes, UINT32 PackageIndex){ ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_STATUS Status = AE_OK; char TypeBuffer[96]; /* Room for 10 types */ /* A Namespace node should not get here, but make sure */ if (ReturnObject && ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED) { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid return type - Found a Namespace node [%4.4s] type %s", ReturnObject->Node.Name.Ascii, AcpiUtGetTypeName (ReturnObject->Node.Type))); return (AE_AML_OPERAND_TYPE); } /* * Convert the object type (ACPI_TYPE_xxx) to a bitmapped object type. * The bitmapped type allows multiple possible return types. * * Note, the cases below must handle all of the possible types returned * from all of the predefined names (including elements of returned * packages) */ Info->ReturnBtype = AcpiNsGetBitmappedType (ReturnObject); if (Info->ReturnBtype == ACPI_RTYPE_ANY) { /* Not one of the supported objects, must be incorrect */ goto TypeErrorExit; } /* For reference objects, check that the reference type is correct */ if ((Info->ReturnBtype & ExpectedBtypes) == ACPI_RTYPE_REFERENCE) { Status = AcpiNsCheckReference (Info, ReturnObject); return (Status); } /* Attempt simple repair of the returned object if necessary */ Status = AcpiNsSimpleRepair (Info, ExpectedBtypes, PackageIndex, ReturnObjectPtr); if (ACPI_SUCCESS (Status)) { return (AE_OK); /* Successful repair */ }TypeErrorExit: /* Create a string with all expected types for this predefined object */ AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes); if (!ReturnObject) { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Expected return object of type %s", TypeBuffer)); } else if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return type mismatch - found %s, expected %s", AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } else { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return Package type mismatch at index %u - " "found %s, expected %s", PackageIndex, AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } return (AE_AML_OPERAND_TYPE);}
开发者ID:ahs3,项目名称:acpica-tools,代码行数:85,
示例21: AcpiNsSimpleRepair//.........这里部分代码省略......... } if (ExpectedBtypes & ACPI_RTYPE_INTEGER) { Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { goto ObjectRepaired; } } if (ExpectedBtypes & ACPI_RTYPE_STRING) { Status = AcpiNsConvertToString (ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { goto ObjectRepaired; } } if (ExpectedBtypes & ACPI_RTYPE_BUFFER) { Status = AcpiNsConvertToBuffer (ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { goto ObjectRepaired; } } if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) { /* * A package is expected. We will wrap the existing object with a * new package object. It is often the case that if a variable-length * package is required, but there is only a single object needed, the * BIOS will return that object instead of wrapping it with a Package * object. Note: after the wrapping, the package will be validated * for correct contents (expected object type or types). */ Status = AcpiNsWrapWithPackage (Info, ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { /* * The original object just had its reference count * incremented for being inserted into the new package. */ *ReturnObjectPtr = NewObject; /* New Package object */ Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK); } } /* We cannot repair this object */ return (AE_AML_OPERAND_TYPE);ObjectRepaired: /* Object was successfully repaired */ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) { /* * The original object is a package element. We need to * decrement the reference count of the original object, * for removing it from the package. * * However, if the original object was just wrapped with a * package object as part of the repair, we don't need to * change the reference count. */ if (!(Info->ReturnFlags & ACPI_OBJECT_WRAPPED)) { NewObject->Common.ReferenceCount = ReturnObject->Common.ReferenceCount; if (ReturnObject->Common.ReferenceCount > 1) { ReturnObject->Common.ReferenceCount--; } } ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Converted %s to expected %s at Package index %u/n", Info->FullPathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject), PackageIndex)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Converted %s to expected %s/n", Info->FullPathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject))); } /* Delete old object, install the new return object */ AcpiUtRemoveReference (ReturnObject); *ReturnObjectPtr = NewObject; Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK);}
开发者ID:2asoft,项目名称:freebsd,代码行数:101,
示例22: AcpiDsResultPopACPI_STATUSAcpiDsResultPop ( ACPI_OPERAND_OBJECT **Object, ACPI_WALK_STATE *WalkState){ UINT32 Index; ACPI_GENERIC_STATE *State; ACPI_STATUS Status; ACPI_FUNCTION_NAME (DsResultPop); State = WalkState->Results; /* Incorrect state of result stack */ if (State && !WalkState->ResultCount) { ACPI_ERROR ((AE_INFO, "No results on result stack")); return (AE_AML_INTERNAL); } if (!State && WalkState->ResultCount) { ACPI_ERROR ((AE_INFO, "No result state for result stack")); return (AE_AML_INTERNAL); } /* Empty result stack */ if (!State) { ACPI_ERROR ((AE_INFO, "Result stack is empty! State=%p", WalkState)); return (AE_AML_NO_RETURN_VALUE); } /* Return object of the top element and clean that top element result stack */ WalkState->ResultCount--; Index = (UINT32) WalkState->ResultCount % ACPI_RESULTS_FRAME_OBJ_NUM; *Object = State->Results.ObjDesc [Index]; if (!*Object) { ACPI_ERROR ((AE_INFO, "No result objects on result stack, State=%p", WalkState)); return (AE_AML_NO_RETURN_VALUE); } State->Results.ObjDesc [Index] = NULL; if (Index == 0) { Status = AcpiDsResultStackPop (WalkState); if (ACPI_FAILURE (Status)) { return (Status); } } ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Index=%X State=%p Num=%X/n", *Object, AcpiUtGetObjectTypeName (*Object), Index, WalkState, WalkState->ResultCount)); return (AE_OK);}
开发者ID:JasonFord53,项目名称:freebsd,代码行数:67,
示例23: AcpiNsRepairNullElementACPI_STATUSAcpiNsRepairNullElement ( ACPI_EVALUATE_INFO *Info, UINT32 ExpectedBtypes, UINT32 PackageIndex, ACPI_OPERAND_OBJECT **ReturnObjectPtr){ ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_OPERAND_OBJECT *NewObject; ACPI_FUNCTION_NAME (NsRepairNullElement); /* No repair needed if return object is non-NULL */ if (ReturnObject) { return (AE_OK); } /* * Attempt to repair a NULL element of a Package object. This applies to * predefined names that return a fixed-length package and each element * is required. It does not apply to variable-length packages where NULL * elements are allowed, especially at the end of the package. */ if (ExpectedBtypes & ACPI_RTYPE_INTEGER) { /* Need an Integer - create a zero-value integer */ NewObject = AcpiUtCreateIntegerObject ((UINT64) 0); } else if (ExpectedBtypes & ACPI_RTYPE_STRING) { /* Need a String - create a NULL string */ NewObject = AcpiUtCreateStringObject (0); } else if (ExpectedBtypes & ACPI_RTYPE_BUFFER) { /* Need a Buffer - create a zero-length buffer */ NewObject = AcpiUtCreateBufferObject (0); } else { /* Error for all other expected types */ return (AE_AML_OPERAND_TYPE); } if (!NewObject) { return (AE_NO_MEMORY); } /* Set the reference count according to the parent Package object */ NewObject->Common.ReferenceCount = Info->ParentPackage->Common.ReferenceCount; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Converted NULL package element to expected %s at index %u/n", Info->FullPathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex)); *ReturnObjectPtr = NewObject; Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK);}
开发者ID:2asoft,项目名称:freebsd,代码行数:71,
示例24: AcpiUtDeleteInternalObj//.........这里部分代码省略......... if (SecondDesc) { /* * Free the RegionContext if and only if the handler is one of the * default handlers -- and therefore, we created the context object * locally, it was not created by an external caller. */ HandlerDesc = Object->Region.Handler; if (HandlerDesc) { NextDesc = HandlerDesc->AddressSpace.RegionList; LastObjPtr = &HandlerDesc->AddressSpace.RegionList; /* Remove the region object from the handler's list */ while (NextDesc) { if (NextDesc == Object) { *LastObjPtr = NextDesc->Region.Next; break; } /* Walk the linked list of handler */ LastObjPtr = &NextDesc->Region.Next; NextDesc = NextDesc->Region.Next; } if (HandlerDesc->AddressSpace.HandlerFlags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { /* Deactivate region and free region context */ if (HandlerDesc->AddressSpace.Setup) { (void) HandlerDesc->AddressSpace.Setup (Object, ACPI_REGION_DEACTIVATE, HandlerDesc->AddressSpace.Context, &SecondDesc->Extra.RegionContext); } } AcpiUtRemoveReference (HandlerDesc); } /* Now we can free the Extra object */ AcpiUtDeleteObjectDesc (SecondDesc); } break; case ACPI_TYPE_BUFFER_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Buffer Field %p/n", Object)); SecondDesc = AcpiNsGetSecondaryObject (Object); if (SecondDesc) { AcpiUtDeleteObjectDesc (SecondDesc); } break; case ACPI_TYPE_LOCAL_BANK_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Bank Field %p/n", Object)); SecondDesc = AcpiNsGetSecondaryObject (Object); if (SecondDesc) { AcpiUtDeleteObjectDesc (SecondDesc); } break; default: break; } /* Free any allocated memory (pointer within the object) found above */ if (ObjPointer) { ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Deleting Object Subptr %p/n", ObjPointer)); ACPI_FREE (ObjPointer); } /* Now the object can be safely deleted */ ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Deleting Object %p [%s]/n", Object, AcpiUtGetObjectTypeName (Object))); AcpiUtDeleteObjectDesc (Object); return_VOID;}
开发者ID:B-Rich,项目名称:EBBlib,代码行数:101,
示例25: AcpiExResolveOperands//.........这里部分代码省略......... case ARGI_ANYTYPE: /* Any operand type will do */ TypeNeeded = ACPI_TYPE_ANY; break; case ARGI_DDBHANDLE: /* Need an operand of type ACPI_TYPE_DDB_HANDLE */ TypeNeeded = ACPI_TYPE_LOCAL_REFERENCE; break; /* * The more complex cases allow multiple resolved object types */ case ARGI_INTEGER: /* * Need an operand of type ACPI_TYPE_INTEGER, * But we can implicitly convert from a STRING or BUFFER * Aka - "Implicit Source Operand Conversion" */ Status = AcpiExConvertToInteger (ObjDesc, StackPtr, 16); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ACPI_ERROR ((AE_INFO, "Needed [Integer/String/Buffer], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } return_ACPI_STATUS (Status); } if (ObjDesc != *StackPtr) { AcpiUtRemoveReference (ObjDesc); } goto NextOperand; case ARGI_BUFFER: /* * Need an operand of type ACPI_TYPE_BUFFER, * But we can implicitly convert from a STRING or INTEGER * Aka - "Implicit Source Operand Conversion" */ Status = AcpiExConvertToBuffer (ObjDesc, StackPtr); if (ACPI_FAILURE (Status)) { if (Status == AE_TYPE) { ACPI_ERROR ((AE_INFO, "Needed [Integer/String/Buffer], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); }
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:67,
示例26: AcpiNsEvaluate//.........这里部分代码省略......... ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Execute method [%s] at AML address %p length %X/n", Info->FullPathname, Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1)); /* * Any namespace deletion must acquire both the namespace and * interpreter locks to ensure that no thread is using the portion of * the namespace that is being deleted. * * Execute the method via the interpreter. The interpreter is locked * here before calling into the AML parser */ AcpiExEnterInterpreter (); Status = AcpiPsExecuteMethod (Info); AcpiExExitInterpreter (); break; default: /* * 3) All other non-method objects -- get the current object value */ /* * Some objects require additional resolution steps (e.g., the Node * may be a field that must be read, etc.) -- we can't just grab * the object out of the node. * * Use ResolveNodeToValue() to get the associated value. * * NOTE: we can get away with passing in NULL for a walk state because * the Node is guaranteed to not be a reference to either a method * local or a method argument (because this interface is never called * from a running method.) * * Even though we do not directly invoke the interpreter for object * resolution, we must lock it because we could access an OpRegion. * The OpRegion access code assumes that the interpreter is locked. */ AcpiExEnterInterpreter (); /* TBD: ResolveNodeToValue has a strange interface, fix */ Info->ReturnObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Info->Node); Status = AcpiExResolveNodeToValue (ACPI_CAST_INDIRECT_PTR ( ACPI_NAMESPACE_NODE, &Info->ReturnObject), NULL); AcpiExExitInterpreter (); if (ACPI_FAILURE (Status)) { goto Cleanup; } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returned object %p [%s]/n", Info->ReturnObject, AcpiUtGetObjectTypeName (Info->ReturnObject))); Status = AE_CTRL_RETURN_VALUE; /* Always has a "return value" */ break; } /* * For predefined names, check the return value against the ACPI * specification. Some incorrect return value types are repaired. */ (void) AcpiNsCheckReturnValue (Info->Node, Info, Info->ParamCount, Status, &Info->ReturnObject); /* Check if there is a return value that must be dealt with */ if (Status == AE_CTRL_RETURN_VALUE) { /* If caller does not want the return value, delete it */ if (Info->Flags & ACPI_IGNORE_RETURN_VALUE) { AcpiUtRemoveReference (Info->ReturnObject); Info->ReturnObject = NULL; } /* Map AE_CTRL_RETURN_VALUE to AE_OK, we are done with it */ Status = AE_OK; } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "*** Completed evaluation of object %s ***/n", Info->RelativePathname));Cleanup: /* * Namespace was unlocked by the handling AcpiNs* function, so we * just free the pathname and return */ ACPI_FREE (Info->FullPathname); Info->FullPathname = NULL; return_ACPI_STATUS (Status);}
开发者ID:LauraBerry,项目名称:A2cpsc457,代码行数:101,
示例27: AcpiExDoDebugObjectstatic voidAcpiExDoDebugObject ( ACPI_OPERAND_OBJECT *SourceDesc, UINT32 Level, UINT32 Index){ UINT32 i; ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); /* Print line header as long as we are not in the middle of an object display */ if (!((Level > 0) && Index == 0)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[ACPI Debug] %*s", Level, " ")); } /* Display index for package output only */ if (Index > 0) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "(%.2u) ", Index -1)); } if (!SourceDesc) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[Null Object]/n")); return_VOID; } if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s ", AcpiUtGetObjectTypeName (SourceDesc))); if (!AcpiUtValidInternalObject (SourceDesc)) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%p, Invalid Internal Object!/n", SourceDesc)); return_VOID; } } else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "%s: %p/n", AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), SourceDesc)); return_VOID; } else { return_VOID; } /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: /* Output correct integer width */ if (AcpiGbl_IntegerByteWidth == 4) { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X/n", (UINT32) SourceDesc->Integer.Value)); } else { ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "0x%8.8X%8.8X/n", ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value))); } break; case ACPI_TYPE_BUFFER: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X]/n", (UINT32) SourceDesc->Buffer.Length)); ACPI_DUMP_BUFFER (SourceDesc->Buffer.Pointer, (SourceDesc->Buffer.Length < 256) ? SourceDesc->Buffer.Length : 256); break; case ACPI_TYPE_STRING: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[0x%.2X] /"%s/"/n", SourceDesc->String.Length, SourceDesc->String.Pointer)); break; case ACPI_TYPE_PACKAGE: ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT, "[Contains 0x%.2X Elements]/n", SourceDesc->Package.Count)); /* Output the entire contents of the package */ for (i = 0; i < SourceDesc->Package.Count; i++)//.........这里部分代码省略.........
开发者ID:mmanley,项目名称:Antares,代码行数:101,
注:本文中的AcpiUtGetObjectTypeName函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AcpiUtGetRegionName函数代码示例 C++ AcpiUtGetNodeName函数代码示例 |