FreeBSD/sys/x86/x86/busdma_bounce.c
/*
 * Free a piece of memory and it's allociated dmamap, that was allocated
 * via bus_dmamem_alloc.  Make the same choice for free/contigfree.
 */
Free a piece of memory and it's allociated dmamap, that was allocated
via bus_dmamem_alloc.  Make the same choice for free/contigfree.
Free a piece of memory and it ' s allociated dmamap that was allocated via bus_dmamem_alloc . Make the same choice for free / contigfree .
static void
bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
{
	if (map != NULL)
		panic("bus_dmamem_free: Invalid map freed\n");
	if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0)
		free(vaddr, M_DEVBUF);
	else
		kmem_free(kernel_arena, (vm_offset_t)vaddr,
		    dmat->common.maxsize);
	CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat,
	    dmat->bounce_flags);
}
static void bounce_bus_dmamem_free ( bus_dma_tag_t dmat , void * vaddr , bus_dmamap_t map ) { if ( map != NULL ) panic ( " \n " ) ; if ( ( dmat -> bounce_flags & BUS_DMA_KMEM_ALLOC ) == 0 ) free ( vaddr , M_DEVBUF ) ; else kmem_free ( kernel_arena , ( vm_offset_t ) vaddr , dmat -> common . maxsize ) ; CTR3 ( KTR_BUSDMA , " " , __func__ , dmat , dmat -> bounce_flags ) ; }
Free a piece of memory and it's allociated dmamap, that was allocated
 via bus_dmamem_alloc.
Free a piece of memory and it ' s allociated dmamap that was allocated via bus_dmamem_alloc .
/*
	 * dmamem does not need to be bounced, so the map should be
	 * NULL and the BUS_DMA_KMEM_ALLOC flag cleared if malloc()
	 * was used and set if kmem_alloc_contig() was used.
	 */