FreeBSD/sys/sparc64/sparc64/bus_machdep.c
/*
 * Utility function to load a physical buffer.  segp contains
 * the starting segment on entrace, and the ending segment on exit.
 */
Utility function to load a physical buffer.  segp contains
the starting segment on entrace, and the ending segment on exit.
Utility function to load a physical buffer . segp contains the starting segment on entrace and the ending segment on exit .
static int
nexus_dmamap_load_phys(bus_dma_tag_t dmat, bus_dmamap_t map, vm_paddr_t buf,
    bus_size_t buflen, int flags, bus_dma_segment_t *segs, int *segp)
{
	bus_addr_t curaddr;
	bus_size_t sgsize;
	if (segs == NULL)
		segs = dmat->dt_segments;
	curaddr = buf;
	while (buflen > 0) {
		sgsize = MIN(buflen, dmat->dt_maxsegsz);
		sgsize = nexus_dmamap_addseg(dmat, map, curaddr, sgsize, segs,
		    segp);
		if (sgsize == 0)
			break;
		curaddr += sgsize;
		buflen -= sgsize;
	}
	return (buflen != 0 ? EFBIG : 0); 
}
static int nexus_dmamap_load_phys ( bus_dma_tag_t dmat , bus_dmamap_t map , vm_paddr_t buf , bus_size_t buflen , int flags , bus_dma_segment_t * segs , int * segp ) { bus_addr_t curaddr ; bus_size_t sgsize ; if ( segs == NULL ) segs = dmat -> dt_segments ; curaddr = buf ; while ( buflen > 0 ) { sgsize = MIN ( buflen , dmat -> dt_maxsegsz ) ; sgsize = nexus_dmamap_addseg ( dmat , map , curaddr , sgsize , segs , segp ) ; if ( sgsize == 0 ) break ; curaddr += sgsize ; buflen -= sgsize ; } return ( buflen != 0 ? EFBIG : 0 ) ; }
Utility function to load a physical buffer.
Utility function to load a physical buffer .
/*
	 * Did we fit?
	 */ /* XXX better return value here? */