您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AcpiUtReleaseMutex函数代码示例

51自学网 2021-06-01 19:40:09
  C++
这篇教程C++ AcpiUtReleaseMutex函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中AcpiUtReleaseMutex函数的典型用法代码示例。如果您正苦于以下问题:C++ AcpiUtReleaseMutex函数的具体用法?C++ AcpiUtReleaseMutex怎么用?C++ AcpiUtReleaseMutex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了AcpiUtReleaseMutex函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: AcpiTbInstallStandardTable

ACPI_STATUSAcpiTbInstallStandardTable (    ACPI_PHYSICAL_ADDRESS   Address,    UINT8                   Flags,    BOOLEAN                 Reload,    BOOLEAN                 Override,    UINT32                  *TableIndex){    UINT32                  i;    ACPI_STATUS             Status = AE_OK;    ACPI_TABLE_DESC         NewTableDesc;    ACPI_FUNCTION_TRACE (TbInstallStandardTable);    /* Acquire a temporary table descriptor for validation */    Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags);    if (ACPI_FAILURE (Status))    {        ACPI_ERROR ((AE_INFO,            "Could not acquire table length at %8.8X%8.8X",            ACPI_FORMAT_UINT64 (Address)));        return_ACPI_STATUS (Status);    }    /*     * Optionally do not load any SSDTs from the RSDT/XSDT. This can     * be useful for debugging ACPI problems on some machines.     */    if (!Reload &&        AcpiGbl_DisableSsdtTableInstall &&        ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT))    {        ACPI_INFO ((            "Ignoring installation of %4.4s at %8.8X%8.8X",            NewTableDesc.Signature.Ascii, ACPI_FORMAT_UINT64 (Address)));        goto ReleaseAndExit;    }    /* Acquire the table lock */    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    /* Validate and verify a table before installation */    Status = AcpiTbVerifyTempTable (&NewTableDesc, NULL, &i);    if (ACPI_FAILURE (Status))    {        if (Status == AE_CTRL_TERMINATE)        {            /*             * Table was unloaded, allow it to be reloaded.             * As we are going to return AE_OK to the caller, we should             * take the responsibility of freeing the input descriptor.             * Refill the input descriptor to ensure             * AcpiTbInstallTableWithOverride() can be called again to             * indicate the re-installation.             */            AcpiTbUninstallTable (&NewTableDesc);            (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);            *TableIndex = i;            return_ACPI_STATUS (AE_OK);        }        goto UnlockAndExit;    }    /* Add the table to the global root table list */    AcpiTbInstallTableWithOverride (&NewTableDesc, Override, TableIndex);    /* Invoke table handler */    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    AcpiTbNotifyTable (ACPI_TABLE_EVENT_INSTALL, NewTableDesc.Pointer);    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);UnlockAndExit:    /* Release the table lock */    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);ReleaseAndExit:    /* Release the temporary table descriptor */    AcpiTbReleaseTempTable (&NewTableDesc);    return_ACPI_STATUS (Status);}
开发者ID:SchmErik,项目名称:acpica,代码行数:91,


示例2: AcpiUtDumpAllocations

voidAcpiUtDumpAllocations (    UINT32                  Component,    char                    *Module){    ACPI_DEBUG_MEM_BLOCK    *Element;    ACPI_DESCRIPTOR         *Descriptor;    UINT32                  NumOutstanding = 0;    ACPI_FUNCTION_TRACE (UtDumpAllocations);    /*     * Walk the allocation list.     */    if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY)))    {        return;    }    Element = AcpiGbl_GlobalList->ListHead;    while (Element)    {        if ((Element->Component & Component) &&            ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module))))        {            /* Ignore allocated objects that are in a cache */            Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace);            if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)            {                AcpiOsPrintf ("%p Len %04X %9.9s-%d [%s] ",                    Descriptor, Element->Size, Element->Module,                    Element->Line, AcpiUtGetDescriptorName (Descriptor));                /* Most of the elements will be Operand objects. */                switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor))                {                case ACPI_DESC_TYPE_OPERAND:                    AcpiOsPrintf ("%12.12s R%hd",                        AcpiUtGetTypeName (Descriptor->Object.Common.Type),                        Descriptor->Object.Common.ReferenceCount);                    break;                case ACPI_DESC_TYPE_PARSER:                    AcpiOsPrintf ("AmlOpcode %04hX",                        Descriptor->Op.Asl.AmlOpcode);                    break;                case ACPI_DESC_TYPE_NAMED:                    AcpiOsPrintf ("%4.4s",                        AcpiUtGetNodeName (&Descriptor->Node));                    break;                default:                    break;                }                AcpiOsPrintf ( "/n");                NumOutstanding++;            }        }        Element = Element->Next;    }    (void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);    /* Print summary */    if (!NumOutstanding)    {        ACPI_INFO ((AE_INFO,            "No outstanding allocations"));    }    else    {        ACPI_ERROR ((AE_INFO,            "%d(%X) Outstanding allocations",            NumOutstanding, NumOutstanding));    }    return_VOID;}
开发者ID:samueldotj,项目名称:AceOS,代码行数:85,


示例3: AcpiLoadTable

