src/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Find the bus region that maps @p size bytes at @p addr.
 * 
 * @param br The resource state to search.
 * @param addr The requested starting address.
 * @param size The requested size.
 * 
 * @retval bhndb_region A region that fully contains the requested range.
 * @retval NULL If no mapping region can be found.
 */
Find the bus region that maps @p size bytes at @p addr.

@param br The resource state to search.
@param addr The requested starting address.
@param size The requested size.

@retval bhndb_region A region that fully contains the requested range.
@retval NULL If no mapping region can be found.
Find the bus region that maps @p size bytes at @p addr . @param br The resource state to search . @param addr The requested starting address . @param size The requested size . @retval bhndb_region A region that fully contains the requested range . @retval NULL If no mapping region can be found .
struct bhndb_region *
bhndb_find_resource_region(struct bhndb_resources *br, bhnd_addr_t addr,
    bhnd_size_t size)
{
	struct bhndb_region *region;
	STAILQ_FOREACH(region, &br->bus_regions, link) {
		if (addr < region->addr)
			continue;
		if (addr + size > region->addr + region->size)
			continue;
		return (region);
	}
	return (NULL);
}
struct bhndb_region * bhndb_find_resource_region ( struct bhndb_resources * br , bhnd_addr_t addr , bhnd_size_t size ) { struct bhndb_region * region ; STAILQ_FOREACH ( region , & br -> bus_regions , link ) { if ( addr < region -> addr ) continue ; if ( addr + size > region -> addr + region -> size ) continue ; return ( region ) ; } return ( NULL ) ; }
Find the bus region that maps @p size bytes at @p addr.
Find the bus region that maps @p size bytes at @p addr .
/* Request must fit within the region's mapping  */ /* Not found */