From 54b23216796ed23667a583bdd2ac4b94e502545b Mon Sep 17 00:00:00 2001 From: alfred Date: Wed, 23 May 2001 22:13:58 +0000 Subject: lock vm while playing with pmap --- sys/amd64/isa/isa_dma.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/amd64/isa') diff --git a/sys/amd64/isa/isa_dma.c b/sys/amd64/isa/isa_dma.c index dab5e6a..42b9c7c 100644 --- a/sys/amd64/isa/isa_dma.c +++ b/sys/amd64/isa/isa_dma.c @@ -52,6 +52,8 @@ #include #include #include +#include +#include #include #include #include @@ -252,7 +254,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); @@ -373,7 +380,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); #define ISARAM_END RAM_END if (phys == 0) panic("isa_dmacheck: no physical page present"); -- cgit v1.1