ACPI_STATUSAcpiLoadTable (    ACPI_TABLE_HEADER       *Table){    ACPI_STATUS             Status;    UINT32                  TableIndex;    ACPI_FUNCTION_TRACE (AcpiLoadTable);    /* Parameter validation */    if (!Table)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /* Must acquire the interpreter lock during this operation */    Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Install the table and load it into the namespace */    ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:"));    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),                ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE,                &TableIndex);    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    /*     * Note: Now table is "INSTALLED", it must be validated before     * using.     */    Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    Status = AcpiNsLoadTable (TableIndex, AcpiGbl_RootNode);    /* Invoke table handler if present */    if (AcpiGbl_TableHandler)    {        (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,                    AcpiGbl_TableHandlerContext);    }UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);    return_ACPI_STATUS (Status);}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:65,


示例4: AcpiNsRootInitialize

//.........这里部分代码省略.........            switch (InitVal->Type)            {            case ACPI_TYPE_METHOD:                ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val);                ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;#if defined (ACPI_ASL_COMPILER)                /* Save the parameter count for the iASL compiler */                NewNode->Value = ObjDesc->Method.ParamCount;#else                /* Mark this as a very SPECIAL method */                ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;                ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;#endif                break;            case ACPI_TYPE_INTEGER:                ObjDesc->Integer.Value = ACPI_TO_INTEGER (Val);                break;            case ACPI_TYPE_STRING:                /* Build an object around the static string */                ObjDesc->String.Length = (UINT32) strlen (Val);                ObjDesc->String.Pointer = Val;                ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;                break;            case ACPI_TYPE_MUTEX:                ObjDesc->Mutex.Node = NewNode;                ObjDesc->Mutex.SyncLevel = (UINT8) (ACPI_TO_INTEGER (Val) - 1);                /* Create a mutex */                Status = AcpiOsCreateMutex (&ObjDesc->Mutex.OsMutex);                if (ACPI_FAILURE (Status))                {                    AcpiUtRemoveReference (ObjDesc);                    goto UnlockAndExit;                }                /* Special case for ACPI Global Lock */                if (strcmp (InitVal->Name, "_GL_") == 0)                {                    AcpiGbl_GlobalLockMutex = ObjDesc;                    /* Create additional counting semaphore for global lock */                    Status = AcpiOsCreateSemaphore (                                1, 0, &AcpiGbl_GlobalLockSemaphore);                    if (ACPI_FAILURE (Status))                    {                        AcpiUtRemoveReference (ObjDesc);                        goto UnlockAndExit;                    }                }                break;            default:                ACPI_ERROR ((AE_INFO, "Unsupported initial type value 0x%X",                    InitVal->Type));                AcpiUtRemoveReference (ObjDesc);                ObjDesc = NULL;                continue;            }            /* Store pointer to value descriptor in the Node */            Status = AcpiNsAttachObject (NewNode, ObjDesc,                        ObjDesc->Common.Type);            /* Remove local reference to the object */            AcpiUtRemoveReference (ObjDesc);        }    }UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    /* Save a handle to "_GPE", it is always present */    if (ACPI_SUCCESS (Status))    {        Status = AcpiNsGetNode (NULL, "//_GPE", ACPI_NS_NO_UPSEARCH,                    &AcpiGbl_FadtGpeDevice);    }    return_ACPI_STATUS (Status);}
开发者ID:yazshel,项目名称:netbsd-kernel,代码行数:101,


示例5: AcpiEvInitializeRegion

ACPI_STATUSAcpiEvInitializeRegion (    ACPI_OPERAND_OBJECT     *RegionObj,    BOOLEAN                 AcpiNsLocked){    ACPI_OPERAND_OBJECT     *HandlerObj;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_ADR_SPACE_TYPE     SpaceId;    ACPI_NAMESPACE_NODE     *Node;    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);    if (!RegionObj)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)    {        return_ACPI_STATUS (AE_OK);    }    RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;    Node = RegionObj->Region.Node->Parent;    SpaceId = RegionObj->Region.SpaceId;    /*     * The following loop depends upon the root Node having no parent     * ie: AcpiGbl_RootNode->Parent being set to NULL     */    while (Node)    {        /* Check to see if a handler exists */        HandlerObj = NULL;        ObjDesc = AcpiNsGetAttachedObject (Node);        if (ObjDesc)        {            /* Can only be a handler if the object exists */            switch (Node->Type)            {            case ACPI_TYPE_DEVICE:            case ACPI_TYPE_PROCESSOR:            case ACPI_TYPE_THERMAL:                HandlerObj = ObjDesc->CommonNotify.Handler;                break;            case ACPI_TYPE_METHOD:                /*                 * If we are executing module level code, the original                 * Node's object was replaced by this Method object and we                 * saved the handler in the method object.                 *                 * See AcpiNsExecModuleCode                 */                if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)                {                    HandlerObj = ObjDesc->Method.Dispatch.Handler;                }                break;            default:                /* Ignore other objects */                break;            }            HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);            if (HandlerObj)            {                /* Found correct handler */                ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,                    "Found handler %p for region %p in obj %p/n",                    HandlerObj, RegionObj, ObjDesc));                Status = AcpiEvAttachRegion (HandlerObj, RegionObj,                    AcpiNsLocked);                /*                 * Tell all users that this region is usable by                 * running the _REG method                 */                if (AcpiNsLocked)                {                    Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);                    if (ACPI_FAILURE (Status))                    {                        return_ACPI_STATUS (Status);                    }                }                Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);//.........这里部分代码省略.........
开发者ID:Raphine,项目名称:Raph_Kernel,代码行数:101,


示例6: AcpiDbStartCommand

static ACPI_STATUSAcpiDbStartCommand (    ACPI_WALK_STATE         *WalkState,    ACPI_PARSE_OBJECT       *Op){    ACPI_STATUS             Status;    /* TBD: [Investigate] are there namespace locking issues here? */    /* AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); */    /* Go into the command loop and await next user command */    AcpiGbl_MethodExecuting = TRUE;    Status = AE_CTRL_TRUE;    while (Status == AE_CTRL_TRUE)    {        if (AcpiGbl_DebuggerConfiguration == DEBUGGER_MULTI_THREADED)        {            /* Handshake with the front-end that gets user command lines */            Status = AcpiUtReleaseMutex (ACPI_MTX_DEBUG_CMD_COMPLETE);            if (ACPI_FAILURE (Status))            {                return (Status);            }            Status = AcpiUtAcquireMutex (ACPI_MTX_DEBUG_CMD_READY);            if (ACPI_FAILURE (Status))            {                return (Status);            }        }        else        {            /* Single threaded, we must get a command line ourselves */            /* Force output to console until a command is entered */            AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);            /* Different prompt if method is executing */            if (!AcpiGbl_MethodExecuting)            {                AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT);            }            else            {                AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT);            }            /* Get the user input line */            Status = AcpiOsGetLine (AcpiGbl_DbLineBuf,                ACPI_DB_LINE_BUFFER_SIZE, NULL);            if (ACPI_FAILURE (Status))            {                ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line"));                return (Status);            }        }        Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op);    }    /* AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); */    return (Status);}
开发者ID:ksashtekar,项目名称:Ganoid,代码行数:71,


示例7: AcpiWalkNamespace

ACPI_STATUSAcpiWalkNamespace (    ACPI_OBJECT_TYPE        Type,    ACPI_HANDLE             StartObject,    UINT32                  MaxDepth,    ACPI_WALK_CALLBACK      UserFunction,    void                    *Context,    void                    **ReturnValue){    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (AcpiWalkNamespace);    /* Parameter validation */    if ((Type > ACPI_TYPE_LOCAL_MAX) ||        (!MaxDepth)                  ||        (!UserFunction))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /*     * Need to acquire the namespace reader lock to prevent interference     * with any concurrent table unloads (which causes the deletion of     * namespace objects). We cannot allow the deletion of a namespace node     * while the user function is using it. The exception to this are the     * nodes created and deleted during control method execution -- these     * nodes are marked as temporary nodes and are ignored by the namespace     * walk. Thus, control methods can be executed while holding the     * namespace deletion lock (and the user function can execute control     * methods.)     */    Status = AcpiUtAcquireReadLock (&AcpiGbl_NamespaceRwLock);    if (ACPI_FAILURE (Status))    {        return (Status);    }    /*     * Lock the namespace around the walk. The namespace will be     * unlocked/locked around each call to the user function - since the user     * function must be allowed to make ACPICA calls itself (for example, it     * will typically execute control methods during device enumeration.)     */    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,                ACPI_NS_WALK_UNLOCK, UserFunction, Context, ReturnValue);    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);UnlockAndExit:    (void) AcpiUtReleaseReadLock (&AcpiGbl_NamespaceRwLock);    return_ACPI_STATUS (Status);}
开发者ID:Quest-V,项目名称:quest,代码行数:62,


示例8: AcpiGetHandle

ACPI_STATUSAcpiGetHandle (    ACPI_HANDLE             Parent,    ACPI_STRING             Pathname,    ACPI_HANDLE             *RetHandle){    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *Node = NULL;    ACPI_NAMESPACE_NODE     *PrefixNode = NULL;    ACPI_FUNCTION_ENTRY ();    /* Parameter Validation */    if (!RetHandle || !Pathname)    {        return (AE_BAD_PARAMETER);    }    /* Convert a parent handle to a prefix node */    if (Parent)    {        Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);        if (ACPI_FAILURE (Status))        {            return (Status);        }        PrefixNode = AcpiNsMapHandleToNode (Parent);        if (!PrefixNode)        {            (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);            return (AE_BAD_PARAMETER);        }        Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);        if (ACPI_FAILURE (Status))        {            return (Status);        }    }    /* Special case for root, since we can't search for it */    if (ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH) == 0)    {        *RetHandle = AcpiNsConvertEntryToHandle (AcpiGbl_RootNode);        return (AE_OK);    }    /*     *  Find the Node and convert to a handle     */    Status = AcpiNsGetNode (PrefixNode, Pathname, ACPI_NS_NO_UPSEARCH,                &Node);    *RetHandle = NULL;    if (ACPI_SUCCESS (Status))    {        *RetHandle = AcpiNsConvertEntryToHandle (Node);    }    return (Status);}
开发者ID:andreiw,项目名称:polaris,代码行数:67,


