From owner-p4-projects@FreeBSD.ORG Sun Nov 4 22:08:28 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 021CA16A41A; Sun, 4 Nov 2007 22:08:28 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DAA016A417 for ; Sun, 4 Nov 2007 22:08:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB7B13C4A3 for ; Sun, 4 Nov 2007 22:08:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lA4M8QBP082041 for ; Sun, 4 Nov 2007 22:08:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lA4M8Qcu082038 for perforce@freebsd.org; Sun, 4 Nov 2007 22:08:26 GMT (envelope-from gonzo@FreeBSD.org) Date: Sun, 4 Nov 2007 22:08:26 GMT Message-Id: <200711042208.lA4M8Qcu082038@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 128634 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: Sun, 04 Nov 2007 22:08:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=128634 Change 128634 by gonzo@gonzo_jeeves on 2007/11/04 22:07:25 o Add 16 bytes to default stackframe of GenericException, Intr, UserGenericException, UserIntr. These functions are non-leaves, so sizeof(register) * MAX(max_args, 4) bytes should be reserved as a placeholders for arguments. max_args is the maximum number of arguments through all functions that are called from non-leaf routine. Affected files ... .. //depot/projects/mips2/src/sys/mips/mips/exception.S#26 edit .. //depot/projects/mips2/src/sys/mips/mips/locore.S#19 edit Differences ... ==== //depot/projects/mips2/src/sys/mips/mips/exception.S#26 (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#25 $ + * $P4: //depot/projects/mips2/src/sys/mips/mips/exception.S#26 $ */ /* $NetBSD: mipsX_subr.S,v 1.19 2005/12/11 12:18:09 christos Exp $ */ @@ -283,14 +283,15 @@ /* fall through to GenericEception */ .set at -LEAF(GenericException) +NESTED(GenericException, TF_SIZE + 16, ra) .set noat + .set noreorder la k0, 1f j exception_save_registers subu k1, sp, TF_SIZE 1: - subu sp, sp, TF_SIZE + subu sp, sp, TF_SIZE + 16 /* * A generic exception may result in DDB being invoked. If we @@ -303,7 +304,6 @@ #endif /* DDB */ /* - * Call trap() with arguments: * trapframe, cause, badvaddr. * @@ -325,7 +325,7 @@ */ mtc0 zero, MIPS_COP_0_CAUSE - move k1, sp + addu k1, sp, 16 jal exception_restore_registers nop @@ -343,12 +343,13 @@ LEAF(KernIntr) .set noat + .set noreorder la k0, 1f j exception_save_registers subu k1, sp, TF_SIZE 1: - subu sp, sp, TF_SIZE + subu sp, sp, TF_SIZE + 16 /* * A generic exception may result in DDB being invoked. If we @@ -379,7 +380,7 @@ */ mtc0 zero, MIPS_COP_0_CAUSE - move k1, sp + addu k1, sp, 16 jal exception_restore_registers nop @@ -654,7 +655,7 @@ /* * Handle trap from userspace (VM-related, syscall, etc..) */ -NESTED(UserGenericException, TF_SIZE, ra) +NESTED(UserGenericException, 16, ra) .set noat .set noreorder .mask 0x80000000, -4 @@ -666,7 +667,9 @@ nop 1: move a0, k1 # For following trap call - addu sp, k1, -TF_SIZE # Switch to kernel's stack + subu sp, k1, 16 # Switch to kernel's stack, + # keep 16 bytes as + # placefholders for a0..a3 ### ### Fill out trap arcguments and call it @@ -702,7 +705,7 @@ ### ### Restore regiters and bail out ### - addu sp, sp, TF_SIZE ## Restore pointer to saved + addu sp, sp, 16 ## Restore pointer to saved ## registers move k1, sp jal exception_restore_registers @@ -717,7 +720,7 @@ /* * Handle interrupt from userspace */ -NESTED(UserIntr, TF_SIZE, ra) +NESTED(UserIntr, 16, ra) .set noat .set noreorder .mask 0x80000000, -4 @@ -729,7 +732,9 @@ nop 1: move a0, k1 # For following trap call - addu sp, k1, -TF_SIZE # Switch to kernel's stack + subu sp, k1, 16 # Switch to kernel's stack, + # keep 16 bytes as + # placefholders for a0..a3 mfc0 t0, MIPS_COP_0_STATUS .set at ==== //depot/projects/mips2/src/sys/mips/mips/locore.S#19 (text+ko) ==== @@ -50,9 +50,8 @@ GLOBAL(stackspace) .space PAGE_SIZE /* Smaller than it should be since it's temp. */ -.align 8 + .align 8 GLOBAL(topstack) - .set noreorder .text @@ -110,6 +109,7 @@ * Set up our temporary stack. */ la sp, topstack + subu sp, sp, 16 /* Placeholders for a0..a3 */ #ifdef YAMON /* @@ -149,9 +149,7 @@ li v0, SYS_sigreturn syscall break 0 +esigcode: -esigcode: - .data - .global szsigcode -szsigcode: - .long esigcode-sigcode +GLOBAL(szsigcode) + .long esigcode - sigcode