FreeBSD/sys/mips/mips/busdma_machdep.c
/*
 * Free a piece of memory and it's allocated dmamap, that was allocated
 * via bus_dmamem_alloc.  Make the same choice for free/contigfree.
 */
Free a piece of memory and it's allocated dmamap, that was allocated
via bus_dmamem_alloc.  Make the same choice for free/contigfree.
Free a piece of memory and it ' s allocated dmamap that was allocated via bus_dmamem_alloc . Make the same choice for free / contigfree .
void
bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
{
	struct busdma_bufzone *bufzone;
	busdma_bufalloc_t ba;
	if (map->flags & DMAMAP_UNCACHEABLE)
		ba = coherent_allocator;
	else
		ba = standard_allocator;
	free(map->slist, M_BUSDMA);
	uma_zfree(dmamap_zone, map);
	bufzone = busdma_bufalloc_findzone(ba, dmat->maxsize);
	if (bufzone != NULL && dmat->alignment <= bufzone->size &&
	    !_bus_dma_can_bounce(dmat->lowaddr, dmat->highaddr))
		uma_zfree(bufzone->umazone, vaddr);
	else
		kmem_free(kernel_arena, (vm_offset_t)vaddr, dmat->maxsize);
	CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags);
}
void bus_dmamem_free ( bus_dma_tag_t dmat , void * vaddr , bus_dmamap_t map ) { struct busdma_bufzone * bufzone ; busdma_bufalloc_t ba ; if ( map -> flags & DMAMAP_UNCACHEABLE ) ba = coherent_allocator ; else ba = standard_allocator ; free ( map -> slist , M_BUSDMA ) ; uma_zfree ( dmamap_zone , map ) ; bufzone = busdma_bufalloc_findzone ( ba , dmat -> maxsize ) ; if ( bufzone != NULL && dmat -> alignment <= bufzone -> size && ! _bus_dma_can_bounce ( dmat -> lowaddr , dmat -> highaddr ) ) uma_zfree ( bufzone -> umazone , vaddr ) ; else kmem_free ( kernel_arena , ( vm_offset_t ) vaddr , dmat -> maxsize ) ; CTR3 ( KTR_BUSDMA , " " , __func__ , dmat , dmat -> flags ) ; }
Free a piece of memory and it's allocated dmamap, that was allocated
 via bus_dmamem_alloc.
Free a piece of memory and it ' s allocated dmamap that was allocated via bus_dmamem_alloc .