示例9: AcpiGetName

ACPI_STATUSAcpiGetName (    ACPI_HANDLE             Handle,    UINT32                  NameType,    ACPI_BUFFER             *Buffer){    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *Node;    /* Parameter validation */    if (NameType > ACPI_NAME_TYPE_MAX)    {        return (AE_BAD_PARAMETER);    }    Status = AcpiUtValidateBuffer (Buffer);    if (ACPI_FAILURE (Status))    {        return (Status);    }    if (NameType == ACPI_FULL_PATHNAME)    {        /* Get the full pathname (From the namespace root) */        Status = AcpiNsHandleToPathname (Handle, Buffer);        return (Status);    }    /*     * Wants the single segment ACPI name.     * Validate handle and convert to a namespace Node     */    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return (Status);    }    Node = AcpiNsMapHandleToNode (Handle);    if (!Node)    {        Status = AE_BAD_PARAMETER;        goto UnlockAndExit;    }    /* Validate/Allocate/Clear caller buffer */    Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    /* Just copy the ACPI name from the Node and zero terminate it */    ACPI_STRNCPY (Buffer->Pointer, AcpiUtGetNodeName (Node),                ACPI_NAME_SIZE);    ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0;    Status = AE_OK;UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    return (Status);}
开发者ID:andreiw,项目名称:polaris,代码行数:69,


示例10: AcpiInstallGpeBlock

ACPI_STATUSAcpiInstallGpeBlock (    ACPI_HANDLE             GpeDevice,    ACPI_GENERIC_ADDRESS    *GpeBlockAddress,    UINT32                  RegisterCount,    UINT32                  InterruptNumber){    ACPI_STATUS             Status;    ACPI_OPERAND_OBJECT     *ObjDesc;    ACPI_NAMESPACE_NODE     *Node;    ACPI_GPE_BLOCK_INFO     *GpeBlock;    ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock);    if ((!GpeDevice)       ||        (!GpeBlockAddress) ||        (!RegisterCount))    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    Node = AcpiNsValidateHandle (GpeDevice);    if (!Node)    {        Status = AE_BAD_PARAMETER;        goto UnlockAndExit;    }    /* Validate the parent device */    if (Node->Type != ACPI_TYPE_DEVICE)    {        Status = AE_TYPE;        goto UnlockAndExit;    }    if (Node->Object)    {        Status = AE_ALREADY_EXISTS;        goto UnlockAndExit;    }    /*     * For user-installed GPE Block Devices, the GpeBlockBaseNumber     * is always zero     */    Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress->Address,        GpeBlockAddress->SpaceId, RegisterCount,        0, InterruptNumber, &GpeBlock);    if (ACPI_FAILURE (Status))    {        goto UnlockAndExit;    }    /* Install block in the DeviceObject attached to the node */    ObjDesc = AcpiNsGetAttachedObject (Node);    if (!ObjDesc)    {        /*         * No object, create a new one (Device nodes do not always have         * an attached object)         */        ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);        if (!ObjDesc)        {            Status = AE_NO_MEMORY;            goto UnlockAndExit;        }        Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);        /* Remove local reference to the object */        AcpiUtRemoveReference (ObjDesc);        if (ACPI_FAILURE (Status))        {            goto UnlockAndExit;        }    }    /* Now install the GPE block in the DeviceObject */    ObjDesc->Device.GpeBlock = GpeBlock;UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    return_ACPI_STATUS (Status);}
开发者ID:Strongc,项目名称:reactos,代码行数:98,


示例11: AcpiEvUpdateGpes

//.........这里部分代码省略.........{    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo;    ACPI_GPE_BLOCK_INFO     *GpeBlock;    ACPI_GPE_WALK_INFO      WalkInfo;    ACPI_STATUS             Status = AE_OK;    UINT32                  NewWakeGpeCount = 0;    /* We will examine only _PRW/_Lxx/_Exx methods owned by this table */    WalkInfo.OwnerId = TableOwnerId;    WalkInfo.ExecuteByOwnerId = TRUE;    WalkInfo.Count = 0;    if (AcpiGbl_LeaveWakeGpesDisabled)    {        /*         * 1) Run any newly-loaded _PRW methods to find any GPEs that         * can now be marked as CAN_WAKE GPEs. Note: We must run the         * _PRW methods before we process the _Lxx/_Exx methods because         * we will enable all runtime GPEs associated with the new         * _Lxx/_Exx methods at the time we process those methods.         *         * Unlock interpreter so that we can run the _PRW methods.         */        WalkInfo.GpeBlock = NULL;        WalkInfo.GpeDevice = NULL;        AcpiExExitInterpreter ();        Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,                    ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,                    AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL);        if (ACPI_FAILURE (Status))        {            ACPI_EXCEPTION ((AE_INFO, Status,                "While executing _PRW methods"));        }        AcpiExEnterInterpreter ();        NewWakeGpeCount = WalkInfo.Count;    }    /*     * 2) Find any _Lxx/_Exx GPE methods that have just been loaded.     *     * Any GPEs that correspond to new _Lxx/_Exx methods and are not     * marked as CAN_WAKE are immediately enabled.     *     * Examine the namespace underneath each GpeDevice within the     * GpeBlock lists.     */    Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);    if (ACPI_FAILURE (Status))    {        return;    }    WalkInfo.Count = 0;    WalkInfo.EnableThisGpe = TRUE;    /* Walk the interrupt level descriptor list */    GpeXruptInfo = AcpiGbl_GpeXruptListHead;    while (GpeXruptInfo)    {        /* Walk all Gpe Blocks attached to this interrupt level */        GpeBlock = GpeXruptInfo->GpeBlockListHead;        while (GpeBlock)        {            WalkInfo.GpeBlock = GpeBlock;            WalkInfo.GpeDevice = GpeBlock->Node;            Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD,                        WalkInfo.GpeDevice, ACPI_UINT32_MAX,                        ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,                        NULL, &WalkInfo, NULL);            if (ACPI_FAILURE (Status))            {                ACPI_EXCEPTION ((AE_INFO, Status,                    "While decoding _Lxx/_Exx methods"));            }            GpeBlock = GpeBlock->Next;        }        GpeXruptInfo = GpeXruptInfo->Next;    }    if (WalkInfo.Count || NewWakeGpeCount)    {        ACPI_INFO ((AE_INFO,            "Enabled %u new runtime GPEs, added %u new wakeup GPEs",            WalkInfo.Count, NewWakeGpeCount));    }    (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);    return;}
开发者ID:iversonjimmy,项目名称:acer_cloud_wifi_copy,代码行数:101,


示例12: AcpiNsLoadTable

