Module Name:    src
Committed By:   matt
Date:           Sun Mar  9 22:31:25 UTC 2014

Modified Files:
        src/sys/arch/powerpc/include: userret.h
        src/sys/arch/powerpc/powerpc: process_machdep.c

Log Message:
Don't test for PSL_SE in tf_srr1 since will be cleared on the next exception.
Keep a copy of it in l_md.md_flags which will be preserved.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/powerpc/include/userret.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/powerpc/powerpc/process_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.24 src/sys/arch/powerpc/include/userret.h:1.25
--- src/sys/arch/powerpc/include/userret.h:1.24	Sat May 26 00:31:07 2012
+++ src/sys/arch/powerpc/include/userret.h	Sun Mar  9 22:31:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.24 2012/05/26 00:31:07 matt Exp $	*/
+/*	$NetBSD: userret.h,v 1.25 2014/03/09 22:31:25 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -74,12 +74,12 @@ userret(struct lwp *l, struct trapframe 
 #endif
 #ifdef PPC_BOOKE
 	/*
-	 * BookE doesn't PSL_SE but it does have a debug instruction completion
-	 * exception but it needs PSL_DE to fire.  Since we don't want it to
-	 * happen in the kernel, we must disable PSL_DE and let it get
-	 * restored by rfi/rfci.
+	 * BookE doesn't have PSL_SE but it does have a debug instruction
+	 * completion exception but it needs PSL_DE to fire.  Since we don't
+	 * want it to happen in the kernel, we must disable PSL_DE and let
+	 * it get restored by rfi/rfci.
 	 */
-	if (__predict_false(tf->tf_srr1 & PSL_SE)) {
+	if (__predict_false(l->l_md.md_flags & PSL_SE)) {
 		extern void booke_sstep(struct trapframe *); /* ugly */
 		booke_sstep(tf);
 	}

Index: src/sys/arch/powerpc/powerpc/process_machdep.c
diff -u src/sys/arch/powerpc/powerpc/process_machdep.c:1.36 src/sys/arch/powerpc/powerpc/process_machdep.c:1.37
--- src/sys/arch/powerpc/powerpc/process_machdep.c:1.36	Sat Jan  4 00:10:03 2014
+++ src/sys/arch/powerpc/powerpc/process_machdep.c	Sun Mar  9 22:31:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.36 2014/01/04 00:10:03 dsl Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.37 2014/03/09 22:31:25 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.36 2014/01/04 00:10:03 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.37 2014/03/09 22:31:25 matt Exp $");
 
 #include "opt_altivec.h"
 
@@ -137,10 +137,13 @@ process_sstep(struct lwp *l, int sstep)
 {
 	struct trapframe * const tf = l->l_md.md_utf;
 	
-	if (sstep)
+	if (sstep) {
 		tf->tf_srr1 |= PSL_SE;
-	else
+		l->l_md.md_flags |= PSL_SE;
+	} else {
 		tf->tf_srr1 &= ~PSL_SE;
+		l->l_md.md_flags &= ~PSL_SE;
+	}
 	return 0;
 }
 

Reply via email to