summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/cbus_dma.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2001-06-26 11:47:24 +0000
committernyan <nyan@FreeBSD.org>2001-06-26 11:47:24 +0000
commit0389b45e3baf316ed6c2c3e63ef0c667be5891f8 (patch)
treef337ca82e73fcebdb0806cfa36d88b36a8b3a6bd /sys/pc98/cbus/cbus_dma.c
parentd80add6a08dd15b2e8e5c815aab486c0f39d6cc3 (diff)
downloadFreeBSD-src-0389b45e3baf316ed6c2c3e63ef0c667be5891f8.zip
FreeBSD-src-0389b45e3baf316ed6c2c3e63ef0c667be5891f8.tar.gz
Merged from sys/i386/isa/isa_dma.c revision 1.7.
Diffstat (limited to 'sys/pc98/cbus/cbus_dma.c')
-rw-r--r--sys/pc98/cbus/cbus_dma.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/pc98/cbus/cbus_dma.c b/sys/pc98/cbus/cbus_dma.c
index 62de37d..0ba9d40 100644
--- a/sys/pc98/cbus/cbus_dma.c
+++ b/sys/pc98/cbus/cbus_dma.c
@@ -56,6 +56,8 @@
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
#include <sys/module.h>
#ifdef PC98
#include <machine/md_var.h>
@@ -285,7 +287,12 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
}
/* translate to physical */
+ mtx_lock(&vm_mtx); /*
+ * XXX: need to hold for longer period to
+ * ensure that mappings don't change
+ */
phys = pmap_extract(pmap_kernel(), (vm_offset_t)addr);
+ mtx_unlock(&vm_mtx);
if (flags & ISADMA_RAW) {
dma_auto_mode |= (1 << chan);
@@ -433,7 +440,9 @@ isa_dmarangecheck(caddr_t va, u_int length, int chan)
endva = (vm_offset_t)round_page((vm_offset_t)va + length);
for (; va < (caddr_t) endva ; va += PAGE_SIZE) {
+ mtx_lock(&vm_mtx);
phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va));
+ mtx_unlock(&vm_mtx);
#ifdef EPSON_BOUNCEDMA
#define ISARAM_END 0xf00000
#else
OpenPOWER on IntegriCloud