Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/alpha In pmap_physpage_alloc() and pmap_physp...



details:   https://anonhg.NetBSD.org/src/rev/fc8fd4874aa4
branches:  trunk
changeset: 543364:fc8fd4874aa4
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Sun Feb 23 22:41:24 2003 +0000

description:
In pmap_physpage_alloc() and pmap_physpage_free(): only the DIAGNOSTIC
check is inside the simple_lock()/simple_unlock() pair, so move the locks
inside the #ifdef as well.

Additionally, change the #ifdef from DIAGNOSTIC to DEBUG; the condition
is too weird to be worth checking at DIAGNOSTIC, according ot Jason.

diffstat:

 sys/arch/alpha/alpha/pmap.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (51 lines):

diff -r 7e2df4e1f851 -r fc8fd4874aa4 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sun Feb 23 22:31:17 2003 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sun Feb 23 22:41:24 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.195 2003/01/17 22:11:18 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.196 2003/02/23 22:41:24 nathanw Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -153,7 +153,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.195 2003/01/17 22:11:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.196 2003/02/23 22:41:24 nathanw Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3036,15 +3036,15 @@
        if (pg != NULL) {
                pa = VM_PAGE_TO_PHYS(pg);
 
+#ifdef DEBUG
                simple_lock(&pg->mdpage.pvh_slock);
-#ifdef DIAGNOSTIC
                if (pg->wire_count != 0) {
                        printf("pmap_physpage_alloc: page 0x%lx has "
                            "%d references\n", pa, pg->wire_count);
                        panic("pmap_physpage_alloc");
                }
+               simple_unlock(&pg->mdpage.pvh_slock);
 #endif
-               simple_unlock(&pg->mdpage.pvh_slock);
                *pap = pa;
                return (TRUE);
        }
@@ -3064,12 +3064,12 @@
        if ((pg = PHYS_TO_VM_PAGE(pa)) == NULL)
                panic("pmap_physpage_free: bogus physical page address");
 
+#ifdef DEBUG
        simple_lock(&pg->mdpage.pvh_slock);
-#ifdef DIAGNOSTIC
        if (pg->wire_count != 0)
                panic("pmap_physpage_free: page still has references");
+       simple_unlock(&pg->mdpage.pvh_slock);
 #endif
-       simple_unlock(&pg->mdpage.pvh_slock);
 
        uvm_pagefree(pg);
 }



Home | Main Index | Thread Index | Old Index