ACPI_STATUSAcpiNsLoadTable (    UINT32                  TableIndex,    ACPI_NAMESPACE_NODE     *Node){    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (NsLoadTable);    /*     * Parse the table and load the namespace with all named     * objects found within. Control methods are NOT parsed     * at this time. In fact, the control methods cannot be     * parsed until the entire namespace is loaded, because     * if a control method makes a forward reference (call)     * to another control method, we can't continue parsing     * because we don't know how many arguments to parse next!     */    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* If table already loaded into namespace, just return */    if (AcpiTbIsTableLoaded (TableIndex))    {        Status = AE_ALREADY_EXISTS;        goto Unlock;    }    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Loading table into namespace ****/n"));    Status = AcpiTbAllocateOwnerId (TableIndex);    if (ACPI_FAILURE (Status))    {        goto Unlock;    }    Status = AcpiNsParseTable (TableIndex, Node);    if (ACPI_SUCCESS (Status))    {        AcpiTbSetTableLoadedFlag (TableIndex, TRUE);    }    else    {        /*         * On error, delete any namespace objects created by this table.         * We cannot initialize these objects, so delete them. There are         * a couple of expecially bad cases:         * AE_ALREADY_EXISTS - namespace collision.         * AE_NOT_FOUND - the target of a Scope operator does not         * exist. This target of Scope must already exist in the         * namespace, as per the ACPI specification.         */        (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);        AcpiNsDeleteNamespaceByOwner (            AcpiGbl_RootTableList.Tables[TableIndex].OwnerId);            AcpiTbReleaseOwnerId (TableIndex);        return_ACPI_STATUS (Status);    }Unlock:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Now we can parse the control methods. We always parse     * them here for a sanity check, and if configured for     * just-in-time parsing, we delete the control method     * parse trees.     */    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Begin Table Object Initialization/n"));    Status = AcpiDsInitializeObjects (TableIndex, Node);    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Completed Table Object Initialization/n"));    return_ACPI_STATUS (Status);}
开发者ID:ModeenF,项目名称:haiku,代码行数:91,


示例13: AcpiEvDeleteGpeBlock

ACPI_STATUSAcpiEvDeleteGpeBlock (    ACPI_GPE_BLOCK_INFO     *GpeBlock){    ACPI_STATUS             Status;    ACPI_CPU_FLAGS          Flags;    ACPI_FUNCTION_TRACE (EvInstallGpeBlock);    Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Disable all GPEs in this block */    Status = AcpiHwDisableGpeBlock (GpeBlock->XruptBlock, GpeBlock, NULL);    if (!GpeBlock->Previous && !GpeBlock->Next)    {        /* This is the last GpeBlock on this interrupt */        Status = AcpiEvDeleteGpeXrupt (GpeBlock->XruptBlock);        if (ACPI_FAILURE (Status))        {            goto UnlockAndExit;        }    }    else    {        /* Remove the block on this interrupt with lock */        Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);        if (GpeBlock->Previous)        {            GpeBlock->Previous->Next = GpeBlock->Next;        }        else        {            GpeBlock->XruptBlock->GpeBlockListHead = GpeBlock->Next;        }        if (GpeBlock->Next)        {            GpeBlock->Next->Previous = GpeBlock->Previous;        }        AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);    }    AcpiCurrentGpeCount -= GpeBlock->GpeCount;    /* Free the GpeBlock */    ACPI_FREE (GpeBlock->RegisterInfo);    ACPI_FREE (GpeBlock->EventInfo);    ACPI_FREE (GpeBlock);UnlockAndExit:    Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);    return_ACPI_STATUS (Status);}
开发者ID:ikitayama,项目名称:acpica-tools,代码行数:65,


示例14: AcpiEvInitializeRegion

//.........这里部分代码省略.........            switch (Node->Type)            {            case ACPI_TYPE_DEVICE:                HandlerObj = ObjDesc->Device.Handler;                break;            case ACPI_TYPE_PROCESSOR:                HandlerObj = ObjDesc->Processor.Handler;                break;            case ACPI_TYPE_THERMAL:                HandlerObj = ObjDesc->ThermalZone.Handler;                break;            case ACPI_TYPE_METHOD:                /*                 * If we are executing module level code, the original                 * Node's object was replaced by this Method object and we                 * saved the handler in the method object.                 *                 * See AcpiNsExecModuleCode                 */                if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)                {                    HandlerObj = ObjDesc->Method.Dispatch.Handler;                }                break;            default:                /* Ignore other objects */                break;            }            while (HandlerObj)            {                /* Is this handler of the correct type? */                if (HandlerObj->AddressSpace.SpaceId == SpaceId)                {                    /* Found correct handler */                    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,                        "Found handler %p for region %p in obj %p/n",                        HandlerObj, RegionObj, ObjDesc));                    Status = AcpiEvAttachRegion (HandlerObj, RegionObj,                                AcpiNsLocked);                    /*                     * Tell all users that this region is usable by                     * running the _REG method                     */                    if (AcpiNsLocked)                    {                        Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);                        if (ACPI_FAILURE (Status))                        {                            return_ACPI_STATUS (Status);                        }                    }                    Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);                    if (AcpiNsLocked)                    {                        Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);                        if (ACPI_FAILURE (Status))                        {                            return_ACPI_STATUS (Status);                        }                    }                    return_ACPI_STATUS (AE_OK);                }                /* Try next handler in the list */                HandlerObj = HandlerObj->AddressSpace.Next;            }        }        /* This node does not have the handler we need; Pop up one level */        Node = Node->Parent;    }    /* If we get here, there is no handler for this region */    ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,        "No handler for RegionType %s(%X) (RegionObj %p)/n",        AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));    return_ACPI_STATUS (AE_NOT_EXIST);}
开发者ID:hoangduit,项目名称:reactos,代码行数:101,


示例15: AcpiNsWalkNamespace

