FreeBSD/sys/arm/arm/nexus.c
/*
 * Allocate a resource on behalf of child.  NB: child is usually going to be a
 * child of one of our descendants, not a direct child of nexus0.
 * (Exceptions include footbridge.)
 */
Allocate a resource on behalf of child.  NB: child is usually going to be a
child of one of our descendants, not a direct child of nexus0.
(Exceptions include footbridge.)
Allocate a resource on behalf of child . NB : child is usually going to be a child of one of our descendants not a direct child of nexus0 . ( Exceptions include footbridge . )
static struct resource *
nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
    rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
	struct resource *rv;
	struct rman *rm;
	int needactivate = flags & RF_ACTIVE;
	flags &= ~RF_ACTIVE;
	switch (type) {
	case SYS_RES_MEMORY:
	case SYS_RES_IOPORT:
		rm = &mem_rman;
		break;
	default:
		return (NULL);
	}
	rv = rman_reserve_resource(rm, start, end, count, flags, child);
	if (rv == NULL)
		return (NULL);
	rman_set_rid(rv, *rid);
	if (needactivate) {
		if (bus_activate_resource(child, type, *rid, rv)) {
			rman_release_resource(rv);
			return (0);
		}
	}
	return (rv);
}
static struct resource * nexus_alloc_resource ( device_t bus , device_t child , int type , int * rid , rman_res_t start , rman_res_t end , rman_res_t count , u_int flags ) { struct resource * rv ; struct rman * rm ; int needactivate = flags & RF_ACTIVE ; flags &= ~ RF_ACTIVE ; switch ( type ) { case SYS_RES_MEMORY : case SYS_RES_IOPORT : rm = & mem_rman ; break ; default : return ( NULL ) ; } rv = rman_reserve_resource ( rm , start , end , count , flags , child ) ; if ( rv == NULL ) return ( NULL ) ; rman_set_rid ( rv , * rid ) ; if ( needactivate ) { if ( bus_activate_resource ( child , type , * rid , rv ) ) { rman_release_resource ( rv ) ; return ( 0 ) ; } } return ( rv ) ; }
Allocate a resource on behalf of child.
Allocate a resource on behalf of child .