diff options
author | dillon <dillon@FreeBSD.org> | 2001-07-04 16:20:28 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-07-04 16:20:28 +0000 |
commit | e028603b7e3e4fb35cdf00aab533f3965f4a13cc (patch) | |
tree | 7420cce169451a74c5b87963467a4aeff668ed12 /sys/pc98/cbus/cbus_dma.c | |
parent | 0b028660051eb7abf4306d34e7fec0e7fde86a28 (diff) | |
download | FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.zip FreeBSD-src-e028603b7e3e4fb35cdf00aab533f3965f4a13cc.tar.gz |
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.
Diffstat (limited to 'sys/pc98/cbus/cbus_dma.c')
-rw-r--r-- | sys/pc98/cbus/cbus_dma.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/pc98/cbus/cbus_dma.c b/sys/pc98/cbus/cbus_dma.c index 5af3005..b1379f8 100644 --- a/sys/pc98/cbus/cbus_dma.c +++ b/sys/pc98/cbus/cbus_dma.c @@ -249,6 +249,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"); @@ -287,12 +289,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); @@ -438,11 +435,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); #ifdef EPSON_BOUNCEDMA #define ISARAM_END 0xf00000 #else |