Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm32 bus_dmamap_load_raw: support coherent map...
details: https://anonhg.NetBSD.org/src/rev/93822445da5d
branches: trunk
changeset: 463487:93822445da5d
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Aug 24 11:51:26 2019 +0000
description:
bus_dmamap_load_raw: support coherent mappings
bus_dmamap_sync: support syncing "raw" buffer types
diffstat:
sys/arch/arm/arm32/bus_dma.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diffs (59 lines):
diff -r 6ea7dd5ca2fd -r 93822445da5d sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c Sat Aug 24 11:40:37 2019 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c Sat Aug 24 11:51:26 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $ */
+/* $NetBSD: bus_dma.c,v 1.116 2019/08/24 11:51:26 jmcneill Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#include "opt_cputypes.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.115 2019/06/14 09:09:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.116 2019/08/24 11:51:26 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -750,8 +750,10 @@
sgsize = MIN(ds->ds_len, size);
if (sgsize == 0)
continue;
+ const bool coherent =
+ (ds->_ds_flags & _BUS_DMAMAP_COHERENT) != 0;
error = _bus_dmamap_load_paddr(t, map, ds->ds_addr,
- sgsize, false);
+ sgsize, coherent);
if (error != 0)
break;
size -= sgsize;
@@ -766,6 +768,9 @@
/* XXX TBD bounce */
map->dm_mapsize = size0;
+ map->_dm_origbuf = NULL;
+ map->_dm_buftype = _BUS_DMA_BUFTYPE_RAW;
+ map->_dm_vmspace = NULL;
return 0;
}
@@ -1165,6 +1170,7 @@
switch (buftype) {
case _BUS_DMA_BUFTYPE_LINEAR:
+ case _BUS_DMA_BUFTYPE_RAW:
_bus_dmamap_sync_linear(t, map, offset, len, ops);
break;
@@ -1176,10 +1182,6 @@
_bus_dmamap_sync_uio(t, map, offset, len, ops);
break;
- case _BUS_DMA_BUFTYPE_RAW:
- panic("_bus_dmamap_sync: _BUS_DMA_BUFTYPE_RAW");
- break;
-
case _BUS_DMA_BUFTYPE_INVALID:
panic("_bus_dmamap_sync: _BUS_DMA_BUFTYPE_INVALID");
break;
Home |
Main Index |
Thread Index |
Old Index