PERFORCE change 134685 for review

Olivier Houchard cognet at FreeBSD.org
Sat Feb 2 15:43:40 PST 2008


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

Change 134685 by cognet at cognet-mips on 2008/02/02 23:43:29

	Only clear the required bits from SR, instead of zeroing it, for 
	Octeon, or we will lose KX and bad things happen.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/mips/mips/exception.S#10 edit

Differences ...

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

@@ -258,6 +258,17 @@
 #define	SAVE_REG(reg, offs, base) \
 	STORE	reg, STAND_ARG_SIZE + (RSIZE * offs) (base)
 
+#ifdef TARGET_OCTEON
+#define CLEAR_STATUS \
+	mfc0    a0, COP_0_STATUS_REG    ;\
+        li      a2, ~(SR_INT_ENAB | SR_EXL | SR_KSU_MASK) ;\
+        and     a0, a0, a2              ;\
+        mtc0    a0, COP_0_STATUS_REG    
+#else
+#define CLEAR_STATUS \
+	mtc0	zero, COP_0_STATUS_REG
+#endif
+
 #define	SAVE_CPU \
 	SAVE_REG(AT, AST, sp)		;\
 	SAVE_REG(v0, V0, sp)		;\
@@ -293,7 +304,7 @@
 	addu	v0, sp, KERN_EXC_FRAME_SIZE ;\
 	SAVE_REG(v0, SP, sp)		;\
 	addu	a0, sp, STAND_ARG_SIZE	;\
-	mtc0	zero,COP_0_STATUS_REG	;\
+	CLEAR_STATUS			;\
 	ITLBNOPFIX
 
 #ifdef DDB


More information about the p4-projects mailing list