ACPI_STATUSAcpiNsWalkNamespace (    ACPI_OBJECT_TYPE        Type,    ACPI_HANDLE             StartNode,    UINT32                  MaxDepth,    UINT32                  Flags,    ACPI_WALK_CALLBACK      PreOrderVisit,    ACPI_WALK_CALLBACK      PostOrderVisit,    void                    *Context,    void                    **ReturnValue){    ACPI_STATUS             Status;    ACPI_STATUS             MutexStatus;    ACPI_NAMESPACE_NODE     *ChildNode;    ACPI_NAMESPACE_NODE     *ParentNode;    ACPI_OBJECT_TYPE        ChildType;    UINT32                  Level;    BOOLEAN                 NodePreviouslyVisited = FALSE;    ACPI_FUNCTION_TRACE (NsWalkNamespace);    /* Special case for the namespace Root Node */    if (StartNode == ACPI_ROOT_OBJECT)    {        StartNode = AcpiGbl_RootNode;    }    /* Null child means "get first node" */    ParentNode  = StartNode;    ChildNode   = AcpiNsGetNextNode (ParentNode, NULL);    ChildType   = ACPI_TYPE_ANY;    Level       = 1;    /*     * Traverse the tree of nodes until we bubble back up to where we     * started. When Level is zero, the loop is done because we have     * bubbled up to (and passed) the original parent handle (StartEntry)     */    while (Level > 0 && ChildNode)    {        Status = AE_OK;        /* Found next child, get the type if we are not searching for ANY */        if (Type != ACPI_TYPE_ANY)        {            ChildType = ChildNode->Type;        }        /*         * Ignore all temporary namespace nodes (created during control         * method execution) unless told otherwise. These temporary nodes         * can cause a race condition because they can be deleted during         * the execution of the user function (if the namespace is         * unlocked before invocation of the user function.) Only the         * debugger namespace dump will examine the temporary nodes.         */        if ((ChildNode->Flags & ANOBJ_TEMPORARY) &&            !(Flags & ACPI_NS_WALK_TEMP_NODES))        {            Status = AE_CTRL_DEPTH;        }        /* Type must match requested type */        else if (ChildType == Type)        {            /*             * Found a matching node, invoke the user callback function.             * Unlock the namespace if flag is set.             */            if (Flags & ACPI_NS_WALK_UNLOCK)            {                MutexStatus = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);                if (ACPI_FAILURE (MutexStatus))                {                    return_ACPI_STATUS (MutexStatus);                }            }            /*             * Invoke the user function, either pre-order or post-order             * or both.             */            if (!NodePreviouslyVisited)            {                if (PreOrderVisit)                {                    Status = PreOrderVisit (ChildNode, Level,                                Context, ReturnValue);                }            }            else            {                if (PostOrderVisit)                {//.........这里部分代码省略.........
开发者ID:luciang,项目名称:haiku,代码行数:101,


示例16: AcpiGetObjectInfo

ACPI_STATUSAcpiGetObjectInfo (    ACPI_HANDLE             Handle,    ACPI_BUFFER             *Buffer){    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *Node;    ACPI_DEVICE_INFO        *Info;    ACPI_DEVICE_INFO        *ReturnInfo;    ACPI_COMPATIBLE_ID_LIST *CidList = NULL;    ACPI_SIZE               Size;    /* Parameter validation */    if (!Handle || !Buffer)    {        return (AE_BAD_PARAMETER);    }    Status = AcpiUtValidateBuffer (Buffer);    if (ACPI_FAILURE (Status))    {        return (Status);    }    Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_INFO));    if (!Info)    {        return (AE_NO_MEMORY);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        goto Cleanup;    }    Node = AcpiNsMapHandleToNode (Handle);    if (!Node)    {        (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);        goto Cleanup;    }    /* Init return structure */    Size = sizeof (ACPI_DEVICE_INFO);    Info->Type  = Node->Type;    Info->Name  = Node->Name.Integer;    Info->Valid = 0;    Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        goto Cleanup;    }    /* If not a device, we are all done */    if (Info->Type == ACPI_TYPE_DEVICE)    {        /*         * Get extra info for ACPI Devices objects only:         * Run the Device _HID, _UID, _CID, _STA, _ADR and _SxD methods.         *         * Note: none of these methods are required, so they may or may         * not be present for this device.  The Info->Valid bitfield is used         * to indicate which methods were found and ran successfully.         */        /* Execute the Device._HID method */        Status = AcpiUtExecute_HID (Node, &Info->HardwareId);        if (ACPI_SUCCESS (Status))        {            Info->Valid |= ACPI_VALID_HID;        }        /* Execute the Device._UID method */        Status = AcpiUtExecute_UID (Node, &Info->UniqueId);        if (ACPI_SUCCESS (Status))        {            Info->Valid |= ACPI_VALID_UID;        }        /* Execute the Device._CID method */        Status = AcpiUtExecute_CID (Node, &CidList);        if (ACPI_SUCCESS (Status))        {            Size += CidList->Size;            Info->Valid |= ACPI_VALID_CID;        }        /* Execute the Device._STA method */        Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus);//.........这里部分代码省略.........
开发者ID:andreiw,项目名称:polaris,代码行数:101,


示例17: AcpiTbLoadNamespace

ACPI_STATUSAcpiTbLoadNamespace (    void){    ACPI_STATUS             Status;    UINT32                  i;    ACPI_TABLE_HEADER       *NewDsdt;    ACPI_TABLE_DESC         *Table;    UINT32                  TablesLoaded = 0;    UINT32                  TablesFailed = 0;    ACPI_FUNCTION_TRACE (TbLoadNamespace);    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    /*     * Load the namespace. The DSDT is required, but any SSDT and     * PSDT tables are optional. Verify the DSDT.     */    Table = &AcpiGbl_RootTableList.Tables[AcpiGbl_DsdtIndex];    if (!AcpiGbl_RootTableList.CurrentTableCount ||        !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_DSDT) ||         ACPI_FAILURE (AcpiTbValidateTable (Table)))    {        Status = AE_NO_ACPI_TABLES;        goto UnlockAndExit;    }    /*     * Save the DSDT pointer for simple access. This is the mapped memory     * address. We must take care here because the address of the .Tables     * array can change dynamically as tables are loaded at run-time. Note:     * .Pointer field is not validated until after call to AcpiTbValidateTable.     */    AcpiGbl_DSDT = Table->Pointer;    /*     * Optionally copy the entire DSDT to local memory (instead of simply     * mapping it.) There are some BIOSs that corrupt or replace the original     * DSDT, creating the need for this option. Default is FALSE, do not copy     * the DSDT.     */    if (AcpiGbl_CopyDsdtLocally)    {        NewDsdt = AcpiTbCopyDsdt (AcpiGbl_DsdtIndex);        if (NewDsdt)        {            AcpiGbl_DSDT = NewDsdt;        }    }    /*     * Save the original DSDT header for detection of table corruption     * and/or replacement of the DSDT from outside the OS.     */    memcpy (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,        sizeof (ACPI_TABLE_HEADER));    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    /* Load and parse tables */    Status = AcpiNsLoadTable (AcpiGbl_DsdtIndex, AcpiGbl_RootNode);    if (ACPI_FAILURE (Status))    {        ACPI_EXCEPTION ((AE_INFO, Status, "[DSDT] table load failed"));        TablesFailed++;    }    else    {        TablesLoaded++;    }    /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)    {        Table = &AcpiGbl_RootTableList.Tables[i];        if (!AcpiGbl_RootTableList.Tables[i].Address ||            (!ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_SSDT) &&             !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_PSDT) &&             !ACPI_COMPARE_NAME (Table->Signature.Ascii, ACPI_SIG_OSDT)) ||             ACPI_FAILURE (AcpiTbValidateTable (Table)))        {            continue;        }        /* Ignore errors while loading tables, get as many as possible */        (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);        Status =  AcpiNsLoadTable (i, AcpiGbl_RootNode);        if (ACPI_FAILURE (Status))        {            ACPI_EXCEPTION ((AE_INFO, Status, "(%4.4s:%8.8s) while loading table",                Table->Signature.Ascii, Table->Pointer->OemTableId));//.........这里部分代码省略.........
开发者ID:JasonFord53,项目名称:freebsd,代码行数:101,


示例18: AcpiNsLoadTable

ACPI_STATUSAcpiNsLoadTable (    UINT32                  TableIndex,    ACPI_NAMESPACE_NODE     *Node){    ACPI_STATUS             Status;    ACPI_FUNCTION_TRACE (NsLoadTable);    /*     * Parse the table and load the namespace with all named     * objects found within. Control methods are NOT parsed     * at this time. In fact, the control methods cannot be     * parsed until the entire namespace is loaded, because     * if a control method makes a forward reference (call)     * to another control method, we can't continue parsing     * because we don't know how many arguments to parse next!     */    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* If table already loaded into namespace, just return */    if (AcpiTbIsTableLoaded (TableIndex))    {        Status = AE_ALREADY_EXISTS;        goto Unlock;    }    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Loading table into namespace ****/n"));    Status = AcpiTbAllocateOwnerId (TableIndex);    if (ACPI_FAILURE (Status))    {        goto Unlock;    }    Status = AcpiNsParseTable (TableIndex, Node);    if (ACPI_SUCCESS (Status))    {        AcpiTbSetTableLoadedFlag (TableIndex, TRUE);    }    else    {        (void) AcpiTbReleaseOwnerId (TableIndex);    }Unlock:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Now we can parse the control methods. We always parse     * them here for a sanity check, and if configured for     * just-in-time parsing, we delete the control method     * parse trees.     */    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Begin Table Object Initialization/n"));    Status = AcpiDsInitializeObjects (TableIndex, Node);    ACPI_DEBUG_PRINT ((ACPI_DB_INFO,        "**** Completed Table Object Initialization/n"));    return_ACPI_STATUS (Status);}
开发者ID:Lianguocheng,项目名称:acpica,代码行数:77,


示例19: AcpiUtTrackAllocation

