Merged from sys/i386/isa/isa_dma.c revision 1.7.

This commit is contained in:
Yoshihiro Takahashi 2001-06-26 11:47:24 +00:00
parent 439d7df917
commit 0d3dc5c9f0
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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