FreeBSD/sys/dev/acpica/acpi_resource.c
/*
 * Fetch a device's resources and associate them with the device.
 *
 * Note that it might be nice to also locate ACPI-specific resource items, such
 * as GPE bits.
 *
 * We really need to split the resource-fetching code out from the
 * resource-parsing code, since we may want to use the parsing
 * code for _PRS someday.
 */
Fetch a device's resources and associate them with the device.
Note that it might be nice to also locate ACPI-specific resource items, such
as GPE bits.

We really need to split the resource-fetching code out from the
resource-parsing code, since we may want to use the parsing
code for _PRS someday.
Fetch a device ' s resources and associate them with the device . Note that it might be nice to also locate ACPI - specific resource items such as GPE bits . We really need to split the resource - fetching code out from the resource - parsing code since we may want to use the parsing code for _PRS someday .
ACPI_STATUS
acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
		     struct acpi_parse_resource_set *set, void *arg)
{
    struct acpi_resource_context arc;
    ACPI_STATUS		status;
    ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
    set->set_init(dev, arg, &arc.context);
    arc.set = set;
    arc.dev = dev;
    status = AcpiWalkResources(handle, "_CRS", acpi_parse_resource, &arc);
    if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
	printf("can't fetch resources for %s - %s\n",
	    acpi_name(handle), AcpiFormatException(status));
	return_ACPI_STATUS (status);
    }
    set->set_done(dev, arc.context);
    return_ACPI_STATUS (AE_OK);
}
ACPI_STATUS acpi_parse_resources ( device_t dev , ACPI_HANDLE handle , struct acpi_parse_resource_set * set , void * arg ) { struct acpi_resource_context arc ; ACPI_STATUS status ; ACPI_FUNCTION_TRACE ( ( char * ) ( uintptr_t ) __func__ ) ; set -> set_init ( dev , arg , & arc . context ) ; arc . set = set ; arc . dev = dev ; status = AcpiWalkResources ( handle , " " , acpi_parse_resource , & arc ) ; if ( ACPI_FAILURE ( status ) && status != AE_NOT_FOUND ) { printf ( " \n " , acpi_name ( handle ) , AcpiFormatException ( status ) ) ; return_ACPI_STATUS ( status ) ; } set -> set_done ( dev , arc . context ) ; return_ACPI_STATUS ( AE_OK ) ; }
Fetch a device's resources and associate them with the device.
Fetch a device ' s resources and associate them with the device .