==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/Makefile.inc#1 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/Makefile.inc ==== @@ -1,8 +1,8 @@ -# $NetBSD: Makefile.inc,v 1.27 2005/10/07 17:16:40 tsutsui Exp $ +# $OpenBSD: Makefile.inc,v 1.4 1995/12/15 01:12:36 jonathan Exp $ -SRCS+= infinity.c fabs.S ldexp.S modf.S - -# SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ -# fpsetround.c fpsetsticky.c - -SRCS+= _set_tp.c _setjmp.S makecontext.c setjmp.S signalcontext.c sigsetjmp.S +SRCS+= _set_tp.c +SRCS+= _setjmp.S fabs.S frexp.c infinity.c isinf.S ldexp.S modf.S +SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ + fpsetround.c fpsetsticky.c +SRCS+= setjmp.S sigsetjmp.S +# SRCS+= byte_swap_2.S byte_swap_4.S ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/_setjmp.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/_setjmp.S ==== @@ -1,5 +1,3 @@ -/* $NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $ */ - /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -15,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -35,14 +33,22 @@ #include #include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: _setjmp.S,v 1.20 2005/10/07 17:16:40 tsutsui Exp $") -#endif /* LIBC_SCCS and not lint */ +#if defined(LIBC_SCCS) + .text + //.asciz "$OpenBSD: _setjmp.S,v 1.5 1996/08/19 08:15:51 tholo Exp $" + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ + +/* These defs must be consistent with ucontext_t. We really ought to employ + * something like genassym here, but... + */ -#ifdef __ABICALLS__ - .abicalls -#endif +#define UC_SIGMASK 0x00 /* offsetof(ucontext_t, uc_sigmask) */ +#define UC_ONSTACK 0x10 /* offsetof(ucontext_t, uc_mcontext.mc_onstack) */ +#define UC_PC 0x14 /* offsetof(ucontext_t, uc_mcontext.mc_pc) */ +#define UC_REGS 0x18 /* offsetof(ucontext_t, uc_mcontext.mc_regs) */ +#define UC_FPUSED 0xa0 /* offsetof(ucontext_t, uc_mcontext.mc_fpused) */ +#define UC_FPREGS 0xa4 /* offsetof(ucontext_t, uc_mcontext.mc_fpregs) */ /* * C library -- _setjmp, _longjmp @@ -55,55 +61,81 @@ * The previous signal state is NOT restored. */ - LEAF(_setjmp) -#ifdef __ABICALLS__ .set noreorder - .cpload t9 - .cprestore 16 -#endif - li v0, _JB_MAGIC__SETJMP - sw v0, (_JB_MAGIC * SZREG)(a0) - sw ra, (_JB_REG_RA * SZREG)(a0) - sw s0, (_JB_REG_S0 * SZREG)(a0) - sw s1, (_JB_REG_S1 * SZREG)(a0) - sw s2, (_JB_REG_S2 * SZREG)(a0) - sw s3, (_JB_REG_S3 * SZREG)(a0) - sw s4, (_JB_REG_S4 * SZREG)(a0) - sw s5, (_JB_REG_S5 * SZREG)(a0) - sw s6, (_JB_REG_S6 * SZREG)(a0) - sw s7, (_JB_REG_S7 * SZREG)(a0) - sw sp, (_JB_REG_SP * SZREG)(a0) - sw s8, (_JB_REG_S8 * SZREG)(a0) - + li v0, 0xACEDBADE # sigcontext magic number + sw ra, UC_PC(a0) # sc_pc = return address + sw v0, (ZERO * 4) + UC_REGS (a0) # saved in sc_regs[0] + sw s0, (S0 * 4) + UC_REGS (a0) + sw s1, (S1 * 4) + UC_REGS (a0) + sw s2, (S2 * 4) + UC_REGS (a0) + sw s3, (S3 * 4) + UC_REGS (a0) + sw s4, (S4 * 4) + UC_REGS (a0) + sw s5, (S5 * 4) + UC_REGS (a0) + sw s6, (S6 * 4) + UC_REGS (a0) + sw s7, (S7 * 4) + UC_REGS (a0) + sw s8, (S8 * 4) + UC_REGS (a0) + sw sp, (SP * 4) + UC_REGS (a0) +#ifndef SOFTFLOAT + cfc1 v0, $31 # too bad cant check if FP used + swc1 $f20, (F20_NUM * 4) + UC_FPREGS (a0) + swc1 $f21, (F21_NUM * 4) + UC_FPREGS (a0) + swc1 $f22, (F22_NUM * 4) + UC_FPREGS (a0) + swc1 $f23, (F23_NUM * 4) + UC_FPREGS (a0) + swc1 $f24, (F24_NUM * 4) + UC_FPREGS (a0) + swc1 $f25, (F25_NUM * 4) + UC_FPREGS (a0) + swc1 $f26, (F26_NUM * 4) + UC_FPREGS (a0) + swc1 $f27, (F27_NUM * 4) + UC_FPREGS (a0) + swc1 $f28, (F28_NUM * 4) + UC_FPREGS (a0) + swc1 $f29, (F29_NUM * 4) + UC_FPREGS (a0) + swc1 $f30, (F30_NUM * 4) + UC_FPREGS (a0) + swc1 $f31, (F31_NUM * 4) + UC_FPREGS (a0) + sw v0, (FSR_NUM * 4) + UC_FPREGS (a0) +#endif /*SOFTFLOAT */ j ra move v0, zero END(_setjmp) LEAF(_longjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 +#ifdef ABICALLS + subu sp, sp, 32 .cprestore 16 -#endif - lw v0, (_JB_MAGIC * SZREG)(a0) - lw ra, (_JB_REG_RA * SZREG)(a0) - li t0, _JB_MAGIC__SETJMP - bne v0, t0, botch # jump if error - lw s0, (_JB_REG_S0 * SZREG)(a0) - lw s1, (_JB_REG_S1 * SZREG)(a0) - lw s2, (_JB_REG_S2 * SZREG)(a0) - lw s3, (_JB_REG_S3 * SZREG)(a0) - lw s4, (_JB_REG_S4 * SZREG)(a0) - lw s5, (_JB_REG_S5 * SZREG)(a0) - lw s6, (_JB_REG_S6 * SZREG)(a0) - lw s7, (_JB_REG_S7 * SZREG)(a0) - lw sp, (_JB_REG_SP * SZREG)(a0) - lw s8, (_JB_REG_S8 * SZREG)(a0) +#endif + .set noreorder + lw v0, (ZERO * 4) + UC_REGS (a0) # get magic number + lw ra, UC_PC (a0) + bne v0, 0xACEDBADE, botch # jump if error + + addu sp, sp, 32 # does not matter, sanity + lw s0, (S0 * 4) + UC_REGS (a0) + lw s1, (S1 * 4) + UC_REGS (a0) + lw s2, (S2 * 4) + UC_REGS (a0) + lw s3, (S3 * 4) + UC_REGS (a0) + lw s4, (S4 * 4) + UC_REGS (a0) + lw s5, (S5 * 4) + UC_REGS (a0) + lw s6, (S6 * 4) + UC_REGS (a0) + lw s7, (S7 * 4) + UC_REGS (a0) + lw v0, (FSR_NUM * 4) + UC_FPREGS (a0) # get fpu status + lw sp, (SP * 4) + UC_REGS (a0) + lw s8, (S8 * 4) + UC_REGS (a0) +#ifndef SOFTFLOAT + ctc1 v0, $31 + lwc1 $f20, (F20_NUM * 4) + UC_FPREGS (a0) + lwc1 $f21, (F21_NUM * 4) + UC_FPREGS (a0) + lwc1 $f22, (F22_NUM * 4) + UC_FPREGS (a0) + lwc1 $f23, (F23_NUM * 4) + UC_FPREGS (a0) + lwc1 $f24, (F24_NUM * 4) + UC_FPREGS (a0) + lwc1 $f25, (F25_NUM * 4) + UC_FPREGS (a0) + lwc1 $f26, (F26_NUM * 4) + UC_FPREGS (a0) + lwc1 $f27, (F27_NUM * 4) + UC_FPREGS (a0) + lwc1 $f28, (F28_NUM * 4) + UC_FPREGS (a0) + lwc1 $f29, (F29_NUM * 4) + UC_FPREGS (a0) + lwc1 $f30, (F30_NUM * 4) + UC_FPREGS (a0) + lwc1 $f31, (F31_NUM * 4) + UC_FPREGS (a0) +#endif /* SOFTFLOAT */ j ra move v0, a1 - botch: jal _C_LABEL(longjmperror) nop ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/fabs.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/fabs.S ==== @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,16 +34,10 @@ #include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)fabs.s 8.1 (Berkeley) 2/16/94") - ASMSTR("$NetBSD: fabs.S,v 1.7 2003/08/07 16:42:15 agc Exp $") -#endif /* LIBC_SCCS and not lint */ - - -#ifdef __ABICALLS__ - .abicalls -#endif - .set noreorder +#if defined(LIBC_SCCS) + .text + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ /* * fabs(x) ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/ldexp.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/ldexp.S ==== @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,14 +34,10 @@ #include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)ldexp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: ldexp.S,v 1.8 2003/08/07 16:42:15 agc Exp $") -#endif /* LIBC_SCCS and not lint */ - -#ifdef __ABICALLS__ - .abicalls -#endif +#if defined(LIBC_SCCS) + .text + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ #define DEXP_INF 0x7ff #define DEXP_BIAS 1023 @@ -49,7 +45,7 @@ #define DEXP_MAX 1023 #define DFRAC_BITS 52 #define DIMPL_ONE 0x00100000 -#define DLEAD_ZEROS 31 - 20 +#define DLEAD_ZEROS (31 - 20) #define STICKYBIT 1 #define GUARDBIT 0x80000000 #define DSIGNAL_NAN 0x00040000 @@ -205,7 +201,7 @@ j ra 8: li t1, 0x7ff00000 # result is infinity (MSW) - mtc1 t1, $f1 + mtc1 t1, $f1 mtc1 zero, $f0 # result is infinity (LSW) bge v1, zero, 1f # should result be negative infinity? neg.d $f0, $f0 # result is negative infinity ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/modf.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/modf.S ==== @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,14 +34,10 @@ #include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)modf.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: modf.S,v 1.10 2003/08/07 16:42:15 agc Exp $") -#endif /* LIBC_SCCS and not lint */ - -#ifdef __ABICALLS__ - .abicalls -#endif +#if defined(LIBC_SCCS) + .text + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ /* * double modf(val, iptr) @@ -63,17 +59,17 @@ mov.d $f0, $f12 # f0 <- f12 abs.d $f4, $f12 # f4 <- |f12| - c.olt.d $f4, $f2 # f4 ? < f2 - bc1f 1f # leave f0 alone if Nan, infinity + c.olt.d $f4, $f2 # f4 ? < f2 + bc1f 1f # leave f0 alone if Nan, infinity # or >=2^52 c.eq.d $f12,$f4 # was f12 positive ? add.d $f4,$f2,$f4 # round off to integer bc1f 2f # No -> will have to negate result sub.d $f0,$f4,$f2 # Remove fudge factor j 1f # integer fraction got -2: +2: sub.d $f0,$f2,$f4 # Remove fudge factor and negate -1: +1: ctc1 t0, $31 # restore old rounding mode s.d $f0, 0(a2) # save the integer part sub.d $f0, $f12, $f0 # subtract val - integer part ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/setjmp.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/setjmp.S ==== @@ -1,5 +1,3 @@ -/* $NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $ */ - /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -15,7 +13,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -32,17 +34,26 @@ * SUCH DAMAGE. */ +#include +#include #include -#include + +#if defined(LIBC_SCCS) + .text + //.asciz "$OpenBSD: setjmp.S,v 1.6 1997/07/23 20:55:25 kstailey Exp $" + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $") -#endif /* LIBC_SCCS and not lint */ +/* These defs must be consistent with ucontext_t. We really ought to employ + * something like genassym here, but... + */ -#ifdef __ABICALLS__ - .abicalls -#endif +#define UC_SIGMASK 0x00 /* offsetof(ucontext_t, uc_sigmask) */ +#define UC_ONSTACK 0x10 /* offsetof(ucontext_t, uc_mcontext.mc_onstack) */ +#define UC_PC 0x14 /* offsetof(ucontext_t, uc_mcontext.mc_pc) */ +#define UC_REGS 0x18 /* offsetof(ucontext_t, uc_mcontext.mc_regs) */ +#define UC_FPUSED 0xa0 /* offsetof(ucontext_t, uc_mcontext.mc_fpused) */ +#define UC_FPREGS 0xa4 /* offsetof(ucontext_t, uc_mcontext.mc_fpregs) */ /* * C library -- setjmp, longjmp @@ -55,105 +66,82 @@ * and a struct sigcontext, see */ -#define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + SZREG) +#define SETJMP_FRAME_SIZE (STAND_FRAME_SIZE + 12) - -NESTED(setjmp, SETJMP_FRAME_SIZE, ra) - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - .set noreorder -#ifdef __ABICALLS__ - .cpload t9 -#endif +NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) + .mask 0x80000000, (STAND_RA_OFFSET - STAND_FRAME_SIZE) subu sp, sp, SETJMP_FRAME_SIZE # allocate stack frame -#ifdef __ABICALLS__ +#ifdef ABICALLS .cprestore 16 #endif - sw ra, CALLFRAME_RA(sp) # save RA - sw a0, CALLFRAME_SIZ(sp) # store env + .set reorder + sw ra, STAND_RA_OFFSET(sp) # save state + sw a0, SETJMP_FRAME_SIZE(sp) + + move a1, zero # Make new sigset_t NULL + la a2, UC_SIGMASK(a0) # Get address of ucontext_t->uc_sigmask + jal _C_LABEL(sigprocmask) # Save the old signal mask + + move a0, zero + addu a1, sp, STAND_FRAME_SIZE # pointer to struct sigaltstack + jal _C_LABEL(sigaltstack) - /* Get the signal mask. */ - addu a2, a0, _JB_SIGMASK * SZREG # &oenv - li a0, 1 # SIG_SETBLOCK - move a1, zero # &env == 0 - la t9, _C_LABEL(sigprocmask) # get current signal mask - jal t9 - nop + lw a0, SETJMP_FRAME_SIZE(sp) # restore jmpbuf + lw v1, STAND_FRAME_SIZE+8(sp) # struct sigaltstack->ss_flags + and v1, v1, 1 # extract SS_ONSTACK + sw v1, UC_ONSTACK(a0) # save it in ucontext_t->uc_mcontext.mc_onstack - lw a0, CALLFRAME_SIZ(sp) # restore env pointer - lw ra, CALLFRAME_RA(sp) # restore RA - addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame + lw ra, STAND_RA_OFFSET(sp) # Restore return address + addu sp, sp, SETJMP_FRAME_SIZE # Restore old stack pointer (eeeew...) - li v0, _JB_MAGIC_SETJMP - sw v0, (_JB_MAGIC * SZREG)(a0) - sw ra, (_JB_REG_RA * SZREG)(a0) - sw s0, (_JB_REG_S0 * SZREG)(a0) - sw s1, (_JB_REG_S1 * SZREG)(a0) - sw s2, (_JB_REG_S2 * SZREG)(a0) - sw s3, (_JB_REG_S3 * SZREG)(a0) - sw s4, (_JB_REG_S4 * SZREG)(a0) - sw s5, (_JB_REG_S5 * SZREG)(a0) - sw s6, (_JB_REG_S6 * SZREG)(a0) - sw s7, (_JB_REG_S7 * SZREG)(a0) - sw sp, (_JB_REG_SP * SZREG)(a0) - sw s8, (_JB_REG_S8 * SZREG)(a0) + blt v0, zero, botch # check for sigstack() error + sw ra, UC_PC(a0) # sc_pc = return address + li v0, 0xACEDBADE # sigcontext magic number + sw v0, (ZERO * 4) + UC_REGS (a0) # saved in sc_regs[0] + sw s0, (S0 * 4) + UC_REGS (a0) + sw s1, (S1 * 4) + UC_REGS (a0) + sw s2, (S2 * 4) + UC_REGS (a0) + sw s3, (S3 * 4) + UC_REGS (a0) + sw s4, (S4 * 4) + UC_REGS (a0) + sw s5, (S5 * 4) + UC_REGS (a0) + sw s6, (S6 * 4) + UC_REGS (a0) + sw s7, (S7 * 4) + UC_REGS (a0) + sw gp, (GP * 4) + UC_REGS (a0) + sw sp, (SP * 4) + UC_REGS (a0) + sw s8, (S8 * 4) + UC_REGS (a0) + li v0, 1 # be nice if we could tell + sw v0, UC_FPUSED (a0) # sc_fpused = 1 +#ifndef SOFTFLOAT + cfc1 v0, $31 + swc1 $f20, (F20_NUM * 4) + UC_FPREGS (a0) + swc1 $f21, (F21_NUM * 4) + UC_FPREGS (a0) + swc1 $f22, (F22_NUM * 4) + UC_FPREGS (a0) + swc1 $f23, (F23_NUM * 4) + UC_FPREGS (a0) + swc1 $f24, (F24_NUM * 4) + UC_FPREGS (a0) + swc1 $f25, (F25_NUM * 4) + UC_FPREGS (a0) + swc1 $f26, (F26_NUM * 4) + UC_FPREGS (a0) + swc1 $f27, (F27_NUM * 4) + UC_FPREGS (a0) + swc1 $f28, (F28_NUM * 4) + UC_FPREGS (a0) + swc1 $f29, (F29_NUM * 4) + UC_FPREGS (a0) + swc1 $f30, (F30_NUM * 4) + UC_FPREGS (a0) + swc1 $f31, (F31_NUM * 4) + UC_FPREGS (a0) + sw v0, (FSR_NUM * 4) + UC_FPREGS (a0) +#endif /* SOFTFLOAT */ move v0, zero j ra END(setjmp) -#define LONGJMP_FRAME_SIZE CALLFRAME_RA + SZREG * 2 - -NESTED(longjmp, LONGJMP_FRAME_SIZE, ra) - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - .set noreorder -#ifdef __ABICALLS__ - .cpload t9 -#endif - subu sp, sp, LONGJMP_FRAME_SIZE # allocate stack frame -#ifdef __ABICALLS__ +LEAF(longjmp) +#ifdef ABICALLS + subu sp, sp, 32 .cprestore 16 #endif - sw ra, CALLFRAME_RA(sp) # save RA - lw v0, (_JB_MAGIC * SZREG)(a0) - li t0, _JB_MAGIC_SETJMP - bne v0, t0, botch # jump if error - nop - - sw a0, CALLFRAME_SIZ(sp) # save env - sw a1, (CALLFRAME_SIZ + SZREG)(sp) # save return value - - # set sigmask - addu a1, a0, _JB_SIGMASK * SZREG # &set - move a2, zero # &oset == NULL - li a0, 3 # SIG_SETMASK - la t9,_C_LABEL(sigprocmask) # set current signal mask - jal t9 - nop - - lw a0, CALLFRAME_SIZ(sp) # restore env - lw a1, (CALLFRAME_SIZ + SZREG)(sp) # restore return value - - lw ra, (_JB_REG_RA * SZREG)(a0) - lw s0, (_JB_REG_S0 * SZREG)(a0) - lw s1, (_JB_REG_S1 * SZREG)(a0) - lw s2, (_JB_REG_S2 * SZREG)(a0) - lw s3, (_JB_REG_S3 * SZREG)(a0) - lw s4, (_JB_REG_S4 * SZREG)(a0) - lw s5, (_JB_REG_S5 * SZREG)(a0) - lw s6, (_JB_REG_S6 * SZREG)(a0) - lw s7, (_JB_REG_S7 * SZREG)(a0) - lw sp, (_JB_REG_SP * SZREG)(a0) - lw s8, (_JB_REG_S8 * SZREG)(a0) - move v0, a1 - j ra - nop - + .set reorder + sw a1, (V0 * 4) + UC_REGS (a0) # save return value in sc_regs[V0] + li v0, SYS_sigreturn + syscall botch: - la t9, _C_LABEL(longjmperror) - jal t9 - nop - - la t9, _C_LABEL(abort) - jal t9 - nop + jal _C_LABEL(longjmperror) + jal _C_LABEL(abort) END(longjmp) ==== //depot/projects/mips2-jnpr/src/lib/libc/mips/gen/sigsetjmp.S#3 - /FreeBSD/p4/mips2-jnpr/src/lib/libc/mips/gen/sigsetjmp.S ==== @@ -1,5 +1,3 @@ -/* $NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $ */ - /*- * Copyright (c) 1991, 1993, 1995, * The Regents of the University of California. All rights reserved. @@ -15,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -32,17 +30,15 @@ * SUCH DAMAGE. */ +#include #include #include +#include -#if defined(LIBC_SCCS) && !defined(lint) - ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $") -#endif /* LIBC_SCCS and not lint */ - -#ifdef __ABICALLS__ - .abicalls -#endif +#if defined(LIBC_SCCS) + .text + .asciz "$FreeBSD$" +#endif /* LIBC_SCCS */ /* * C library -- sigsetjmp, siglongjmp @@ -57,28 +53,20 @@ */ LEAF(sigsetjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 .set reorder -#endif + sw a1, (_JBLEN*4)(a0) # save "savemask" bne a1, 0x0, 1f # do saving of signal mask? la t9, _setjmp - jr t9 + jr t9 1: la t9, setjmp - jr t9 + jr t9 END(sigsetjmp) LEAF(siglongjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 .set reorder -#endif - lw t0, (_JB_MAGIC * SZREG)(a0) - li t1, _JB_MAGIC__SETJMP - bne t0, t1, 1f # setjmp or _setjmp magic? + lw t0, (_JBLEN * 4)(a0) # get "savemask" + bne t0, 0x0, 1f # restore signal mask? la t9, _longjmp jr t9 1: la t9, longjmp