Deleted Added
full compact
busdma_machdep-v6.c (274191) busdma_machdep-v6.c (274536)
1/*-
2 * Copyright (c) 2012 Ian Lepore
3 * Copyright (c) 2010 Mark Tinguely
4 * Copyright (c) 2004 Olivier Houchard
5 * Copyright (c) 2002 Peter Grehan
6 * Copyright (c) 1997, 1998 Justin T. Gibbs.
7 * All rights reserved.
8 *

--- 17 unchanged lines hidden (view full) ---

26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * From i386/busdma_machdep.c 191438 2009-04-23 20:24:19Z jhb
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Ian Lepore
3 * Copyright (c) 2010 Mark Tinguely
4 * Copyright (c) 2004 Olivier Houchard
5 * Copyright (c) 2002 Peter Grehan
6 * Copyright (c) 1997, 1998 Justin T. Gibbs.
7 * All rights reserved.
8 *

--- 17 unchanged lines hidden (view full) ---

26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * From i386/busdma_machdep.c 191438 2009-04-23 20:24:19Z jhb
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/arm/arm/busdma_machdep-v6.c 274191 2014-11-06 19:14:58Z ian $");
34__FBSDID("$FreeBSD: head/sys/arm/arm/busdma_machdep-v6.c 274536 2014-11-15 02:58:17Z ian $");
35
36#define _ARM32_BUS_DMA_PRIVATE
37#include <sys/param.h>
38#include <sys/kdb.h>
39#include <ddb/ddb.h>
40#include <ddb/db_output.h>
41#include <sys/systm.h>
42#include <sys/malloc.h>

--- 16 unchanged lines hidden (view full) ---

59#include <vm/vm_extern.h>
60#include <vm/vm_kern.h>
61
62#include <machine/atomic.h>
63#include <machine/bus.h>
64#include <machine/cpufunc.h>
65#include <machine/md_var.h>
66
35
36#define _ARM32_BUS_DMA_PRIVATE
37#include <sys/param.h>
38#include <sys/kdb.h>
39#include <ddb/ddb.h>
40#include <ddb/db_output.h>
41#include <sys/systm.h>
42#include <sys/malloc.h>

--- 16 unchanged lines hidden (view full) ---

59#include <vm/vm_extern.h>
60#include <vm/vm_kern.h>
61
62#include <machine/atomic.h>
63#include <machine/bus.h>
64#include <machine/cpufunc.h>
65#include <machine/md_var.h>
66
67#define IS_POWER_OF_2(val) (((val) & ((val) - 1)) == 0)
68
69#define MAX_BPAGES 64
70#define MAX_DMA_SEGMENTS 4096
71#define BUS_DMA_EXCL_BOUNCE BUS_DMA_BUS2
72#define BUS_DMA_ALIGN_BOUNCE BUS_DMA_BUS3
73#define BUS_DMA_COULD_BOUNCE (BUS_DMA_EXCL_BOUNCE | BUS_DMA_ALIGN_BOUNCE)
74#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4
75
76struct bounce_zone;

--- 387 unchanged lines hidden (view full) ---

464 int error = 0;
465
466#if 0
467 if (!parent)
468 parent = arm_root_dma_tag;
469#endif
470
471 /* Basic sanity checking. */
67#define MAX_BPAGES 64
68#define MAX_DMA_SEGMENTS 4096
69#define BUS_DMA_EXCL_BOUNCE BUS_DMA_BUS2
70#define BUS_DMA_ALIGN_BOUNCE BUS_DMA_BUS3
71#define BUS_DMA_COULD_BOUNCE (BUS_DMA_EXCL_BOUNCE | BUS_DMA_ALIGN_BOUNCE)
72#define BUS_DMA_MIN_ALLOC_COMP BUS_DMA_BUS4
73
74struct bounce_zone;

--- 387 unchanged lines hidden (view full) ---

462 int error = 0;
463
464#if 0
465 if (!parent)
466 parent = arm_root_dma_tag;
467#endif
468
469 /* Basic sanity checking. */
472 KASSERT(boundary == 0 || IS_POWER_OF_2(boundary),
470 KASSERT(boundary == 0 || powerof2(boundary),
473 ("dma tag boundary %lu, must be a power of 2", boundary));
474 KASSERT(boundary == 0 || boundary >= maxsegsz,
475 ("dma tag boundary %lu is < maxsegsz %lu\n", boundary, maxsegsz));
471 ("dma tag boundary %lu, must be a power of 2", boundary));
472 KASSERT(boundary == 0 || boundary >= maxsegsz,
473 ("dma tag boundary %lu is < maxsegsz %lu\n", boundary, maxsegsz));
476 KASSERT(alignment != 0 && IS_POWER_OF_2(alignment),
474 KASSERT(alignment != 0 && powerof2(alignment),
477 ("dma tag alignment %lu, must be non-zero power of 2", alignment));
478 KASSERT(maxsegsz != 0, ("dma tag maxsegsz must not be zero"));
479
480 /* Return a NULL tag on failure */
481 *dmat = NULL;
482
483 newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF,
484 M_ZERO | M_NOWAIT);

--- 1206 unchanged lines hidden ---
475 ("dma tag alignment %lu, must be non-zero power of 2", alignment));
476 KASSERT(maxsegsz != 0, ("dma tag maxsegsz must not be zero"));
477
478 /* Return a NULL tag on failure */
479 *dmat = NULL;
480
481 newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF,
482 M_ZERO | M_NOWAIT);

--- 1206 unchanged lines hidden ---