Date: Mon, 26 May 2003 08:28:41 -0600 From: Scott Long <scott_long@btc.adaptec.com> To: Dag-Erling Smorgrav <des@ofug.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/alpha/alpha busdma_machdep.csrc/sys/alpha/includebus_dma.h src/sys/sparc64/include bus.h iommuvar.h ... Message-ID: <3ED22499.10805@btc.adaptec.com> In-Reply-To: <xzpllwt3myg.fsf@flood.ping.uio.no> References: <200305260400.h4Q40qxI041677@repoman.freebsd.org> <xzp7k8d52fj.fsf@flood.ping.uio.no> <xzpllwt3myg.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav wrote: > Dag-Erling Smorgrav <des@ofug.org> writes: > >>Scott Long <scottl@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, > }; >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3ED22499.10805>