FreeBSD/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Find the resource containing @p win.
 * 
 * @param br The bhndb resource state to search.
 * @param win A register window.
 * 
 * @retval resource the resource containing @p win.
 * @retval NULL if no resource containing @p win can be found.
 */
Find the resource containing @p win.

@param br The bhndb resource state to search.
@param win A register window.

@retval resource the resource containing @p win.
@retval NULL if no resource containing @p win can be found.
Find the resource containing @p win . @param br The bhndb resource state to search . @param win A register window . @retval resource the resource containing @p win . @retval NULL if no resource containing @p win can be found .
struct resource *
bhndb_find_regwin_resource(struct bhndb_resources *br,
    const struct bhndb_regwin *win)
{
	const struct resource_spec *rspecs;
	rspecs = br->cfg->resource_specs;
	for (u_int i = 0; rspecs[i].type != -1; i++) {			
		if (win->res.type != rspecs[i].type)
			continue;
		if (win->res.rid != rspecs[i].rid)
			continue;
		return (br->res[i]);
	}
	device_printf(br->dev,
	    "missing regwin resource spec (type=%d, rid=%d)\n",
	    win->res.type, win->res.rid);
	return (NULL);
}
struct resource * bhndb_find_regwin_resource ( struct bhndb_resources * br , const struct bhndb_regwin * win ) { const struct resource_spec * rspecs ; rspecs = br -> cfg -> resource_specs ; for ( u_int i = 0 ; rspecs [ i ] . type != -1 ; i ++ ) { if ( win -> res . type != rspecs [ i ] . type ) continue ; if ( win -> res . rid != rspecs [ i ] . rid ) continue ; return ( br -> res [ i ] ) ; } device_printf ( br -> dev , " \n " , win -> res . type , win -> res . rid ) ; return ( NULL ) ; }
Find the resource containing @p win.
Find the resource containing @p win .
/* Found declared resource */