当前位置: 首页>>代码示例>>C++>>正文


C++ AcpiNsHandleToPathname函数代码示例

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


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

示例1: ns_handle_to_pathname

status_t
ns_handle_to_pathname(acpi_handle targetHandle, acpi_data *buffer)
{
    status_t status = AcpiNsHandleToPathname(targetHandle,
                      (ACPI_BUFFER*)buffer, false);
    return status == AE_OK ? B_OK : B_ERROR;
}
开发者ID:simonsouth,项目名称:haiku,代码行数:7,代码来源:BusManager.cpp

示例2: AcpiNsDumpPathname

ACPI_STATUS
AcpiNsDumpPathname (
    ACPI_HANDLE             Handle,
    NATIVE_CHAR             *Msg,
    UINT32                  Level,
    UINT32                  Component)
{
    ACPI_BUFFER             Buffer;
    ACPI_STATUS             Status;


    ACPI_FUNCTION_TRACE ("NsDumpPathname");


    /* Do this only if the requested debug level and component are enabled */

    if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
    {
        return_ACPI_STATUS (AE_OK);
    }

    /* Convert handle to a full pathname and print it (with supplied message) */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;

    Status = AcpiNsHandleToPathname (Handle, &Buffer);
    if (ACPI_SUCCESS (Status))
    {
        AcpiOsPrintf ("%s %s (Node %p)\n", Msg, (char *) Buffer.Pointer, Handle);
        ACPI_MEM_FREE (Buffer.Pointer);
    }

    return_ACPI_STATUS (Status);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:34,代码来源:nsdump.c

示例3: AcpiNsPrintNodePathname

void
AcpiNsPrintNodePathname (
    ACPI_NAMESPACE_NODE     *Node,
    const char              *Message)
{
    ACPI_BUFFER             Buffer;
    ACPI_STATUS             Status;


    if (!Node)
    {
        AcpiOsPrintf ("[NULL NAME]");
        return;
    }

    /* Convert handle to full pathname and print it (with supplied message) */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;

    Status = AcpiNsHandleToPathname (Node, &Buffer, TRUE);
    if (ACPI_SUCCESS (Status))
    {
        if (Message)
        {
            AcpiOsPrintf ("%s ", Message);
        }

        AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
        ACPI_FREE (Buffer.Pointer);
    }
}
开发者ID:ariscop,项目名称:reactos,代码行数:31,代码来源:nsutils.c

示例4: AcpiDbWalkForSpecificObjects

static ACPI_STATUS
AcpiDbWalkForSpecificObjects (
    ACPI_HANDLE             ObjHandle,
    UINT32                  NestingLevel,
    void                    *Context,
    void                    **ReturnValue)
{
    ACPI_WALK_INFO          *Info = (ACPI_WALK_INFO *) Context;
    ACPI_BUFFER             Buffer;
    ACPI_STATUS             Status;


    Info->Count++;

    /* Get and display the full pathname to this object */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
        return (AE_OK);
    }

    AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
    ACPI_FREE (Buffer.Pointer);

    /* Dump short info about the object */

    (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, Info, NULL);
    return (AE_OK);
}
开发者ID:fsheikh,项目名称:acpica,代码行数:32,代码来源:dbnames.c

示例5: AcpiUtDisplayInitPathname

void
AcpiUtDisplayInitPathname (
    ACPI_HANDLE             ObjHandle,
    char                    *Path)
{
    ACPI_STATUS             Status;
    UINT32                  Length = 128;
    char                    Buffer[128];


    PROC_NAME ("UtDisplayInitPathname");


    Status = AcpiNsHandleToPathname (ObjHandle, &Length, Buffer);
    if (ACPI_SUCCESS (Status))
    {
        if (Path)
        {
            ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s.%s\n", Buffer, Path));
        }
        else
        {
            ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "%s\n", Buffer));
        }
    }
}
开发者ID:MarginC,项目名称:kame,代码行数:26,代码来源:utmisc.c

示例6: AcpiUtDisplayInitPathname

