Fix segment table reference bug, from Micheal Hitch.

This commit is contained in:
thorpej 1995-10-05 06:47:25 +00:00
parent d3f03a8c0c
commit a6359b2633
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.20 1995/05/29 19:36:22 hpeyerl Exp $ */ /* $NetBSD: pmap.c,v 1.21 1995/10/05 06:47:25 thorpej Exp $ */
/* /*
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -2509,6 +2509,11 @@ pmap_enter_ptpage(pmap, va)
* letting the VM system allocate a zero-filled page. * letting the VM system allocate a zero-filled page.
*/ */
else { else {
/*
* Count the segment table reference now so that we won't
* lose the segment table when low on memory.
*/
pmap->pm_sref++;
#ifdef DEBUG #ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) if (pmapdebug & (PDB_ENTER|PDB_PTPAGE))
printf("enter: about to fault UPT pg at %x\n", va); printf("enter: about to fault UPT pg at %x\n", va);
@ -2593,7 +2598,6 @@ pmap_enter_ptpage(pmap, va)
#endif #endif
*ste = (ptpa & SG_FRAME) | SG_RW | SG_V; *ste = (ptpa & SG_FRAME) | SG_RW | SG_V;
if (pmap != pmap_kernel()) { if (pmap != pmap_kernel()) {
pmap->pm_sref++;
#ifdef DEBUG #ifdef DEBUG
if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB)) if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB))
printf("enter: stab %x refcnt %d\n", printf("enter: stab %x refcnt %d\n",