From owner-p4-projects@FreeBSD.ORG Fri Mar 16 20:35:08 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1901C16A402; Fri, 16 Mar 2007 20:35:08 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD31816A407 for ; Fri, 16 Mar 2007 20:35:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id BAA8313C46E for ; Fri, 16 Mar 2007 20:35:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l2GKZ7f5006228 for ; Fri, 16 Mar 2007 20:35:07 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l2GKZ7Bh006225 for perforce@freebsd.org; Fri, 16 Mar 2007 20:35:07 GMT (envelope-from gonzo@FreeBSD.org) Date: Fri, 16 Mar 2007 20:35:07 GMT Message-Id: <200703162035.l2GKZ7Bh006225@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko To: Perforce Change Reviews Cc: Subject: PERFORCE change 116001 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2007 20:35:08 -0000 http://perforce.freebsd.org/chv.cgi?CH=116001 Change 116001 by gonzo@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