void
AcpiUtDisplayInitPathname (
    UINT8                   Type,
    ACPI_NAMESPACE_NODE     *ObjHandle,
    char                    *Path)
{
    ACPI_STATUS             Status;
    ACPI_BUFFER             Buffer;


    ACPI_FUNCTION_ENTRY ();


    /* Only print the path if the appropriate debug level is enabled */

    if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
    {
        return;
    }

    /* Get the full pathname to the node */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer);
    if (ACPI_FAILURE (Status))
    {
        return;
    }

    /* Print what we're doing */

    switch (Type)
    {
    case ACPI_TYPE_METHOD:

        AcpiOsPrintf ("Executing    ");
        break;

    default:

        AcpiOsPrintf ("Initializing ");
        break;
    }

    /* Print the object type and pathname */

    AcpiOsPrintf ("%-12s  %s",
        AcpiUtGetTypeName (Type), (char *) Buffer.Pointer);

    /* Extra path is used to append names like _STA, _INI, etc. */

    if (Path)
    {
        AcpiOsPrintf (".%s", Path);
    }
    AcpiOsPrintf ("\n");

    ACPI_FREE (Buffer.Pointer);
}
开发者ID:zenny,项目名称:DragonFlyBSD,代码行数:59,代码来源:utmisc.c

示例7: globalGPEHandler

static void
globalGPEHandler(UINT32 eventType, ACPI_HANDLE device, UINT32 eventNumber,
                 void* context)
{
    ACPI_BUFFER path;
    char deviceName[256];
    path.Length = sizeof(deviceName);
    path.Pointer = deviceName;

    ACPI_STATUS status = AcpiNsHandleToPathname(device, &path);
    if (ACPI_FAILURE(status))
        strcpy(deviceName, "(missing)");

    switch (eventType) {
    case ACPI_EVENT_TYPE_GPE:
        dprintf("acpi: GPE Event %d for %s\n", eventNumber, deviceName);
        break;

    case ACPI_EVENT_TYPE_FIXED:
    {
        switch (eventNumber) {
        case ACPI_EVENT_PMTIMER:
            dprintf("acpi: PMTIMER(%d) event for %s\n", eventNumber,
                    deviceName);
            break;

        case ACPI_EVENT_GLOBAL:
            dprintf("acpi: Global(%d) event for %s\n", eventNumber,
                    deviceName);
            break;

        case ACPI_EVENT_POWER_BUTTON:
            dprintf("acpi: Powerbutton(%d) event for %s\n", eventNumber,
                    deviceName);
            break;

        case ACPI_EVENT_SLEEP_BUTTON:
            dprintf("acpi: sleepbutton(%d) event for %s\n", eventNumber,
                    deviceName);
            break;

        case ACPI_EVENT_RTC:
            dprintf("acpi: RTC(%d) event for %s\n", eventNumber,
                    deviceName);
            break;

        default:
            dprintf("acpi: unknown fixed(%d) event for %s\n",
                    eventNumber, deviceName);
        }
        break;
    }

    default:
        dprintf("acpi: unknown event type (%d:%d)  event for %s\n",
                eventType, eventNumber, deviceName);
    }
}
开发者ID:simonsouth,项目名称:haiku,代码行数:58,代码来源:BusManager.cpp

示例8: AcpiDbWalkAndMatchName