static ACPI_STATUSAcpiUtTrackAllocation (    ACPI_DEBUG_MEM_BLOCK    *Allocation,    ACPI_SIZE               Size,    UINT8                   AllocType,    UINT32                  Component,    const char              *Module,    UINT32                  Line){    ACPI_MEMORY_LIST        *MemList;    ACPI_DEBUG_MEM_BLOCK    *Element;    ACPI_STATUS             Status = AE_OK;    ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);    if (AcpiGbl_DisableMemTracking)    {        return_ACPI_STATUS (AE_OK);    }    MemList = AcpiGbl_GlobalList;    Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Search the global list for this address to make sure it is not     * already present. This will catch several kinds of problems.     */    Element = AcpiUtFindAllocation (Allocation);    if (Element == Allocation)    {        ACPI_ERROR ((AE_INFO,            "UtTrackAllocation: Allocation (%p) already present in global list!",            Allocation));        goto UnlockAndExit;    }    /* Fill in the instance data */    Allocation->Size = (UINT32) Size;    Allocation->AllocType = AllocType;    Allocation->Component = Component;    Allocation->Line = Line;    AcpiUtSafeStrncpy (Allocation->Module, (char *) Module, ACPI_MAX_MODULE_NAME);    if (!Element)    {        /* Insert at list head */        if (MemList->ListHead)        {            ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous =                Allocation;        }        Allocation->Next = MemList->ListHead;        Allocation->Previous = NULL;        MemList->ListHead = Allocation;    }    else    {        /* Insert after element */        Allocation->Next = Element->Next;        Allocation->Previous = Element;        if (Element->Next)        {            (Element->Next)->Previous = Allocation;        }        Element->Next = Allocation;    }UnlockAndExit:    Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);    return_ACPI_STATUS (Status);}
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:86,


示例20: AcpiNsGetDeviceCallback

