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 Fix lock problems with error flow reorg.



details:   https://anonhg.NetBSD.org/src/rev/0924a4467a37
branches:  trunk
changeset: 509303:0924a4467a37
user:      ross <ross%NetBSD.org@localhost>
date:      Tue May 01 05:53:29 2001 +0000

description:
Fix lock problems with error flow reorg.

diffstat:

 sys/arch/alpha/alpha/pmap.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (76 lines):

diff -r 117b4573d96a -r 0924a4467a37 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Tue May 01 05:33:12 2001 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Tue May 01 05:53:29 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.177 2001/05/01 05:33:12 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.178 2001/05/01 05:53:29 ross Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -154,7 +154,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.177 2001/05/01 05:33:12 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.178 2001/05/01 05:53:29 ross Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1623,7 +1623,7 @@
        boolean_t isactive;
        boolean_t wired;
        long cpu_id = cpu_number();
-       int error;
+       int error = 0;
 
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_ENTER))
@@ -1682,7 +1682,7 @@
                        error = pmap_lev1map_create(pmap, cpu_id);
                        if (error) {
                                if (flags & PMAP_CANFAIL)
-                                       return (error);
+                                       goto out;
                                panic("pmap_enter: unable to create lev1map");
                        }
                }
@@ -1700,7 +1700,7 @@
                        if (error) {
                                pmap_l1pt_delref(pmap, l1pte, cpu_id);
                                if (flags & PMAP_CANFAIL)
-                                       return (error);
+                                       goto out;
                                panic("pmap_enter: unable to create L2 PT "
                                    "page");
                        }
@@ -1724,7 +1724,7 @@
                        if (error) {
                                pmap_l2pt_delref(pmap, l1pte, l2pte, cpu_id);
                                if (flags & PMAP_CANFAIL)
-                                       return (error);
+                                       goto out;
                                panic("pmap_enter: unable to create L3 PT "
                                    "page");
                        }
@@ -1829,7 +1829,7 @@
                if (error) {
                        pmap_l3pt_delref(pmap, va, pte, cpu_id);
                        if (flags & PMAP_CANFAIL)
-                               return (error);
+                               goto out;
                        panic("pmap_enter: unable to enter mapping in PV "
                            "table");
                }
@@ -1907,10 +1907,11 @@
        if (needisync)
                PMAP_SYNC_ISTREAM(pmap);
 
+out:
        PMAP_UNLOCK(pmap);
        PMAP_MAP_TO_HEAD_UNLOCK();
        
-       return 0;
+       return error;
 }
 
 /*



Home | Main Index | Thread Index | Old Index