FreeBSD/sys/kern/subr_bus.c
/**
 * @brief Determine if a resource entry is busy.
 *
 * Returns true if a resource entry is busy meaning that it has an
 * associated resource that is not an unallocated "reserved" resource.
 *
 * @param rl		the resource list to search
 * @param type		the resource entry type (e.g. SYS_RES_MEMORY)
 * @param rid		the resource identifier
 *
 * @returns Non-zero if the entry is busy, zero otherwise.
 */
@brief Determine if a resource entry is busy.
Returns true if a resource entry is busy meaning that it has an
associated resource that is not an unallocated "reserved" resource.

@param rl            the resource list to search
@param type          the resource entry type
@param rid           the resource identifier

@returns Non-zero if the entry is busy, zero otherwise.
@brief Determine if a resource entry is busy . Returns true if a resource entry is busy meaning that it has an associated resource that is not an unallocated " reserved " resource . @param rl the resource list to search @param type the resource entry type @param rid the resource identifier @returns Non - zero if the entry is busy zero otherwise .
int
resource_list_busy(struct resource_list *rl, int type, int rid)
{
	struct resource_list_entry *rle;
	rle = resource_list_find(rl, type, rid);
	if (rle == NULL || rle->res == NULL)
		return (0);
	if ((rle->flags & (RLE_RESERVED | RLE_ALLOCATED)) == RLE_RESERVED) {
		KASSERT(!(rman_get_flags(rle->res) & RF_ACTIVE),
		    ("reserved resource is active"));
		return (0);
	}
	return (1);
}
int resource_list_busy ( struct resource_list * rl , int type , int rid ) { struct resource_list_entry * rle ; rle = resource_list_find ( rl , type , rid ) ; if ( rle == NULL || rle -> res == NULL ) return ( 0 ) ; if ( ( rle -> flags & ( RLE_RESERVED | RLE_ALLOCATED ) ) == RLE_RESERVED ) { KASSERT ( ! ( rman_get_flags ( rle -> res ) & RF_ACTIVE ) , ( " " ) ) ; return ( 0 ) ; } return ( 1 ) ; }
@brief Determine if a resource entry is busy.
@brief Determine if a resource entry is busy .