diff options
author | davidxu <davidxu@FreeBSD.org> | 2002-11-08 01:09:16 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2002-11-08 01:09:16 +0000 |
commit | 9ca980d0e75354085693a9a0343428e783095374 (patch) | |
tree | 7371d1265ced859e43ffc57cbe21dd0f4836400d /sys/i386 | |
parent | f740e3df9bd1ce0fef776b6c9444176d4c64bcaa (diff) | |
download | FreeBSD-src-9ca980d0e75354085693a9a0343428e783095374.zip FreeBSD-src-9ca980d0e75354085693a9a0343428e783095374.tar.gz |
use critical_enter/exit to add a critical section around BIOS call,
this unbreaks WITNESS.
Pointed out by: jhb
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/vm86.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/i386/i386/vm86.c b/sys/i386/i386/vm86.c index 0b79669..3ca104d 100644 --- a/sys/i386/i386/vm86.c +++ b/sys/i386/i386/vm86.c @@ -425,7 +425,7 @@ vm86_initialize(void) pcb = &vml->vml_pcb; ext = &vml->vml_ext; - mtx_init(&vm86_lock, "vm86 lock", NULL, MTX_SPIN); + mtx_init(&vm86_lock, "vm86 lock", NULL, MTX_DEF); bzero(pcb, sizeof(struct pcb)); pcb->new_ptd = vm86pa | PG_V | PG_RW | PG_U; @@ -578,9 +578,11 @@ vm86_intcall(int intnum, struct vm86frame *vmf) return (EINVAL); vmf->vmf_trapno = intnum; - mtx_lock_spin(&vm86_lock); + mtx_lock(&vm86_lock); + critical_enter(); retval = vm86_bioscall(vmf); - mtx_unlock_spin(&vm86_lock); + critical_exit(); + mtx_unlock(&vm86_lock); return (retval); } @@ -600,7 +602,8 @@ vm86_datacall(intnum, vmf, vmc) u_int page; int i, entry, retval; - mtx_lock_spin(&vm86_lock); + mtx_lock(&vm86_lock); + critical_enter(); for (i = 0; i < vmc->npages; i++) { page = vtophys(vmc->pmap[i].kva & PG_FRAME); entry = vmc->pmap[i].pte_num; @@ -617,7 +620,8 @@ vm86_datacall(intnum, vmf, vmc) pte[entry] = vmc->pmap[i].old_pte; pmap_invalidate_page(kernel_pmap, vmc->pmap[i].kva); } - mtx_unlock_spin(&vm86_lock); + critical_exit(); + mtx_unlock(&vm86_lock); return (retval); } |