static ACPI_STATUS
AcpiDbWalkAndMatchName (
    ACPI_HANDLE             ObjHandle,
    UINT32                  NestingLevel,
    void                    *Context,
    void                    **ReturnValue)
{
    ACPI_STATUS             Status;
    char                    *RequestedName = (char *) Context;
    UINT32                  i;
    ACPI_BUFFER             Buffer;
    ACPI_WALK_INFO          Info;


    /* Check for a name match */

    for (i = 0; i < 4; i++)
    {
        /* Wildcard support */

        if ((RequestedName[i] != '?') &&
            (RequestedName[i] != ((ACPI_NAMESPACE_NODE *)
                ObjHandle)->Name.Ascii[i]))
        {
            /* No match, just exit */

            return (AE_OK);
        }
    }

    /* Get the full pathname to this object */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, TRUE);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could Not get pathname for object %p\n",
            ObjHandle);
    }
    else
    {
        Info.Count = 0;
        Info.OwnerId = ACPI_OWNER_ID_MAX;
        Info.DebugLevel = ACPI_UINT32_MAX;
        Info.DisplayType = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;

        AcpiOsPrintf ("%32s", (char *) Buffer.Pointer);
        (void) AcpiNsDumpOneObject (ObjHandle, NestingLevel, &Info, NULL);
        ACPI_FREE (Buffer.Pointer);
    }

    return (AE_OK);
}
开发者ID:kusumi,项目名称:DragonFlyBSD,代码行数:53,代码来源:dbnames.c

示例9: globalNotifyHandler

static void globalNotifyHandler(ACPI_HANDLE device, UINT32 value, void* context)
{
    ACPI_BUFFER path;
    char deviceName[256];
    path.Length = sizeof(deviceName);
    path.Pointer = deviceName;

    ACPI_STATUS status = AcpiNsHandleToPathname(device, &path);
    if (ACPI_FAILURE(status))
        strcpy(deviceName, "(missing)");

    dprintf("acpi: Notify event %d for %s\n", value, deviceName);
}
开发者ID:simonsouth,项目名称:haiku,代码行数:13,代码来源:BusManager.cpp

示例10: LsEmitOffsetTableEntry

static void
LsEmitOffsetTableEntry (
    UINT32                  FileId,
    ACPI_NAMESPACE_NODE     *Node,
    UINT32                  NamepathOffset,
    UINT32                  Offset,
    char                    *OpName,
    UINT64                  Value,
    UINT8                   AmlOpcode,
    UINT16                  ParentOpcode)
{
    ACPI_BUFFER             TargetPath;
    ACPI_STATUS             Status;


    /* Get the full pathname to the namespace node */

    TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
    if (ACPI_FAILURE (Status))
    {
        return;
    }

    /* [1] - Skip the opening backslash for the path */

    strcpy (MsgBuffer, "\"");
    strcat (MsgBuffer, &((char *) TargetPath.Pointer)[1]);
    strcat (MsgBuffer, "\",");
    ACPI_FREE (TargetPath.Pointer);

    /*
     * Max offset is 4G, constrained by 32-bit ACPI table length.
     * Max Length for Integers is 8 bytes.
     */
    FlPrintFile (FileId,
        "    {%-29s 0x%4.4X, 0x%8.8X, 0x%2.2X, 0x%8.8X, 0x%8.8X%8.8X}, /* %s */\n",
        MsgBuffer, ParentOpcode, NamepathOffset, AmlOpcode,
        Offset, ACPI_FORMAT_UINT64 (Value), OpName);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:40,代码来源:asloffset.c

示例11: AcpiNsDumpPathname

ACPI_STATUS
AcpiNsDumpPathname (
    ACPI_HANDLE             Handle,
    NATIVE_CHAR             *Msg,
    UINT32                  Level,
    UINT32                  Component)
{
    NATIVE_CHAR             *Buffer;
    UINT32                  Length;


    FUNCTION_TRACE ("NsDumpPathname");


    /* Do this only if the requested debug level and component are enabled */

    if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component))
    {
        return_ACPI_STATUS (AE_OK);
    }

    Buffer = ACPI_MEM_ALLOCATE (PATHNAME_MAX);
    if (!Buffer)
    {
        return_ACPI_STATUS (AE_NO_MEMORY);
    }

    /* Convert handle to a full pathname and print it (with supplied message) */

    Length = PATHNAME_MAX;
    if (ACPI_SUCCESS (AcpiNsHandleToPathname (Handle, &Length, Buffer)))
    {
        AcpiOsPrintf ("%s %s (%p)\n", Msg, Buffer, Handle);
    }

    ACPI_MEM_FREE (Buffer);

    return_ACPI_STATUS (AE_OK);
}
开发者ID:MarginC,项目名称:kame,代码行数:39,代码来源:nsdump.c

