⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dmnames.c

📁 acpi tools for linux include acpiexec and acpixtract
💻 C
📖 第 1 页 / 共 2 页
字号:
Exit:    /* Restore the debug level */    AcpiDbgLevel = DebugLevel;    return (Status);}/******************************************************************************* * * FUNCTION:    AcpiDmNamestring * * PARAMETERS:  Name                - ACPI Name string to store * * RETURN:      None * * DESCRIPTION: Decode and dump an ACPI namestring. Handles prefix characters * ******************************************************************************/voidAcpiDmNamestring (    char                    *Name){    UINT32                  SegCount;    if (!Name)    {        return;    }    /* Handle all Scope Prefix operators */    while (AcpiPsIsPrefixChar (ACPI_GET8 (Name)))    {        /* Append prefix character */        AcpiOsPrintf ("%1c", ACPI_GET8 (Name));        Name++;    }    switch (ACPI_GET8 (Name))    {    case 0:        SegCount = 0;        break;    case AML_DUAL_NAME_PREFIX:        SegCount = 2;        Name++;        break;    case AML_MULTI_NAME_PREFIX_OP:        SegCount = (UINT32) ACPI_GET8 (Name + 1);        Name += 2;        break;    default:        SegCount = 1;        break;    }    while (SegCount)    {        /* Append Name segment */        AcpiDmDumpName ((char *) Name);        SegCount--;        if (SegCount)        {            /* Not last name, append dot separator */            AcpiOsPrintf (".");        }        Name += ACPI_NAME_SIZE;    }}#ifdef ACPI_OBSOLETE_FUNCTIONS/******************************************************************************* * * FUNCTION:    AcpiDmDisplayPath * * PARAMETERS:  Op                  - Named Op whose path is to be constructed * * RETURN:      None * * DESCRIPTION: Walk backwards from current scope and display the name *              of each previous level of scope up to the root scope *              (like "pwd" does with file systems) * ******************************************************************************/voidAcpiDmDisplayPath (    ACPI_PARSE_OBJECT       *Op){    ACPI_PARSE_OBJECT       *Prev;    ACPI_PARSE_OBJECT       *Search;    UINT32                  Name;    BOOLEAN                 DoDot = FALSE;    ACPI_PARSE_OBJECT       *NamePath;    const ACPI_OPCODE_INFO  *OpInfo;    /* We are only interested in named objects */    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);    if (!(OpInfo->Flags & AML_NSNODE))    {        return;    }    if (OpInfo->Flags & AML_CREATE)    {        /* Field creation - check for a fully qualified namepath */        if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)        {            NamePath = AcpiPsGetArg (Op, 3);        }        else        {            NamePath = AcpiPsGetArg (Op, 2);        }        if ((NamePath) &&            (NamePath->Common.Value.String) &&            (NamePath->Common.Value.String[0] == '\\'))        {            AcpiDmNamestring (NamePath->Common.Value.String);            return;        }    }    Prev = NULL;            /* Start with Root Node */    while (Prev != Op)    {        /* Search upwards in the tree to find scope with "prev" as its parent */        Search = Op;        for (; ;)        {            if (Search->Common.Parent == Prev)            {                break;            }            /* Go up one level */            Search = Search->Common.Parent;        }        if (Prev)        {            OpInfo = AcpiPsGetOpcodeInfo (Search->Common.AmlOpcode);            if (!(OpInfo->Flags & AML_FIELD))            {                /* Below root scope, append scope name */                if (DoDot)                {                    /* Append dot */                    AcpiOsPrintf (".");                }                if (OpInfo->Flags & AML_CREATE)                {                    if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)                    {                        NamePath = AcpiPsGetArg (Op, 3);                    }                    else                    {                        NamePath = AcpiPsGetArg (Op, 2);                    }                    if ((NamePath) &&                        (NamePath->Common.Value.String))                    {                        AcpiDmDumpName (NamePath->Common.Value.String);                    }                }                else                {                    Name = AcpiPsGetName (Search);                    AcpiDmDumpName ((char *) &Name);                }                DoDot = TRUE;            }        }        Prev = Search;    }}/******************************************************************************* * * FUNCTION:    AcpiDmValidateName * * PARAMETERS:  Name            - 4 character ACPI name * * RETURN:      None * * DESCRIPTION: Lookup the name * ******************************************************************************/voidAcpiDmValidateName (    char                    *Name,    ACPI_PARSE_OBJECT       *Op){    if ((!Name) ||        (!Op->Common.Parent))    {        return;    }    if (!Op->Common.Node)    {        AcpiOsPrintf (            " /**** Name not found or not accessible from this scope ****/ ");    }    ACPI_PARSE_OBJECT       *TargetOp;    if ((!Name) ||        (!Op->Common.Parent))    {        return;    }    TargetOp = AcpiPsFind (Op, Name, 0, 0);    if (!TargetOp)    {        /*         * Didn't find the name in the parse tree.  This may be         * a problem, or it may simply be one of the predefined names         * (such as _OS_).  Rather than worry about looking up all         * the predefined names, just display the name as given         */        AcpiOsPrintf (            " /**** Name not found or not accessible from this scope ****/ ");    }}#endif#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -