deps/acpica/source/common/dmrestag.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmUpdateResourceName
 *
 * PARAMETERS:  ResourceNode        - Node for a resource descriptor
 *
 * RETURN:      Stores new name in the ResourceNode
 *
 * DESCRIPTION: Create a new, unique name for a resource descriptor. Used by
 *              both the disassembly of the descriptor itself and any symbolic
 *              references to the descriptor. Ignored if a unique name has
 *              already been assigned to the resource.
 *
 * NOTE: Single threaded, suitable for applications only!
 *
 ******************************************************************************/
AcpiDmUpdateResourceName
PARAMETERS:  ResourceNode        - Node for a resource descriptor

Stores new name in the ResourceNode

Create a new, unique name for a resource descriptor. Used by
both the disassembly of the descriptor itself and any symbolic
references to the descriptor. Ignored if a unique name has
already been assigned to the resource.

Single threaded, suitable for applications only!
AcpiDmUpdateResourceName PARAMETERS : ResourceNode - Node for a resource descriptor Stores new name in the ResourceNode Create a new unique name for a resource descriptor . Used by both the disassembly of the descriptor itself and any symbolic references to the descriptor . Ignored if a unique name has already been assigned to the resource . Single threaded suitable for applications only!
static void
AcpiDmUpdateResourceName (
    ACPI_NAMESPACE_NODE     *ResourceNode)
{
    char                    Name[ACPI_NAME_SIZE];
    if (ResourceNode->Name.Integer != ACPI_DEFAULT_RESNAME)
    {
        return;
    }
    Name[0] = '_';
    Name[1] = AcpiGbl_Prefix[AcpiGbl_NextPrefix];
    Name[2] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 4);
    Name[3] = AcpiUtHexToAsciiChar ((UINT64) AcpiGbl_NextResourceId, 0);
    AcpiGbl_NextResourceId++;
    if (AcpiGbl_NextResourceId >= 256)
    {
        AcpiGbl_NextResourceId = 0;
        AcpiGbl_NextPrefix++;
        if (AcpiGbl_NextPrefix > ACPI_NUM_RES_PREFIX)
        {
            AcpiGbl_NextPrefix = 0;
        }
    }
    ResourceNode->Name.Integer = *ACPI_CAST_PTR (UINT32, &Name[0]);
}
static void AcpiDmUpdateResourceName ( ACPI_NAMESPACE_NODE * ResourceNode ) { char Name [ ACPI_NAME_SIZE ] ; if ( ResourceNode -> Name . Integer != ACPI_DEFAULT_RESNAME ) { return ; } Name [ 0 ] = ' ' ; Name [ 1 ] = AcpiGbl_Prefix [ AcpiGbl_NextPrefix ] ; Name [ 2 ] = AcpiUtHexToAsciiChar ( ( UINT64 ) AcpiGbl_NextResourceId , 4 ) ; Name [ 3 ] = AcpiUtHexToAsciiChar ( ( UINT64 ) AcpiGbl_NextResourceId , 0 ) ; AcpiGbl_NextResourceId ++ ; if ( AcpiGbl_NextResourceId >= 256 ) { AcpiGbl_NextResourceId = 0 ; AcpiGbl_NextPrefix ++ ; if ( AcpiGbl_NextPrefix > ACPI_NUM_RES_PREFIX ) { AcpiGbl_NextPrefix = 0 ; } } ResourceNode -> Name . Integer = * ACPI_CAST_PTR ( UINT32 , & Name [ 0 ] ) ; }
FUNCTION:    AcpiDmUpdateResourceName
 PARAMETERS:  ResourceNode        - Node for a resource descriptor
FUNCTION : AcpiDmUpdateResourceName PARAMETERS : ResourceNode - Node for a resource descriptor
/* Ignore if a unique name has already been assigned */ /* Generate a new ACPI name for the descriptor */ /* Update globals for next name */ /* Change the resource descriptor name */