Date: Wed, 23 Aug 2006 22:05:57 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 104869 for review Message-ID: <200608232205.k7NM5vgg025490@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <machine/cdefs.h> -#include <mips/regnum.h> -#include <mips/asm.h> -#include <machine/setjmp.h> -#include <machine/signal.h> /* XXX */ +#include <machine/regnum.h> +#include <machine/asm.h> #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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608232205.k7NM5vgg025490>