FreeBSD/sys/dev/bhnd/bhndb/bhndb_subr.c
/**
 * Return true if @p regw defines a static port register window, and
 * the mapped port is actually defined on @p dev.
 * 
 * @param regw A register window to match against.
 * @param dev A bhnd(4) bus device.
 */
Return true if @p regw defines a static port register window, and
the mapped port is actually defined on @p dev.

@param regw A register window to match against.
@param dev A bhnd(4) bus device.
Return true if @p regw defines a static port register window and the mapped port is actually defined on @p dev . @param regw A register window to match against . @param dev A bhnd ( 4 ) bus device .
bool
bhndb_regwin_matches_device(const struct bhndb_regwin *regw, device_t dev)
{
	if (regw->win_type != BHNDB_REGWIN_T_CORE)
		return (false);
	if (bhnd_get_class(dev) != regw->d.core.class)
		return (false);
	if (bhnd_get_core_unit(dev) != regw->d.core.unit)
		return (false);
	if (!bhnd_is_region_valid(dev, regw->d.core.port_type, regw->d.core.port,
	    regw->d.core.region))
	{
		return (false);
	}
	return (true);
}
bool bhndb_regwin_matches_device ( const struct bhndb_regwin * regw , device_t dev ) { if ( regw -> win_type != BHNDB_REGWIN_T_CORE ) return ( false ) ; if ( bhnd_get_class ( dev ) != regw -> d . core . class ) return ( false ) ; if ( bhnd_get_core_unit ( dev ) != regw -> d . core . unit ) return ( false ) ; if ( ! bhnd_is_region_valid ( dev , regw -> d . core . port_type , regw -> d . core . port , regw -> d . core . region ) ) { return ( false ) ; } return ( true ) ; }
Return true if @p regw defines a static port register window, and
 the mapped port is actually defined on @p dev.
Return true if @p regw defines a static port register window and the mapped port is actually defined on @p dev .
/* Only core windows are supported */ /* Device class must match */ /* Device unit must match */ /* The regwin port/region must be defined. */ /* Matches */