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

📄 dmresrcl.c

📁 acpi tools for linux include acpiexec and acpixtract
💻 C
📖 第 1 页 / 共 3 页
字号:
    /* Prefix is either Word, DWord, QWord, or Extended */    AcpiDmAddressPrefix (Type);    /* Resource Types above 0xC0 are vendor-defined */    if (ResourceType > 2)    {        AcpiOsPrintf ("Space (0x%2.2X, ", ResourceType);        AcpiDmSpaceFlags (Flags);        AcpiOsPrintf (" 0x%2.2X,", SpecificFlags);        return;    }    /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */    AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ResourceType & 0x3]);    /* Decode the general and type-specific flags */    if (ResourceType == ACPI_MEMORY_RANGE)    {        AcpiDmMemoryFlags (Flags, SpecificFlags);    }    else /* IO range or BusNumberRange */    {        AcpiDmIoFlags (Flags);        if (ResourceType == ACPI_IO_RANGE)        {            AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [SpecificFlags & 0x3]);        }    }}/******************************************************************************* * * FUNCTION:    AcpiDmAddressFlags * * PARAMETERS:  Resource        - Raw AML descriptor * * RETURN:      None * * DESCRIPTION: Emit flags common to address descriptors * ******************************************************************************/static voidAcpiDmAddressFlags (    AML_RESOURCE            *Resource){    if (Resource->Address.ResourceType == ACPI_IO_RANGE)    {        AcpiDmIoFlags2 (Resource->Address.SpecificFlags);    }    else if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)    {        AcpiDmMemoryFlags2 (Resource->Address.SpecificFlags);    }}/******************************************************************************* * * FUNCTION:    AcpiDmSpaceFlags * * PARAMETERS:  Flags               - Flag byte to be decoded * * RETURN:      None * * DESCRIPTION: Decode the flags specific to Space Address space descriptors * ******************************************************************************/static voidAcpiDmSpaceFlags (    UINT8                   Flags){    AcpiOsPrintf ("%s, %s, %s, %s,",        AcpiGbl_ConsumeDecode [(Flags & 1)],        AcpiGbl_DecDecode [(Flags & 0x2) >> 1],        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);}/******************************************************************************* * * FUNCTION:    AcpiDmIoFlags * * PARAMETERS:  Flags               - Flag byte to be decoded * * RETURN:      None * * DESCRIPTION: Decode the flags specific to IO Address space descriptors * ******************************************************************************/static voidAcpiDmIoFlags (        UINT8               Flags){    AcpiOsPrintf ("%s, %s, %s, %s,",        AcpiGbl_ConsumeDecode [(Flags & 1)],        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],        AcpiGbl_DecDecode [(Flags & 0x2) >> 1]);}/******************************************************************************* * * FUNCTION:    AcpiDmIoFlags2 * * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded * * RETURN:      None * * DESCRIPTION: Decode the flags specific to IO Address space descriptors * ******************************************************************************/static voidAcpiDmIoFlags2 (        UINT8               SpecificFlags){    AcpiOsPrintf (", %s",        AcpiGbl_TtpDecode [(SpecificFlags & 0x10) >> 4]);    /* TRS is only used if TTP is TypeTranslation */    if (SpecificFlags & 0x10)    {        AcpiOsPrintf (", %s",            AcpiGbl_TrsDecode [(SpecificFlags & 0x20) >> 5]);    }}/******************************************************************************* * * FUNCTION:    AcpiDmMemoryFlags * * PARAMETERS:  Flags               - Flag byte to be decoded *              SpecificFlags       - "Specific" flag byte to be decoded * * RETURN:      None * * DESCRIPTION: Decode flags specific to Memory Address Space descriptors * ******************************************************************************/static voidAcpiDmMemoryFlags (    UINT8                   Flags,    UINT8                   SpecificFlags){    AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",        AcpiGbl_ConsumeDecode [(Flags & 1)],        AcpiGbl_DecDecode [(Flags & 0x2) >> 1],        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],        AcpiGbl_MemDecode [(SpecificFlags & 0x6) >> 1],        AcpiGbl_RwDecode [(SpecificFlags & 0x1)]);}/******************************************************************************* * * FUNCTION:    AcpiDmMemoryFlags2 * * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded * * RETURN:      None * * DESCRIPTION: Decode flags specific to Memory Address Space descriptors * ******************************************************************************/static voidAcpiDmMemoryFlags2 (    UINT8                   SpecificFlags){    AcpiOsPrintf (", %s, %s",        AcpiGbl_MtpDecode [(SpecificFlags & 0x18) >> 3],        AcpiGbl_TtpDecode [(SpecificFlags & 0x20) >> 5]);}/******************************************************************************* * * FUNCTION:    AcpiDmResourceSource * * PARAMETERS:  Resource        - Raw AML descriptor *              MinimumLength   - descriptor length without optional fields *              ResourceLength * * RETURN:      None * * DESCRIPTION: Dump optional ResourceSource fields of an address descriptor * ******************************************************************************/static voidAcpiDmResourceSource (    AML_RESOURCE            *Resource,    ACPI_SIZE               MinimumTotalLength,    UINT32                  ResourceLength){    UINT8                   *AmlResourceSource;    UINT32                  TotalLength;    TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);    /* Check if the optional ResourceSource fields are present */    if (TotalLength <= MinimumTotalLength)    {        /* The two optional fields are not used */        AcpiOsPrintf (",, ");        return;    }    /* Get a pointer to the ResourceSource */    AmlResourceSource = ACPI_ADD_PTR (UINT8, Resource, MinimumTotalLength);    /*     * Always emit the ResourceSourceIndex (Byte)     *     * NOTE: Some ASL compilers always create a 0 byte (in the AML) for the     * Index even if the String does not exist. Although this is in violation     * of the ACPI specification, it is very important to emit ASL code that     * can be compiled back to the identical AML. There may be fields and/or     * indexes into the resource template buffer that are compiled to absolute     * offsets, and these will be broken if the AML length is changed.     */    AcpiOsPrintf ("0x%2.2X,", (UINT32) AmlResourceSource[0]);    /* Make sure that the ResourceSource string exists before dumping it */    if (TotalLength > (MinimumTotalLength + 1))    {        AcpiOsPrintf (" ");        AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT8_MAX);    }    AcpiOsPrintf (", ");}/******************************************************************************* * * FUNCTION:    AcpiDmWordDescriptor * * PARAMETERS:  Resource            - Pointer to the resource descriptor *              Length              - Length of the descriptor in bytes *              Level               - Current source code indentation level * * RETURN:      None * * DESCRIPTION: Decode a Word Address Space descriptor * ******************************************************************************/voidAcpiDmWordDescriptor (    AML_RESOURCE            *Resource,    UINT32                  Length,    UINT32                  Level){    /* Dump resource name and flags */    AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS16, Level);    /* Dump the 5 contiguous WORD values */    AcpiDmAddressFields (&Resource->Address16.Granularity, 16, Level);    /* The ResourceSource fields are optional */    AcpiDmIndent (Level + 1);    AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS16), Length);    /* Insert a descriptor name */    AcpiDmDescriptorName ();    /* Type-specific flags */    AcpiDmAddressFlags (Resource);    AcpiOsPrintf (")\n");}/******************************************************************************* * * FUNCTION:    AcpiDmDwordDescriptor * * PARAMETERS:  Resource            - Pointer to the resource descriptor *              Length              - Length of the descriptor in bytes *              Level               - Current source code indentation level * * RETURN:      None * * DESCRIPTION: Decode a DWord Address Space descriptor * ******************************************************************************/voidAcpiDmDwordDescriptor (    AML_RESOURCE            *Resource,    UINT32                  Length,    UINT32                  Level){    /* Dump resource name and flags */    AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS32, Level);    /* Dump the 5 contiguous DWORD values */    AcpiDmAddressFields (&Resource->Address32.Granularity, 32, Level);    /* The ResourceSource fields are optional */    AcpiDmIndent (Level + 1);    AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS32), Length);    /* Insert a descriptor name */    AcpiDmDescriptorName ();    /* Type-specific flags */    AcpiDmAddressFlags (Resource);    AcpiOsPrintf (")\n");}/******************************************************************************* * * FUNCTION:    AcpiDmQwordDescriptor * * PARAMETERS:  Resource            - Pointer to the resource descriptor *              Length              - Length of the descriptor in bytes *              Level               - Current source code indentation level * * RETURN:      None * * DESCRIPTION: Decode a QWord Address Space descriptor * ******************************************************************************/voidAcpiDmQwordDescriptor (    AML_RESOURCE            *Resource,    UINT32                  Length,    UINT32                  Level){    /* Dump resource name and flags */    AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS64, Level);    /* Dump the 5 contiguous QWORD values */    AcpiDmAddressFields (&Resource->Address64.Granularity, 64, Level);

⌨️ 快捷键说明

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