diff options
Diffstat (limited to 'sys/i386/isa/isa_dma.c')
-rw-r--r-- | sys/i386/isa/isa_dma.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/i386/isa/isa_dma.c b/sys/i386/isa/isa_dma.c index 6acc527..d9f1233 100644 --- a/sys/i386/isa/isa_dma.c +++ b/sys/i386/isa/isa_dma.c @@ -53,6 +53,7 @@ #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/lock.h> +#include <sys/proc.h> #include <sys/mutex.h> #include <sys/module.h> #include <vm/vm.h> @@ -216,6 +217,8 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) int waport; caddr_t newaddr; + GIANT_REQUIRED; + #ifdef DIAGNOSTIC if (chan & ~VALID_DMA_MASK) panic("isa_dmastart: channel out of range"); @@ -254,12 +257,7 @@ 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); @@ -378,11 +376,11 @@ isa_dmarangecheck(caddr_t va, u_int length, int chan) vm_offset_t phys, priorpage = 0, endva; u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); + GIANT_REQUIRED; + 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); #define ISARAM_END RAM_END if (phys == 0) panic("isa_dmacheck: no physical page present"); |