static ACPI_STATUSAcpiNsGetDeviceCallback (    ACPI_HANDLE             ObjHandle,    UINT32                  NestingLevel,    void                    *Context,    void                    **ReturnValue){    ACPI_GET_DEVICES_INFO   *Info = Context;    ACPI_STATUS             Status;    ACPI_NAMESPACE_NODE     *Node;    UINT32                  Flags;    ACPI_DEVICE_ID          *Hid;    ACPI_DEVICE_ID_LIST     *Cid;    UINT32                  i;    BOOLEAN                 Found;    int                     Match;    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return (Status);    }    Node = AcpiNsMapHandleToNode (ObjHandle);    Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        return (Status);    }    if (!Node)    {        return (AE_BAD_PARAMETER);    }    /* Run _STA to determine if device is present */    Status = AcpiUtExecute_STA (Node, &Flags);    if (ACPI_FAILURE (Status))    {        return (AE_CTRL_DEPTH);    }    if (!(Flags & ACPI_STA_DEVICE_PRESENT) &&        !(Flags & ACPI_STA_DEVICE_FUNCTIONING))    {        /*         * Don't examine the children of the device only when the         * device is neither present nor functional. See ACPI spec,         * description of _STA for more information.         */        return (AE_CTRL_DEPTH);    }    /* Filter based on device HID & CID */    if (Info->Hid != NULL)    {        Status = AcpiUtExecute_HID (Node, &Hid);        if (Status == AE_NOT_FOUND)        {            return (AE_OK);        }        else if (ACPI_FAILURE (Status))        {            return (AE_CTRL_DEPTH);        }        Match = ACPI_STRCMP (Hid->String, Info->Hid);        ACPI_FREE (Hid);        if (!Match)        {            /*             * HID does not match, attempt match within the             * list of Compatible IDs (CIDs)             */            Status = AcpiUtExecute_CID (Node, &Cid);            if (Status == AE_NOT_FOUND)            {                return (AE_OK);            }            else if (ACPI_FAILURE (Status))            {                return (AE_CTRL_DEPTH);            }            /* Walk the CID list */            Found = FALSE;            for (i = 0; i < Cid->Count; i++)            {                if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0)                {                    /* Found a matching CID */                    Found = TRUE;                    break;                }//.........这里部分代码省略.........
开发者ID:Quest-V,项目名称:quest,代码行数:101,


示例21: AcpiUtRemoveAllocation

static ACPI_STATUSAcpiUtRemoveAllocation (    ACPI_DEBUG_MEM_BLOCK    *Allocation,    UINT32                  Component,    const char              *Module,    UINT32                  Line){    ACPI_MEMORY_LIST        *MemList;    ACPI_STATUS             Status;    ACPI_FUNCTION_NAME (UtRemoveAllocation);    if (AcpiGbl_DisableMemTracking)    {        return (AE_OK);    }    MemList = AcpiGbl_GlobalList;    if (NULL == MemList->ListHead)    {        /* No allocations! */        ACPI_ERROR ((Module, Line,            "Empty allocation list, nothing to free!"));        return (AE_OK);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);    if (ACPI_FAILURE (Status))    {        return (Status);    }    /* Unlink */    if (Allocation->Previous)    {        (Allocation->Previous)->Next = Allocation->Next;    }    else    {        MemList->ListHead = Allocation->Next;    }    if (Allocation->Next)    {        (Allocation->Next)->Previous = Allocation->Previous;    }    ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X/n",        &Allocation->UserSpace, Allocation->Size));    /* Mark the segment as deleted */    memset (&Allocation->UserSpace, 0xEA, Allocation->Size);    Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);    return (Status);}
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:62,


示例22: AcpiExLoadOp

//.........这里部分代码省略.........        /* Table cannot extend beyond the buffer */        if (Length > ObjDesc->Buffer.Length)        {            return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);        }        if (Length < sizeof (ACPI_TABLE_HEADER))        {            return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH);        }        /*         * Copy the table from the buffer because the buffer could be         * modified or even deleted in the future         */        Table = ACPI_ALLOCATE (Length);        if (!Table)        {            return_ACPI_STATUS (AE_NO_MEMORY);        }        memcpy (Table, TableHeader, Length);        break;    default:        return_ACPI_STATUS (AE_AML_OPERAND_TYPE);    }    /* Install the new table into the local data structures */    ACPI_INFO (("Dynamic OEM Table Load:"));    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),        ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,        &TableIndex);    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    if (ACPI_FAILURE (Status))    {        /* Delete allocated table buffer */        ACPI_FREE (Table);        return_ACPI_STATUS (Status);    }    /*     * Note: Now table is "INSTALLED", it must be validated before     * loading.     */    Status = AcpiTbValidateTable (        &AcpiGbl_RootTableList.Tables[TableIndex]);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Add the table to the namespace.     *     * Note: Load the table objects relative to the root of the namespace.     * This appears to go against the ACPI specification, but we do it for     * compatibility with other ACPI implementations.     */    Status = AcpiExAddTable (TableIndex, AcpiGbl_RootNode, &DdbHandle);    if (ACPI_FAILURE (Status))    {        /* On error, TablePtr was deallocated above */        return_ACPI_STATUS (Status);    }    /* Store the DdbHandle into the Target operand */    Status = AcpiExStore (DdbHandle, Target, WalkState);    if (ACPI_FAILURE (Status))    {        (void) AcpiExUnloadTable (DdbHandle);        /* TablePtr was deallocated above */        AcpiUtRemoveReference (DdbHandle);        return_ACPI_STATUS (Status);    }    /* Remove the reference by added by AcpiExStore above */    AcpiUtRemoveReference (DdbHandle);    /* Invoke table handler if present */    if (AcpiGbl_TableHandler)    {        (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,            AcpiGbl_TableHandlerContext);    }    return_ACPI_STATUS (Status);}
开发者ID:BarrelfishOS,项目名称:barrelfish,代码行数:101,


示例23: AcpiUtDumpAllocations

//.........这里部分代码省略.........                        Element->Line, AcpiUtGetDescriptorName (Descriptor));                    /* Optional object hex dump */                    if (AcpiGbl_VerboseLeakDump)                    {                        AcpiOsPrintf ("/n");                        AcpiUtDumpBuffer ((UINT8 *) Descriptor, Element->Size,                            DB_BYTE_DISPLAY, 0);                    }                    /* Validate the descriptor type using Type field and length */                    DescriptorType = 0; /* Not a valid descriptor type */                    switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor))                    {                    case ACPI_DESC_TYPE_OPERAND:                        if (Element->Size == sizeof (ACPI_OPERAND_OBJECT))                        {                            DescriptorType = ACPI_DESC_TYPE_OPERAND;                        }                        break;                    case ACPI_DESC_TYPE_PARSER:                        if (Element->Size == sizeof (ACPI_PARSE_OBJECT))                        {                            DescriptorType = ACPI_DESC_TYPE_PARSER;                        }                        break;                    case ACPI_DESC_TYPE_NAMED:                        if (Element->Size == sizeof (ACPI_NAMESPACE_NODE))                        {                            DescriptorType = ACPI_DESC_TYPE_NAMED;                        }                        break;                    default:                        break;                    }                    /* Display additional info for the major descriptor types */                    switch (DescriptorType)                    {                    case ACPI_DESC_TYPE_OPERAND:                        AcpiOsPrintf ("%12.12s  RefCount 0x%04X/n",                            AcpiUtGetTypeName (Descriptor->Object.Common.Type),                            Descriptor->Object.Common.ReferenceCount);                        break;                    case ACPI_DESC_TYPE_PARSER:                        AcpiOsPrintf ("AmlOpcode 0x%04hX/n",                            Descriptor->Op.Asl.AmlOpcode);                        break;                    case ACPI_DESC_TYPE_NAMED:                        AcpiOsPrintf ("%4.4s/n",                            AcpiUtGetNodeName (&Descriptor->Node));                        break;                    default:                        AcpiOsPrintf ( "/n");                        break;                    }                }            }            NumOutstanding++;        }        Element = Element->Next;    }Exit:    (void) AcpiUtReleaseMutex (ACPI_MTX_MEMORY);    /* Print summary */    if (!NumOutstanding)    {        ACPI_INFO (("No outstanding allocations"));    }    else    {        ACPI_ERROR ((AE_INFO, "%u (0x%X) Outstanding cache allocations",            NumOutstanding, NumOutstanding));    }    return_VOID;}
开发者ID:ChaiSoft,项目名称:ChaiOS,代码行数:101,


示例24: AcpiUtTrackAllocation

static ACPI_STATUSAcpiUtTrackAllocation (    ACPI_DEBUG_MEM_BLOCK    *Allocation,    ACPI_SIZE               Size,    UINT8                   AllocType,    UINT32                  Component,    char                    *Module,    UINT32                  Line){    ACPI_MEMORY_LIST        *MemList;    ACPI_DEBUG_MEM_BLOCK    *Element;    ACPI_STATUS             Status = AE_OK;    ACPI_FUNCTION_TRACE_PTR (UtTrackAllocation, Allocation);    MemList = AcpiGbl_GlobalList;    Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /*     * Search list for this address to make sure it is not already on the list.     * This will catch several kinds of problems.     */    Element = AcpiUtFindAllocation (Allocation);    if (Element)    {        ACPI_ERROR ((AE_INFO,            "UtTrackAllocation: Allocation already present in list! (%p)",            Allocation));        ACPI_ERROR ((AE_INFO, "Element %p Address %p",            Element, Allocation));        goto UnlockAndExit;    }    /* Fill in the instance data. */    Allocation->Size      = (UINT32) Size;    Allocation->AllocType = AllocType;    Allocation->Component = Component;    Allocation->Line      = Line;    ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME);    Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0;    /* Insert at list head */    if (MemList->ListHead)    {        ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation;    }    Allocation->Next = MemList->ListHead;    Allocation->Previous = NULL;    MemList->ListHead = Allocation;UnlockAndExit:    Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY);    return_ACPI_STATUS (Status);}
开发者ID:samueldotj,项目名称:AceOS,代码行数:68,


示例25: AcpiEvUpdateGpes

voidAcpiEvUpdateGpes (    ACPI_OWNER_ID           TableOwnerId){    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo;    ACPI_GPE_BLOCK_INFO     *GpeBlock;    ACPI_GPE_WALK_INFO      WalkInfo;    ACPI_STATUS             Status = AE_OK;    /*     * Find any _Lxx/_Exx GPE methods that have just been loaded.     *     * Any GPEs that correspond to new _Lxx/_Exx methods are immediately     * enabled.     *     * Examine the namespace underneath each GpeDevice within the     * GpeBlock lists.     */    Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);    if (ACPI_FAILURE (Status))    {        return;    }    WalkInfo.Count = 0;    WalkInfo.OwnerId = TableOwnerId;    WalkInfo.ExecuteByOwnerId = TRUE;    /* Walk the interrupt level descriptor list */    GpeXruptInfo = AcpiGbl_GpeXruptListHead;    while (GpeXruptInfo)    {        /* Walk all Gpe Blocks attached to this interrupt level */        GpeBlock = GpeXruptInfo->GpeBlockListHead;        while (GpeBlock)        {            WalkInfo.GpeBlock = GpeBlock;            WalkInfo.GpeDevice = GpeBlock->Node;            Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD,                        WalkInfo.GpeDevice, ACPI_UINT32_MAX,                        ACPI_NS_WALK_NO_UNLOCK, AcpiEvMatchGpeMethod,                        NULL, &WalkInfo, NULL);            if (ACPI_FAILURE (Status))            {                ACPI_EXCEPTION ((AE_INFO, Status,                    "While decoding _Lxx/_Exx methods"));            }            GpeBlock = GpeBlock->Next;        }        GpeXruptInfo = GpeXruptInfo->Next;    }    if (WalkInfo.Count)    {        ACPI_INFO ((AE_INFO, "Enabled %u new GPEs", WalkInfo.Count));    }    (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);    return;}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:66,


示例26: AcpiTbLoadNamespace

static ACPI_STATUSAcpiTbLoadNamespace (    void){    ACPI_STATUS             Status;    UINT32                  i;    ACPI_TABLE_HEADER       *NewDsdt;    ACPI_FUNCTION_TRACE (TbLoadNamespace);    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    /*     * Load the namespace. The DSDT is required, but any SSDT and     * PSDT tables are optional. Verify the DSDT.     */    if (!AcpiGbl_RootTableList.CurrentTableCount ||        !ACPI_COMPARE_NAME (            &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature),            ACPI_SIG_DSDT) ||         ACPI_FAILURE (AcpiTbValidateTable (            &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT])))    {        Status = AE_NO_ACPI_TABLES;        goto UnlockAndExit;    }    /*     * Save the DSDT pointer for simple access. This is the mapped memory     * address. We must take care here because the address of the .Tables     * array can change dynamically as tables are loaded at run-time. Note:     * .Pointer field is not validated until after call to AcpiTbValidateTable.     */    AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer;    /*     * Optionally copy the entire DSDT to local memory (instead of simply     * mapping it.) There are some BIOSs that corrupt or replace the original     * DSDT, creating the need for this option. Default is FALSE, do not copy     * the DSDT.     */    if (AcpiGbl_CopyDsdtLocally)    {        NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT);        if (NewDsdt)        {            AcpiGbl_DSDT = NewDsdt;        }    }    /*     * Save the original DSDT header for detection of table corruption     * and/or replacement of the DSDT from outside the OS.     */    ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT,        sizeof (ACPI_TABLE_HEADER));    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    /* Load and parse tables */    Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */    (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i)    {        if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),                    ACPI_SIG_SSDT) &&             !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature),                    ACPI_SIG_PSDT)) ||             ACPI_FAILURE (AcpiTbValidateTable (                &AcpiGbl_RootTableList.Tables[i])))        {            continue;        }        /* Ignore errors while loading tables, get as many as possible */        (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);        (void) AcpiNsLoadTable (i, AcpiGbl_RootNode);        (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);    }    ACPI_INFO ((AE_INFO, "All ACPI Tables successfully acquired"));UnlockAndExit:    (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);    return_ACPI_STATUS (Status);}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:97,


