busdma_machdep.c (240177) | busdma_machdep.c (242465) |
---|---|
1/*- 2 * Copyright (c) 2006 Oleksandr Tymoshenko 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2006 Oleksandr Tymoshenko 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/mips/mips/busdma_machdep.c 240177 2012-09-06 20:16:59Z jhb $"); | 30__FBSDID("$FreeBSD: head/sys/mips/mips/busdma_machdep.c 242465 2012-11-02 05:22:32Z adrian $"); |
31 32/* 33 * MIPS bus dma support routines 34 */ 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/malloc.h> --- 505 unchanged lines hidden (view full) --- 544/* 545 * Destroy a handle for mapping from kva/uva/physical 546 * address space into bus device space. 547 */ 548int 549bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) 550{ 551 | 31 32/* 33 * MIPS bus dma support routines 34 */ 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/malloc.h> --- 505 unchanged lines hidden (view full) --- 544/* 545 * Destroy a handle for mapping from kva/uva/physical 546 * address space into bus device space. 547 */ 548int 549bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) 550{ 551 |
552 _busdma_free_dmamap(map); | |
553 if (STAILQ_FIRST(&map->bpages) != NULL) { 554 CTR3(KTR_BUSDMA, "%s: tag %p error %d", 555 __func__, dmat, EBUSY); 556 return (EBUSY); 557 } 558 if (dmat->bounce_zone) 559 dmat->bounce_zone->map_count--; 560 dmat->map_count--; | 552 if (STAILQ_FIRST(&map->bpages) != NULL) { 553 CTR3(KTR_BUSDMA, "%s: tag %p error %d", 554 __func__, dmat, EBUSY); 555 return (EBUSY); 556 } 557 if (dmat->bounce_zone) 558 dmat->bounce_zone->map_count--; 559 dmat->map_count--; |
560 _busdma_free_dmamap(map); |
|
561 CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); 562 return (0); 563} 564 565/* 566 * Allocate a piece of memory that can be efficiently mapped into 567 * bus device space based on the constraints lited in the dma tag. 568 * A dmamap to for use with dmamap_load is also allocated. --- 920 unchanged lines hidden --- | 561 CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); 562 return (0); 563} 564 565/* 566 * Allocate a piece of memory that can be efficiently mapped into 567 * bus device space based on the constraints lited in the dma tag. 568 * A dmamap to for use with dmamap_load is also allocated. --- 920 unchanged lines hidden --- |