FreeBSD/sys/contrib/dev/acpica/common/dmrestag.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmGetResourceNode
 *
 * PARAMETERS:  BufferNode          - Node for the parent buffer
 *              BitIndex            - Index into the resource descriptor
 *
 * RETURN:      Namespace node for the resource descriptor. NULL if not found
 *
 * DESCRIPTION: Find a resource descriptor that corresponds to the bit index
 *
 ******************************************************************************/
AcpiDmGetResourceNode
PARAMETERS:  BufferNode          - Node for the parent buffer
BitIndex            - Index into the resource descriptor

Namespace node for the resource descriptor. NULL if not found

Find a resource descriptor that corresponds to the bit index
AcpiDmGetResourceNode PARAMETERS : BufferNode - Node for the parent buffer BitIndex - Index into the resource descriptor Namespace node for the resource descriptor . NULL if not found Find a resource descriptor that corresponds to the bit index
static ACPI_NAMESPACE_NODE *
AcpiDmGetResourceNode (
    ACPI_NAMESPACE_NODE     *BufferNode,
    UINT32                  BitIndex)
{
    ACPI_NAMESPACE_NODE     *Node;
    UINT32                  ByteIndex = ACPI_DIV_8 (BitIndex);
    Node = BufferNode->Child;
    while (Node)
    {
        if ((ByteIndex >= Node->Value) &&
            (ByteIndex < (Node->Value + Node->Length)))
        {
            return (Node);
        }
        Node = Node->Peer;
    }
    return (NULL);
}
static ACPI_NAMESPACE_NODE * AcpiDmGetResourceNode ( ACPI_NAMESPACE_NODE * BufferNode , UINT32 BitIndex ) { ACPI_NAMESPACE_NODE * Node ; UINT32 ByteIndex = ACPI_DIV_8 ( BitIndex ) ; Node = BufferNode -> Child ; while ( Node ) { if ( ( ByteIndex >= Node -> Value ) && ( ByteIndex < ( Node -> Value + Node -> Length ) ) ) { return ( Node ) ; } Node = Node -> Peer ; } return ( NULL ) ; }
FUNCTION:    AcpiDmGetResourceNode
 PARAMETERS:  BufferNode          - Node for the parent buffer
              BitIndex            - Index into the resource descriptor
FUNCTION : AcpiDmGetResourceNode PARAMETERS : BufferNode - Node for the parent buffer BitIndex - Index into the resource descriptor
/*
     * Child list contains an entry for each resource descriptor. Find
     * the descriptor that corresponds to the Index.
     *
     * If there are no children, this is not a resource template
     */ /*
         * Check if the Index falls within this resource.
         *
         * Value contains the resource offset, Object contains the resource
         * length (both in bytes)
         */