PERFORCE change 116001 for review

Oleksandr Tymoshenko gonzo at FreeBSD.org
Fri Mar 16 20:35:08 UTC 2007


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

Change 116001 by gonzo at gonzo_jeeves on 2007/03/16 20:34:58

	o Interrupts are served ny their own handler - KernelIntr

Affected files ...

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

Differences ...

==== //depot/projects/mips2/src/sys/mips/mips/exception.S#19 (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#18 $
+ * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#19 $
  */
 
 /*	$NetBSD: mipsX_subr.S,v 1.19 2005/12/11 12:18:09 christos Exp $	*/
@@ -166,7 +166,7 @@
 	_VEND(x)
 
 ExceptionHandlerTable:
-	.dword	GenericException	/* Int */
+	.dword	KernIntr		/* Int */
 	.dword	GenericException	/* TLBMod */
 	.dword	TLBInvalidVector	/* TLBL */
 	.dword	TLBInvalidVector	/* TLBS */
@@ -303,33 +303,14 @@
 #endif /* DDB */
 
 	/*
-	 * If this is an interrupt, call cpu_intr() with the arguments:
-	 * trapframe
-	 *
-	 * Otherwise, go to trap().  Trapframe is set to a0 from k1 in the
-	 * BDslot here.
-	 */
-
-	mfc0	a1, MIPS_COP_0_CAUSE
-	and	k0, a1, MIPS3_CR_EXC_CODE
-	bnez	k0, 1f
-	move	a0, k1
-	mtc0	zero, MIPS_COP_0_STATUS
-
-	jal	cpu_intr
-	nop
-
-	b	2f
-	nop
 
-	/*
 	 * Call trap() with arguments:
 	 * trapframe, cause, badvaddr.
 	 *
 	 * The trapframe is copied from k1 to a0 in the BDslot above.
 	 * Cause is set up above when computing the code.
 	 */
-1:
+	move	a0, k1
 	mfc0	a1, MIPS_COP_0_CAUSE
 	mfc0	a2, MIPS_COP_0_BAD_VADDR
 	mtc0	zero, MIPS_COP_0_STATUS
@@ -337,7 +318,6 @@
 	nop
 	jal	trap
 	nop
-2:
 
 	/*
 	 * Make sure interrupts are disabled for the purposes of
@@ -358,6 +338,60 @@
 3:	.asciiz "GenericException"
 	.text
 
+/* 
+ * Kernel interrupt handler. Much similar to GenericException.
+ */
+
+LEAF(KernIntr)
+	.set noat
+
+	subu	sp, sp, TF_SIZE
+	la	k0, 1f
+	j	exception_save_registers
+	move	k1, sp
+1:
+
+	/*
+	 * A generic exception may result in DDB being invoked.  If we
+	 * are using the kernel debugger, then set up is auxillary
+	 * frame, so it has a full one.
+	 */
+#if	DDB
+	jal	save_kdbaux
+	nop
+#endif /* DDB */
+
+	/*
+	 * Call cpu_intr() with the arguments:
+	 * trapframe
+	 */
+
+	move    a0, k1
+	mtc0	zero, MIPS_COP_0_STATUS
+	COP0_SYNC
+
+	nop
+	jal	cpu_intr
+	nop
+
+	/*
+	 * Make sure interrupts are disabled for the purposes of
+	 * having a clean go at restoring.
+	 */
+	mtc0	zero, MIPS_COP_0_CAUSE
+
+	move	k1, sp
+	jal	exception_restore_registers
+	nop
+
+	addu	sp, sp, TF_SIZE
+	eret
+
+	.set at
+END(KernIntr)
+	.data
+3:	.asciiz "KernIntr"
+	.text
 
 LEAF(CacheVector)
 	.set noat


More information about the p4-projects mailing list