From a6359b2633446cd962e7b779ce943ec4cdb85b3f Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 5 Oct 1995 06:47:25 +0000 Subject: [PATCH] Fix segment table reference bug, from Micheal Hitch. --- sys/arch/hp300/hp300/pmap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/arch/hp300/hp300/pmap.c b/sys/arch/hp300/hp300/pmap.c index 071f08df16fc..b593a0b14f16 100644 --- a/sys/arch/hp300/hp300/pmap.c +++ b/sys/arch/hp300/hp300/pmap.c @@ -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 @@ -2509,6 +2509,11 @@ pmap_enter_ptpage(pmap, va) * letting the VM system allocate a zero-filled page. */ 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 if (pmapdebug & (PDB_ENTER|PDB_PTPAGE)) printf("enter: about to fault UPT pg at %x\n", va); @@ -2593,7 +2598,6 @@ pmap_enter_ptpage(pmap, va) #endif *ste = (ptpa & SG_FRAME) | SG_RW | SG_V; if (pmap != pmap_kernel()) { - pmap->pm_sref++; #ifdef DEBUG if (pmapdebug & (PDB_ENTER|PDB_PTPAGE|PDB_SEGTAB)) printf("enter: stab %x refcnt %d\n",