示例12: NsDoOnePathname

static ACPI_STATUS
NsDoOnePathname (
    ACPI_HANDLE             ObjHandle,
    UINT32                  Level,
    void                    *Context,
    void                    **ReturnValue)
{
    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
    ACPI_STATUS             Status;
    ACPI_BUFFER             TargetPath;


    TargetPath.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (Node, &TargetPath, FALSE);
    if (ACPI_FAILURE (Status))
    {
        return (Status);
    }

    FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT, "%s\n", TargetPath.Pointer);
    ACPI_FREE (TargetPath.Pointer);
    return (AE_OK);
}
开发者ID:ColinIanKing,项目名称:fwts,代码行数:23,代码来源:aslnamesp.c

示例13: AcpiDbBusWalk

static ACPI_STATUS
AcpiDbBusWalk (
    ACPI_HANDLE             ObjHandle,
    UINT32                  NestingLevel,
    void                    *Context,
    void                    **ReturnValue)
{
    ACPI_NAMESPACE_NODE     *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
    ACPI_STATUS             Status;
    ACPI_BUFFER             Buffer;
    ACPI_NAMESPACE_NODE     *TempNode;
    ACPI_DEVICE_INFO        *Info;
    UINT32                  i;


    if ((Node->Type != ACPI_TYPE_DEVICE) &&
        (Node->Type != ACPI_TYPE_PROCESSOR))
    {
        return (AE_OK);
    }

    /* Exit if there is no _PRT under this device */

    Status = AcpiGetHandle (Node, METHOD_NAME__PRT,
                ACPI_CAST_PTR (ACPI_HANDLE, &TempNode));
    if (ACPI_FAILURE (Status))
    {
        return (AE_OK);
    }

    /* Get the full path to this device object */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (ObjHandle, &Buffer, FALSE);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("Could Not get pathname for object %p\n", ObjHandle);
        return (AE_OK);
    }

    Status = AcpiGetObjectInfo (ObjHandle, &Info);
    if (ACPI_FAILURE (Status))
    {
        return (AE_OK);
    }

    /* Display the full path */

    AcpiOsPrintf ("%-32s Type %X", (char *) Buffer.Pointer, Node->Type);
    ACPI_FREE (Buffer.Pointer);

    if (Info->Flags & ACPI_PCI_ROOT_BRIDGE)
    {
        AcpiOsPrintf ("  - Is PCI Root Bridge");
    }
    AcpiOsPrintf ("\n");

    /* _PRT info */

    AcpiOsPrintf ("_PRT: %p\n", TempNode);

    /* Dump _ADR, _HID, _UID, _CID */

    if (Info->Valid & ACPI_VALID_ADR)
    {
        AcpiOsPrintf ("_ADR: %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Info->Address));
    }
    else
    {
        AcpiOsPrintf ("_ADR: <Not Present>\n");
    }

    if (Info->Valid & ACPI_VALID_HID)
    {
        AcpiOsPrintf ("_HID: %s\n", Info->HardwareId.String);
    }
    else
    {
        AcpiOsPrintf ("_HID: <Not Present>\n");
    }

    if (Info->Valid & ACPI_VALID_UID)
    {
        AcpiOsPrintf ("_UID: %s\n", Info->UniqueId.String);
    }
    else
    {
        AcpiOsPrintf ("_UID: <Not Present>\n");
    }

    if (Info->Valid & ACPI_VALID_CID)
    {
        for (i = 0; i < Info->CompatibleIdList.Count; i++)
        {
            AcpiOsPrintf ("_CID: %s\n",
                Info->CompatibleIdList.Ids[i].String);
        }
    }
    else
    {
//.........这里部分代码省略.........
开发者ID:fsheikh,项目名称:acpica,代码行数:101,代码来源:dbnames.c

示例14: AcpiGetName

ACPI_STATUS
AcpiGetName (
    ACPI_HANDLE             Handle,
    UINT32                  NameType,
    ACPI_BUFFER             *RetPathPtr)
{
    ACPI_STATUS             Status;
    ACPI_NAMESPACE_NODE     *Node;


    /* Ensure that ACPI has been initialized */

    ACPI_IS_INITIALIZATION_COMPLETE (Status);
    if (ACPI_FAILURE (Status))
    {
        return (Status);
    }

    /* Buffer pointer must be valid always */

    if (!RetPathPtr || (NameType > ACPI_NAME_TYPE_MAX))
    {
        return (AE_BAD_PARAMETER);
    }

    /* Allow length to be zero and ignore the pointer */

    if ((RetPathPtr->Length) &&
       (!RetPathPtr->Pointer))
    {
        return (AE_BAD_PARAMETER);
    }

    if (NameType == ACPI_FULL_PATHNAME)
    {
        /* Get the full pathname (From the namespace root) */

        Status = AcpiNsHandleToPathname (Handle, &RetPathPtr->Length,
                                        RetPathPtr->Pointer);
        return (Status);
    }

    /*
     * Wants the single segment ACPI name.
     * Validate handle and convert to an Node
     */
    AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
    Node = AcpiNsConvertHandleToEntry (Handle);
    if (!Node)
    {
        Status = AE_BAD_PARAMETER;
        goto UnlockAndExit;
    }

    /* Check if name will fit in buffer */

    if (RetPathPtr->Length < PATH_SEGMENT_LENGTH)
    {
        RetPathPtr->Length = PATH_SEGMENT_LENGTH;
        Status = AE_BUFFER_OVERFLOW;
        goto UnlockAndExit;
    }

    /* Just copy the ACPI name from the Node and zero terminate it */

    STRNCPY (RetPathPtr->Pointer, (NATIVE_CHAR *) &Node->Name,
                ACPI_NAME_SIZE);
    ((NATIVE_CHAR *) RetPathPtr->Pointer) [ACPI_NAME_SIZE] = 0;
    Status = AE_OK;


UnlockAndExit:

    AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
    return (Status);
}
开发者ID:MarginC,项目名称:kame,代码行数:76,代码来源:nsxfname.c

示例15: AcpiPsDisplayObjectPathname

ACPI_STATUS
AcpiPsDisplayObjectPathname (
    ACPI_WALK_STATE         *WalkState,
    ACPI_PARSE_OBJECT       *Op)
{
    ACPI_STATUS             Status;
    ACPI_NAMESPACE_NODE     *Node;
    ACPI_BUFFER             Buffer;
    UINT32                  DebugLevel;


    /* Save current debug level so we don't get extraneous debug output */

    DebugLevel = AcpiDbgLevel;
    AcpiDbgLevel = 0;

    /* Just get the Node out of the Op object */

    Node = Op->Common.Node;
    if (!Node)
    {
        /* Node not defined in this scope, look it up */

        Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Common.Value.String,
                    ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
                    WalkState, &(Node));

        if (ACPI_FAILURE (Status))
        {
            /*
             * We can't get the pathname since the object
             * is not in the namespace. This can happen during single
             * stepping where a dynamic named object is *about* to be created.
             */
            AcpiOsPrintf ("  [Path not found]");
            goto Exit;
        }

        /* Save it for next time. */

        Op->Common.Node = Node;
    }

    /* Convert NamedDesc/handle to a full pathname */

    Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
    Status = AcpiNsHandleToPathname (Node, &Buffer);
    if (ACPI_FAILURE (Status))
    {
        AcpiOsPrintf ("****Could not get pathname****)");
        goto Exit;
    }

    AcpiOsPrintf ("  (Path %s)", (char *) Buffer.Pointer);
    ACPI_FREE (Buffer.Pointer);


Exit:
    /* Restore the debug level */

    AcpiDbgLevel = DebugLevel;
    return (Status);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:63,代码来源:dmnames.c


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