PERFORCE change 117912 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Wed Apr 11 18:33:56 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=117912

Change 117912 by gonzo at gonzo_jeeves on 2007/04/11 18:32:59

	o Do not mess with sp in trapframe. Save it as-is.
	    Otherwise ddb failes to unwind call stack.

Affected files ...

.. //depot/projects/mips2/src/sys/mips/mips/exception.S#22 edit

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/exception.S#22 (text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#21 $
+ * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#22 $
  */
 
 /*	$NetBSD: mipsX_subr.S,v 1.19 2005/12/11 12:18:09 christos Exp $	*/
@@ -286,11 +286,11 @@
 LEAF(GenericException)
 	.set noat
 
-	subu	sp, sp, TF_SIZE
 	la	k0, 1f
 	j	exception_save_registers
-	move	k1, sp
+	subu	k1, sp, TF_SIZE
 1:
+	subu	sp, sp, TF_SIZE
 
 	/*
 	 * A generic exception may result in DDB being invoked.  If we
@@ -329,7 +329,6 @@
 	jal	exception_restore_registers
 	nop
 
-	addu	sp, sp, TF_SIZE
 	eret
 
 	.set at
@@ -345,11 +344,11 @@
 LEAF(KernIntr)
 	.set noat
 
-	subu	sp, sp, TF_SIZE
 	la	k0, 1f
 	j	exception_save_registers
-	move	k1, sp
+	subu	k1, sp, TF_SIZE
 1:
+	subu	sp, sp, TF_SIZE
 
 	/*
 	 * A generic exception may result in DDB being invoked.  If we
@@ -384,7 +383,6 @@
 	jal	exception_restore_registers
 	nop
 
-	addu	sp, sp, TF_SIZE
 	eret
 
 	.set at
@@ -920,13 +918,6 @@
 	sw	a0, TF_REG_MULHI(k1)
 	sw	a1, TF_REG_EPC(k1)
 
-	/*
-	 * When restore returns, TF_SIZE gets added to the SP for
-	 * return.  So in restore, we subtract TF_SIZE, which means
-	 * the value stored herein will be the value returned to.
-	 * To accomodate this, we add TF_SIZE, which makes up for the
-	 * initial subtraction for the trapframe.
-	 */
 	sw	sp, TF_REG_SP(k1)
 	sw	gp, TF_REG_GP(k1)
 
@@ -964,3 +955,4 @@
 	nop
 END(save_kdbaux)
 #endif /* DDB */
+


More information about the p4-projects mailing list