Deleted Added
full compact
busdma_machdep.c (109490) busdma_machdep.c (109623)
1/*
2 * Copyright (c) 1997 Justin T. Gibbs.
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

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

18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 *
1/*
2 * Copyright (c) 1997 Justin T. Gibbs.
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

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

18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * $FreeBSD: head/sys/ia64/ia64/busdma_machdep.c 109490 2003-01-18 18:33:56Z mux $
26 * $FreeBSD: head/sys/ia64/ia64/busdma_machdep.c 109623 2003-01-21 08:56:16Z alfred $
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/malloc.h>
32#include <sys/mbuf.h>
33#include <sys/bus.h>
34#include <sys/interrupt.h>

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

344bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
345 bus_dmamap_t *mapp)
346{
347 /* If we succeed, no mapping/bouncing will be required */
348 *mapp = &nobounce_dmamap;
349
350 if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) {
351 *vaddr = malloc(dmat->maxsize, M_DEVBUF,
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/malloc.h>
32#include <sys/mbuf.h>
33#include <sys/bus.h>
34#include <sys/interrupt.h>

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

344bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
345 bus_dmamap_t *mapp)
346{
347 /* If we succeed, no mapping/bouncing will be required */
348 *mapp = &nobounce_dmamap;
349
350 if ((dmat->maxsize <= PAGE_SIZE) && dmat->lowaddr >= ptoa(Maxmem)) {
351 *vaddr = malloc(dmat->maxsize, M_DEVBUF,
352 (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK);
352 (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0);
353 } else {
354 /*
355 * XXX Use Contigmalloc until it is merged into this facility
356 * and handles multi-seg allocations. Nobody is doing
357 * multi-seg allocations yet though.
358 */
359 *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF,
353 } else {
354 /*
355 * XXX Use Contigmalloc until it is merged into this facility
356 * and handles multi-seg allocations. Nobody is doing
357 * multi-seg allocations yet though.
358 */
359 *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF,
360 (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK,
360 (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : 0,
361 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
362 dmat->boundary);
363 }
364 if (*vaddr == NULL)
365 return (ENOMEM);
366 return (0);
367}
368

--- 552 unchanged lines hidden ---
361 0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
362 dmat->boundary);
363 }
364 if (*vaddr == NULL)
365 return (ENOMEM);
366 return (0);
367}
368

--- 552 unchanged lines hidden ---