From fa53886b69c9fe56dbd2815019fa0de740c21601 Mon Sep 17 00:00:00 2001 From: ragge Date: Sun, 27 Aug 2000 14:14:50 +0000 Subject: [PATCH] Wiring of a page were done at the wrong place, so pages in kernel space never got the wired bit set. This caused panics if a swapped out process was swapped in again and the kernel stack had not yet been unmapped. While here, add a forgotten lock initializer. --- sys/arch/vax/vax/pmap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index ae6760e3fde9..f5c2600ea6ec 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.86 2000/08/08 19:06:52 ragge Exp $ */ +/* $NetBSD: pmap.c,v 1.87 2000/08/27 14:14:50 ragge Exp $ */ /* * Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -410,6 +410,7 @@ pmap_create() MALLOC(pmap, struct pmap *, sizeof(*pmap), M_VMPMAP, M_WAITOK); bzero(pmap, sizeof(struct pmap)); pmap_pinit(pmap); + simple_lock_init(&pmap->pm_lock); return(pmap); } @@ -702,8 +703,6 @@ if (startpmapdebug) newpte = (p >> VAX_PGSHIFT) | (prot & VM_PROT_WRITE ? PG_RW : PG_RO); } - if (flags & PMAP_WIRED) - newpte |= PG_W; /* * Check if a pte page must be mapped in. @@ -742,6 +741,8 @@ if (startpmapdebug) VM_PROT_READ|VM_PROT_WRITE); } } + if (flags & PMAP_WIRED) + newpte |= PG_W; oldpte = patch[i] & ~(PG_V|PG_M);