From 0389b45e3baf316ed6c2c3e63ef0c667be5891f8 Mon Sep 17 00:00:00 2001 From: nyan Date: Tue, 26 Jun 2001 11:47:24 +0000 Subject: [PATCH] Merged from sys/i386/isa/isa_dma.c revision 1.7. --- sys/pc98/cbus/cbus_dma.c | 9 +++++++++ sys/pc98/pc98/isa_dma.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/sys/pc98/cbus/cbus_dma.c b/sys/pc98/cbus/cbus_dma.c index 62de37da7db4..0ba9d400180d 100644 --- a/sys/pc98/cbus/cbus_dma.c +++ b/sys/pc98/cbus/cbus_dma.c @@ -56,6 +56,8 @@ #include #include #include +#include +#include #include #ifdef PC98 #include @@ -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 diff --git a/sys/pc98/pc98/isa_dma.c b/sys/pc98/pc98/isa_dma.c index 62de37da7db4..0ba9d400180d 100644 --- a/sys/pc98/pc98/isa_dma.c +++ b/sys/pc98/pc98/isa_dma.c @@ -56,6 +56,8 @@ #include #include #include +#include +#include #include #ifdef PC98 #include @@ -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