From owner-p4-projects@FreeBSD.ORG Wed Aug 23 22:05:58 2006 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 A562316A505; Wed, 23 Aug 2006 22:05:58 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A61916A500 for ; Wed, 23 Aug 2006 22:05:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0BED43D45 for ; Wed, 23 Aug 2006 22:05:57 +0000 (GMT) (envelope-from gonzo@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7NM5vm5025493 for ; Wed, 23 Aug 2006 22:05:57 GMT (envelope-from gonzo@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7NM5vgg025490 for perforce@freebsd.org; Wed, 23 Aug 2006 22:05:57 GMT (envelope-from gonzo@FreeBSD.org) Date: Wed, 23 Aug 2006 22:05:57 GMT Message-Id: <200608232205.k7NM5vgg025490@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 104869 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: Wed, 23 Aug 2006 22:05:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=104869 Change 104869 by gonzo@gonzo_hideout on 2006/08/23 22:05:39 o Ported setjmp from NetBSD. XXX: Hardcoded softfloat. Affected files ... .. //depot/projects/mips2/src/lib/libc/mips/gen/_setjmp.S#2 edit Differences ... ==== //depot/projects/mips2/src/lib/libc/mips/gen/_setjmp.S#2 (text+ko) ==== @@ -32,11 +32,8 @@ * SUCH DAMAGE. */ -#include -#include -#include -#include -#include /* XXX */ +#include +#include #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") @@ -47,6 +44,8 @@ .abicalls #endif +#define SOFTFLOAT /* XXX */ + /* * C library -- _setjmp, _longjmp * @@ -67,20 +66,21 @@ #.set reorder #endif - REG_PROLOGUE - REG_LI v0, 0xACEDBADE # sigcontext magic number - REG_S ra, (2 * 4)(a0) # sc_pc = return address - REG_S v0, (_OFFSETOF_SC_REGS)(a0) # saved in sc_regs[0] - REG_S s0, (_R_S0 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s1, (_R_S1 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s2, (_R_S2 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s3, (_R_S3 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s4, (_R_S4 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s5, (_R_S5 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s6, (_R_S6 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s7, (_R_S7 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S sp, (_R_SP * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_S s8, (_R_S8 * SZREG + _OFFSETOF_SC_REGS)(a0) + .set push + li v0, 0xACEDBADE # sigcontext magic number + sw ra, (2 * 4)(a0) # sc_pc = return address + sw v0, (_OFFSETOF_SC_REGS)(a0) # saved in sc_regs[0] + sw s0, (S0 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s1, (S1 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s2, (S2 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s3, (S3 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s4, (S4 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s5, (S5 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s6, (S6 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s7, (S7 * SZREG + _OFFSETOF_SC_REGS)(a0) + sw sp, (SP * SZREG + _OFFSETOF_SC_REGS)(a0) + sw s8, (S8 * SZREG + _OFFSETOF_SC_REGS)(a0) +#ifndef SOFTFLOAT cfc1 v0, $31 # too bad cant check if FP used swc1 $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0) swc1 $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0) @@ -95,7 +95,8 @@ swc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) swc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) sw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) - REG_EPILOGUE +#endif + .set pop j ra move v0, zero END(_setjmp) @@ -109,23 +110,24 @@ .cprestore 16 .set noreorder #endif - REG_PROLOGUE - REG_L v0, (_OFFSETOF_SC_REGS)(a0) # get magic number - REG_L ra, (2 * 4)(a0) - REG_LI t0, 0xACEDBADE + .set push + lw v0, (_OFFSETOF_SC_REGS)(a0) # get magic number + lw ra, (2 * 4)(a0) + li t0, 0xACEDBADE bne v0, t0, botch # jump if error addu sp, sp, 32 # does not matter, sanity - REG_L s0, (_R_S0 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s1, (_R_S1 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s2, (_R_S2 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s3, (_R_S3 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s4, (_R_S4 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s5, (_R_S5 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s6, (_R_S6 * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s7, (_R_S7 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s0, (S0 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s1, (S1 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s2, (S2 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s3, (S3 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s4, (S4 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s5, (S5 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s6, (S6 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s7, (S7 * SZREG + _OFFSETOF_SC_REGS)(a0) lw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) # get fpu status - REG_L sp, (_R_SP * SZREG + _OFFSETOF_SC_REGS)(a0) - REG_L s8, (_R_S8 * SZREG + _OFFSETOF_SC_REGS)(a0) + lw sp, (SP * SZREG + _OFFSETOF_SC_REGS)(a0) + lw s8, (S8 * SZREG + _OFFSETOF_SC_REGS)(a0) +#ifndef SOFTFLOAT ctc1 v0, $31 lwc1 $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0) lwc1 $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0) @@ -139,10 +141,10 @@ lwc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) lwc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) lwc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) - +#endif j ra move v0, a1 - REG_EPILOGUE + .set pop botch: jal _C_LABEL(longjmperror) nop