Fixed bug that caused page tables to be faulted twice instead of once.

Submitted by:	John Dyson
This commit is contained in:
David Greenman 1995-07-14 09:25:51 +00:00
parent 2c9d7bb779
commit 4a67eb7121
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9524
3 changed files with 21 additions and 12 deletions

View File

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

View File

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

View File

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