cvs commit: src/sys/alpha/alpha
busdma_machdep.csrc/sys/alpha/includebus_dma.h
src/sys/sparc64/include bus.h iommuvar.h ...
Scott Long
scott_long at btc.adaptec.com
Mon May 26 07:28:31 PDT 2003
Dag-Erling Smorgrav wrote:
> Dag-Erling Smorgrav <des at ofug.org> writes:
>
>>Scott Long <scottl at FreeBSD.org> writes:
>>
>>> Log:
>>> De-orbit bus_dmamem_alloc_size(). It's a hack and was never used anyways.
>>> No need for it to pollute the 5.x API any further.
>>
>>Thanks a bunch for breaking sparc64...
>
>
> You'll need (at least) the attached (untested) patch to fix it.
>
> DES
>
I did indeed forget to commit bus_machdep.c. Thanks for reminding me
with the patch. It looks to be identical to what I missed.
Scott
>
> ------------------------------------------------------------------------
>
> Index: sparc64/bus_machdep.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/sparc64/sparc64/bus_machdep.c,v
> retrieving revision 1.27
> diff -u -r1.27 bus_machdep.c
> --- sparc64/bus_machdep.c 10 Apr 2003 23:03:33 -0000 1.27
> +++ sparc64/bus_machdep.c 26 May 2003 12:31:23 -0000
> @@ -170,12 +170,8 @@
> struct uio *, bus_dmamap_callback2_t *, void *, int);
> static void nexus_dmamap_unload(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t);
> static void nexus_dmamap_sync(bus_dma_tag_t, bus_dma_tag_t, bus_dmamap_t, int);
> -static int nexus_dmamem_alloc_size(bus_dma_tag_t, bus_dma_tag_t, void **, int,
> - bus_dmamap_t *, u_long size);
> static int nexus_dmamem_alloc(bus_dma_tag_t, bus_dma_tag_t, void **, int,
> bus_dmamap_t *);
> -static void nexus_dmamem_free_size(bus_dma_tag_t, bus_dma_tag_t, void *,
> - bus_dmamap_t, u_long size);
> static void nexus_dmamem_free(bus_dma_tag_t, bus_dma_tag_t, void *,
> bus_dmamap_t);
>
> @@ -228,9 +224,7 @@
> newtag->dt_dmamap_load_uio = NULL;
> newtag->dt_dmamap_unload = NULL;
> newtag->dt_dmamap_sync = NULL;
> - newtag->dt_dmamem_alloc_size = NULL;
> newtag->dt_dmamem_alloc = NULL;
> - newtag->dt_dmamem_free_size = NULL;
> newtag->dt_dmamem_free = NULL;
>
> /* Take into account any restrictions imposed by our parent tag */
> @@ -610,74 +604,18 @@
> dmat->dt_map_count--;
> }
>
> -/*
> - * Common function for DMA-safe memory allocation. May be called
> - * by bus-specific DMA memory allocation functions.
> - */
> -static int
> -nexus_dmamem_alloc_size(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void **vaddr,
> - int flags, bus_dmamap_t *mapp, bus_size_t size)
> -{
> -
> - if (size > ddmat->dt_maxsize)
> - return (ENOMEM);
> -
> - if ((size <= PAGE_SIZE)) {
> - *vaddr = malloc(size, M_DEVBUF,
> - (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK);
> - } else {
> - /*
> - * XXX: Use contigmalloc until it is merged into this facility
> - * and handles multi-seg allocations. Nobody is doing multi-seg
> - * allocations yet though.
> - */
> - mtx_lock(&Giant);
> - *vaddr = contigmalloc(size, M_DEVBUF,
> - (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK,
> - 0ul, ddmat->dt_lowaddr,
> - ddmat->dt_alignment ? ddmat->dt_alignment : 1UL,
> - ddmat->dt_boundary);
> - mtx_unlock(&Giant);
> - }
> - if (*vaddr == NULL) {
> - free(*mapp, M_DEVBUF);
> - return (ENOMEM);
> - }
> - return (0);
> -}
> -
> static int
> nexus_dmamem_alloc(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void **vaddr,
> int flags, bus_dmamap_t *mapp)
> {
> - return (sparc64_dmamem_alloc_size(pdmat, ddmat, vaddr, flags, mapp,
> - ddmat->dt_maxsize));
> -}
> -
> -/*
> - * Common function for freeing DMA-safe memory. May be called by
> - * bus-specific DMA memory free functions.
> - */
> -static void
> -nexus_dmamem_free_size(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void *vaddr,
> - bus_dmamap_t map, bus_size_t size)
> -{
> -
> - sparc64_dmamem_free_map(ddmat, map);
> - if ((size <= PAGE_SIZE))
> - free(vaddr, M_DEVBUF);
> - else {
> - mtx_lock(&Giant);
> - contigfree(vaddr, size, M_DEVBUF);
> - mtx_unlock(&Giant);
> - }
> + return (sparc64_dmamem_alloc_size(pdmat, ddmat, vaddr, flags, mapp));
> }
>
> static void
> nexus_dmamem_free(bus_dma_tag_t pdmat, bus_dma_tag_t ddmat, void *vaddr,
> bus_dmamap_t map)
> {
> - sparc64_dmamem_free_size(pdmat, ddmat, vaddr, map, ddmat->dt_maxsize);
> + sparc64_dmamem_free(pdmat, ddmat, vaddr, map);
> }
>
> struct bus_dma_tag nexus_dmatag = {
> @@ -703,9 +641,7 @@
> nexus_dmamap_unload,
> nexus_dmamap_sync,
>
> - nexus_dmamem_alloc_size,
> nexus_dmamem_alloc,
> - nexus_dmamem_free_size,
> nexus_dmamem_free,
> };
>
More information about the cvs-all
mailing list