Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/arch/powerpc/powerpc Pull up revision 1.104 (reques...



details:   https://anonhg.NetBSD.org/src/rev/8994745112af
branches:  netbsd-2-0
changeset: 564645:8994745112af
user:      jdc <jdc%NetBSD.org@localhost>
date:      Fri Jan 07 12:33:34 2005 +0000

description:
Pull up revision 1.104 (requested by matt in ticket #985).

Make sure to do setenv/unsetenv in pairs.  This prevents panics in
DIAGNOSTIC kernel when crossing segment boundaries.

diffstat:

 sys/arch/powerpc/powerpc/trap.c |  20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diffs (86 lines):

diff -r 8a2dc1781db0 -r 8994745112af sys/arch/powerpc/powerpc/trap.c
--- a/sys/arch/powerpc/powerpc/trap.c   Fri Jan 07 12:16:04 2005 +0000
+++ b/sys/arch/powerpc/powerpc/trap.c   Fri Jan 07 12:33:34 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.99 2004/03/25 18:50:50 matt Exp $   */
+/*     $NetBSD: trap.c,v 1.99.2.1 2005/01/07 12:33:34 jdc Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.99 2004/03/25 18:50:50 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.99.2.1 2005/01/07 12:33:34 jdc Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -574,10 +574,10 @@
                uva += seglen;
                kp += seglen;
                len -= seglen;
+               unsetusr();
        }
 
   out:
-       unsetusr();
        curpcb->pcb_onfault = 0;
        return rv;
 }
@@ -602,10 +602,10 @@
                uva += seglen;
                kp += seglen;
                len -= seglen;
+               unsetusr();
        }
 
   out:
-       unsetusr();
        curpcb->pcb_onfault = 0;
        return rv;
 }
@@ -768,9 +768,12 @@
                len -= seglen;
                uva += seglen;
                for (; seglen-- > 0; p++) {
-                       if ((*kp++ = *(char *)p) == 0)
+                       if ((*kp++ = *(char *)p) == 0) {
+                               unsetusr();
                                goto out;
+                       }
                }
+               unsetusr();
        }
        rv = ENAMETOOLONG;
 
@@ -778,7 +781,6 @@
        if (done != NULL)
                *done = kp - (char *) kaddr;
  out2:
-       unsetusr();
        curpcb->pcb_onfault = 0;
        return rv;
 }
@@ -803,9 +805,12 @@
                len -= seglen;
                uva += seglen;
                for (; seglen-- > 0; p++) {
-                       if ((*(char *)p = *kp++) == 0)
+                       if ((*(char *)p = *kp++) == 0) {
+                               unsetusr();
                                goto out;
+                       }
                }
+               unsetusr();
        }
        rv = ENAMETOOLONG;
 
@@ -813,7 +818,6 @@
        if (done != NULL)
                *done = kp - (char *) kaddr;
  out2:
-       unsetusr();
        curpcb->pcb_onfault = 0;
        return rv;
 }



Home | Main Index | Thread Index | Old Index