diff options
author | dg <dg@FreeBSD.org> | 1995-07-14 09:25:51 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-07-14 09:25:51 +0000 |
commit | 8ade9fe5893b75c6ef541cb04db14fbbb70cf60b (patch) | |
tree | c551d8c5e4f077f2dde6a8c935ca2bea2e9bdc12 /sys/i386 | |
parent | 270b119bead6b79320271a8d9d65a644b05f24fc (diff) | |
download | FreeBSD-src-8ade9fe5893b75c6ef541cb04db14fbbb70cf60b.zip FreeBSD-src-8ade9fe5893b75c6ef541cb04db14fbbb70cf60b.tar.gz |
Fixed bug that caused page tables to be faulted twice instead of once.
Submitted by: John Dyson
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/trap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index 997b2f2..7731ebb 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.52.2.1 1995/06/05 00:22:04 davidg Exp $ + * $Id: trap.c,v 1.53 1995/06/11 19:31:14 rgrimes Exp $ */ /* @@ -464,7 +464,8 @@ trap_pfault(frame, usermode) v = (vm_offset_t) vtopte(va); /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + if (*((int *)vtopte(v)) == 0) + (void) vm_fault(map, v, VM_PROT_WRITE, FALSE); pmap_use_pt( vm_map_pmap(map), va); @@ -553,7 +554,7 @@ trap_pfault(frame, usermode) ftype = VM_PROT_READ; if (map != kernel_map) { - vm_offset_t v = (vm_offset_t) vtopte(va); + vm_offset_t v; vm_page_t ptepg; /* @@ -578,9 +579,11 @@ trap_pfault(frame, usermode) * Check if page table is mapped, if not, * fault it first */ + v = (vm_offset_t) vtopte(va); /* Fault the pte only if needed: */ - *(volatile char *)v += 0; + if (*((int *)vtopte(v)) == 0) + (void) vm_fault(map, v, VM_PROT_WRITE, FALSE); pmap_use_pt( vm_map_pmap(map), va); |