PERFORCE change 81824 for review

Juli Mallett jmallett at FreeBSD.org
Thu Aug 11 07:37:04 GMT 2005


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

Change 81824 by jmallett at jmallett_beach on 2005/08/11 07:36:01

	Random thought, keep k0 and k1 from being trashed by exception
	nonserialization, but I can't remember if that can actually happen.

Affected files ...

.. //depot/projects/mips/sys/mips/mips/exception.S#31 edit

Differences ...

==== //depot/projects/mips/sys/mips/mips/exception.S#31 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2003-2004 Juli Mallett <jmallett at FreeBSD.org>
+ * Copyright (c) 2003-2005 Juli Mallett <jmallett at FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $P4: //depot/projects/mips/sys/mips/mips/exception.S#30 $
+ * $P4: //depot/projects/mips/sys/mips/mips/exception.S#31 $
  */
 
 #include "opt_ddb.h"
@@ -92,6 +92,13 @@
  */
 LEAF(ExceptionVector)
 	.set noat
+	/*
+	 * Save k0 and k1.
+	 */
+	dsubu	sp, sp, 16
+	sd	k0, 0(sp)
+	sd	k1, 8(sp)
+
 	mfc0	k0, MIPS_COP_0_CAUSE
 	and	k0, MIPS_CR_EXC_CODE
 	dsrl	k0, MIPS_CR_EXC_CODE_SHIFT
@@ -168,6 +175,14 @@
 	jal	exception_restore_registers
 	nop
 	daddu	sp, sp, TF_SIZE
+
+	/*
+	 * Also need to restore k0 and k1.
+	 */
+	ld	k0, 0(sp)
+	ld	k1, 8(sp)
+	daddu	sp, sp, 16
+
 	eret
 	.set at
 END(GenericException)
@@ -236,9 +251,23 @@
 	bltz	k0, 1f
 	nop
 
+	/*
+	 * Also need to restore k0 and k1.
+	 */
+	ld	k0, 0(sp)
+	ld	k1, 8(sp)
+	daddu	sp, sp, 16
+
 	tlbwi
 	eret
 1:
+	/*
+	 * Also need to restore k0 and k1.
+	 */
+	ld	k0, 0(sp)
+	ld	k1, 8(sp)
+	daddu	sp, sp, 16
+
 	tlbwr
 	eret
 	.set at
@@ -254,6 +283,14 @@
 	dsll	k0, 4
 	cache	(CACHE_R4K_SD | CACHEOP_R4K_HIT_WB_INV), 0(k0)
 	cache	(CACHE_R4K_D | CACHEOP_R4K_HIT_INV), 0(k0)
+
+	/*
+	 * Also need to restore k0 and k1.
+	 */
+	ld	k0, 0(sp)
+	ld	k1, 8(sp)
+	daddu	sp, sp, 16
+
 	eret
 	.set at
 END(VCED)


More information about the p4-projects mailing list