svn commit: r246203 - in projects/physbio/sys: arm/arm kern sys
Konstantin Belousov
kib at FreeBSD.org
Fri Feb 1 10:00:22 UTC 2013
Author: kib
Date: Fri Feb 1 10:00:21 2013
New Revision: 246203
URL: http://svnweb.freebsd.org/changeset/base/246203
Log:
ARM developers do not want the flushes of the partial cache lines
surrounding DMAed data area for mbuf. Inform _bus_dmamap_load_buffer()
that the current load is for mbuf, and make the bus_dmamap_sync_buf() to
behave as if the buffer was aligned.
Modified:
projects/physbio/sys/arm/arm/busdma_machdep.c
projects/physbio/sys/kern/subr_bus_dma.c
projects/physbio/sys/sys/bus_dma.h
Modified: projects/physbio/sys/arm/arm/busdma_machdep.c
==============================================================================
--- projects/physbio/sys/arm/arm/busdma_machdep.c Fri Feb 1 09:48:43 2013 (r246202)
+++ projects/physbio/sys/arm/arm/busdma_machdep.c Fri Feb 1 10:00:21 2013 (r246203)
@@ -1010,6 +1010,8 @@ _bus_dmamap_load_buffer(bus_dma_tag_t dm
if (segs == NULL)
segs = dmat->segments;
+ if ((flags & BUS_DMA_LOAD_MBUF) != 0)
+ map->flags |= DMAMAP_CACHE_ALIGNED;
if ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0) {
_bus_dmamap_count_pages(dmat, map, pmap, buf, buflen, flags);
Modified: projects/physbio/sys/kern/subr_bus_dma.c
==============================================================================
--- projects/physbio/sys/kern/subr_bus_dma.c Fri Feb 1 09:48:43 2013 (r246202)
+++ projects/physbio/sys/kern/subr_bus_dma.c Fri Feb 1 10:00:21 2013 (r246203)
@@ -110,7 +110,8 @@ _bus_dmamap_load_mbuf_sg(bus_dma_tag_t d
for (m = m0; m != NULL && error == 0; m = m->m_next) {
if (m->m_len > 0) {
error = _bus_dmamap_load_buffer(dmat, map, m->m_data,
- m->m_len, kernel_pmap, flags, segs, nsegs);
+ m->m_len, kernel_pmap, flags | BUS_DMA_LOAD_MBUF,
+ segs, nsegs);
}
}
CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d",
Modified: projects/physbio/sys/sys/bus_dma.h
==============================================================================
--- projects/physbio/sys/sys/bus_dma.h Fri Feb 1 09:48:43 2013 (r246202)
+++ projects/physbio/sys/sys/bus_dma.h Fri Feb 1 10:00:21 2013 (r246203)
@@ -109,6 +109,8 @@
*/
#define BUS_DMA_KEEP_PG_OFFSET 0x400
+#define BUS_DMA_LOAD_MBUF 0x800
+
/* Forwards needed by prototypes below. */
union ccb;
struct bio;
More information about the svn-src-projects
mailing list