示例27: AcpiEvGpeInitialize

//.........这里部分代码省略.........     *  half the GPE1_LEN. If a generic register block is not supported     *  then its respective block pointer and block length values in the     *  FADT table contain zeros. The GPE0_LEN and GPE1_LEN do not need     *  to be the same size."     */    /*     * Determine the maximum GPE number for this machine.     *     * Note: both GPE0 and GPE1 are optional, and either can exist without     * the other.     *     * If EITHER the register length OR the block address are zero, then that     * particular block is not supported.     */    if (AcpiGbl_FADT.Gpe0BlockLength &&        AcpiGbl_FADT.XGpe0Block.Address)    {        /* GPE block 0 exists (has both length and address > 0) */        RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2);        GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1;        /* Install GPE Block 0 */        Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,                    &AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,                    AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);        if (ACPI_FAILURE (Status))        {            ACPI_EXCEPTION ((AE_INFO, Status,                "Could not create GPE Block 0"));        }    }    if (AcpiGbl_FADT.Gpe1BlockLength &&        AcpiGbl_FADT.XGpe1Block.Address)    {        /* GPE block 1 exists (has both length and address > 0) */        RegisterCount1 = (UINT16) (AcpiGbl_FADT.Gpe1BlockLength / 2);        /* Check for GPE0/GPE1 overlap (if both banks exist) */        if ((RegisterCount0) &&            (GpeNumberMax >= AcpiGbl_FADT.Gpe1Base))        {            ACPI_ERROR ((AE_INFO,                "GPE0 block (GPE 0 to %u) overlaps the GPE1 block "                "(GPE %u to %u) - Ignoring GPE1",                GpeNumberMax, AcpiGbl_FADT.Gpe1Base,                AcpiGbl_FADT.Gpe1Base +                ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1)));            /* Ignore GPE1 block by setting the register count to zero */            RegisterCount1 = 0;        }        else        {            /* Install GPE Block 1 */            Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,                        &AcpiGbl_FADT.XGpe1Block, RegisterCount1,                        AcpiGbl_FADT.Gpe1Base,                        AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);            if (ACPI_FAILURE (Status))            {                ACPI_EXCEPTION ((AE_INFO, Status,                    "Could not create GPE Block 1"));            }            /*             * GPE0 and GPE1 do not have to be contiguous in the GPE number             * space. However, GPE0 always starts at GPE number zero.             */            GpeNumberMax = AcpiGbl_FADT.Gpe1Base +                            ((RegisterCount1 * ACPI_GPE_REGISTER_WIDTH) - 1);        }    }    /* Exit if there are no GPE registers */    if ((RegisterCount0 + RegisterCount1) == 0)    {        /* GPEs are not required by ACPI, this is OK */        ACPI_DEBUG_PRINT ((ACPI_DB_INIT,            "There are no GPE blocks defined in the FADT/n"));        Status = AE_OK;        goto Cleanup;    }Cleanup:    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    return_ACPI_STATUS (AE_OK);}
开发者ID:eyberg,项目名称:rumpkernel-netbsd-src,代码行数:101,


示例28: AcpiUnloadParentTable

ACPI_STATUSAcpiUnloadParentTable (    ACPI_HANDLE             Object){    ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Object);    ACPI_STATUS             Status = AE_NOT_EXIST;    ACPI_OWNER_ID           OwnerId;    UINT32                  i;    ACPI_FUNCTION_TRACE (AcpiUnloadParentTable);    /* Parameter validation */    if (!Object)    {        return_ACPI_STATUS (AE_BAD_PARAMETER);    }    /*     * The node OwnerId is currently the same as the parent table ID.     * However, this could change in the future.     */    OwnerId = Node->OwnerId;    if (!OwnerId)    {        /* OwnerId==0 means DSDT is the owner. DSDT cannot be unloaded */        return_ACPI_STATUS (AE_TYPE);    }    /* Must acquire the interpreter lock during this operation */    Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER);    if (ACPI_FAILURE (Status))    {        return_ACPI_STATUS (Status);    }    /* Find the table in the global table list */    for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++)    {        if (OwnerId != AcpiGbl_RootTableList.Tables[i].OwnerId)        {            continue;        }        /*         * Allow unload of SSDT and OEMx tables only. Do not allow unload         * of the DSDT. No other types of tables should get here, since         * only these types can contain AML and thus are the only types         * that can create namespace objects.         */        if (ACPI_COMPARE_NAME (            AcpiGbl_RootTableList.Tables[i].Signature.Ascii,            ACPI_SIG_DSDT))        {            Status = AE_TYPE;            break;        }        /* Ensure the table is actually loaded */        if (!AcpiTbIsTableLoaded (i))        {            Status = AE_NOT_EXIST;            break;        }        /* Invoke table handler if present */        if (AcpiGbl_TableHandler)        {            (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD,                        AcpiGbl_RootTableList.Tables[i].Pointer,                        AcpiGbl_TableHandlerContext);        }        /*         * Delete all namespace objects owned by this table. Note that         * these objects can appear anywhere in the namespace by virtue         * of the AML "Scope" operator. Thus, we need to track ownership         * by an ID, not simply a position within the hierarchy.         */        Status = AcpiTbDeleteNamespaceByOwner (i);        if (ACPI_FAILURE (Status))        {            break;        }        Status = AcpiTbReleaseOwnerId (i);        AcpiTbSetTableLoadedFlag (i, FALSE);        break;    }    (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER);    return_ACPI_STATUS (Status);}
开发者ID:Lxg1582,项目名称:freebsd,代码行数:100,


示例29: AcpiExStopTraceMethod

voidAcpiExStopTraceMethod (    ACPI_NAMESPACE_NODE     *MethodNode,    ACPI_OPERAND_OBJECT     *ObjDesc,    ACPI_WALK_STATE         *WalkState){    ACPI_STATUS             Status;    char                    *Pathname = NULL;    BOOLEAN                 Enabled;    ACPI_FUNCTION_NAME (ExStopTraceMethod);    if (MethodNode)    {        Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        goto ExitPath;    }    Enabled = AcpiExInterpreterTraceEnabled (NULL);    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);    if (Enabled)    {        ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,            ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);    }    Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);    if (ACPI_FAILURE (Status))    {        goto ExitPath;    }    /* Check whether the tracer should be stopped */    if (AcpiGbl_TraceMethodObject == ObjDesc)    {        /* Disable further tracing if type is one-shot */        if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)        {            AcpiGbl_TraceMethodName = NULL;        }        AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;        AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;        AcpiGbl_TraceMethodObject = NULL;    }    (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);ExitPath:    if (Pathname)    {        ACPI_FREE (Pathname);    }}
开发者ID:ModeenF,项目名称:haiku,代码行数:65,



注:本文中的AcpiUtReleaseMutex函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AcpiUtStrupr函数代码示例
C++ AcpiUtInitializeBuffer函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。