Date: Sat, 2 Sep 2006 15:57:34 GMT From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 105536 for review Message-ID: <200609021557.k82FvYto029784@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105536 Change 105536 by gonzo@gonzo_hideout on 2006/09/02 15:57:32 o Add stubs for (sigi|_)?(set|long)jmp functions. o Add stubs for context handling routines. Affected files ... .. //depot/projects/mips2/src/lib/libc/mips/gen/longjmp.c#2 edit .. //depot/projects/mips2/src/lib/libc/mips/gen/makecontext.c#2 edit .. //depot/projects/mips2/src/lib/libc/mips/gen/setjmp.S#2 edit .. //depot/projects/mips2/src/lib/libc/mips/gen/signalcontext.c#1 add .. //depot/projects/mips2/src/lib/libc/mips/gen/sigsetjmp.S#2 edit Differences ... ==== //depot/projects/mips2/src/lib/libc/mips/gen/longjmp.c#2 (text+ko) ==== @@ -45,10 +45,6 @@ #include <machine/regnum.h> -#define __LIBC12_SOURCE__ -#include <setjmp.h> -#include <compat/include/setjmp.h> - void __longjmp14(jmp_buf env, int val) { ==== //depot/projects/mips2/src/lib/libc/mips/gen/makecontext.c#2 (text+ko) ==== @@ -44,13 +44,14 @@ #include <inttypes.h> #include <stddef.h> #include <ucontext.h> -#include "extern.h" #include <stdarg.h> void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) { + /* XXXMIPS: Implement me */ +#if 0 __greg_t *gr = ucp->uc_mcontext.__gregs; uintptr_t *sp; int i; @@ -82,4 +83,5 @@ /* LINTED uintptr_t is safe */ *sp++ = va_arg(ap, uintptr_t); va_end(ap); +#endif } ==== //depot/projects/mips2/src/lib/libc/mips/gen/setjmp.S#2 (text+ko) ==== @@ -32,12 +32,8 @@ * SUCH DAMAGE. */ -#include <machine/cdefs.h> -#include <sys/syscall.h> -#include <mips/regnum.h> -#include <mips/asm.h> -#include <machine/signal.h> -#include <machine/setjmp.h> +#include <machine/regnum.h> +#include <machine/asm.h> #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") @@ -61,7 +57,7 @@ #define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + 12) -NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) +NESTED(setjmp, SETJMP_FRAME_SIZE, ra) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) #ifdef __ABICALLS__ .set noreorder @@ -78,13 +74,13 @@ /* Get the signal mask. */ addu a2, a0, _OFFSETOF_SC_MASK # &sc.sc_mask move a1, zero - jal _C_LABEL(__sigprocmask14) # get current signal mask + # XXXMIPS: jal _C_LABEL(__sigprocmask14) # get current signal mask move a0, zero # (in delay slot) /* Get the signal stack. */ move a0, zero addu a1, sp, CALLFRAME_SIZ # pointer to struct sigaltstack - jal _C_LABEL(__sigaltstack14) + # XXXMIPS: jal _C_LABEL(__sigaltstack14) nop lw v1, CALLFRAME_SIZ+8(sp) # get old ss_onstack lw a0, SETJMP_FRAME_SIZE(sp) # restore sc pointer @@ -99,18 +95,18 @@ REG_PROLOGUE REG_S ra, (2 * 4)(a0) # sc_pc = return address REG_LI v0, 0xACEDBADE # sigcontext magic number - REG_S v0, (_OFFSETOF_SC_REGS + _R_ZERO * SZREG)(a0) # saved in sc_regs[0] - REG_S s0, (_OFFSETOF_SC_REGS + _R_S0 * SZREG)(a0) - REG_S s1, (_OFFSETOF_SC_REGS + _R_S1 * SZREG)(a0) - REG_S s2, (_OFFSETOF_SC_REGS + _R_S2 * SZREG)(a0) - REG_S s3, (_OFFSETOF_SC_REGS + _R_S3 * SZREG)(a0) - REG_S s4, (_OFFSETOF_SC_REGS + _R_S4 * SZREG)(a0) - REG_S s5, (_OFFSETOF_SC_REGS + _R_S5 * SZREG)(a0) - REG_S s6, (_OFFSETOF_SC_REGS + _R_S6 * SZREG)(a0) - REG_S s7, (_OFFSETOF_SC_REGS + _R_S7 * SZREG)(a0) - REG_S gp, (_OFFSETOF_SC_REGS + _R_GP * SZREG)(a0) - REG_S sp, (_OFFSETOF_SC_REGS + _R_SP * SZREG)(a0) - REG_S s8, (_OFFSETOF_SC_REGS + _R_S8 * SZREG)(a0) + REG_S v0, (_OFFSETOF_SC_REGS + ZERO * SZREG)(a0) # saved in sc_regs[0] + REG_S s0, (_OFFSETOF_SC_REGS + S0 * SZREG)(a0) + REG_S s1, (_OFFSETOF_SC_REGS + S1 * SZREG)(a0) + REG_S s2, (_OFFSETOF_SC_REGS + S2 * SZREG)(a0) + REG_S s3, (_OFFSETOF_SC_REGS + S3 * SZREG)(a0) + REG_S s4, (_OFFSETOF_SC_REGS + S4 * SZREG)(a0) + REG_S s5, (_OFFSETOF_SC_REGS + S5 * SZREG)(a0) + REG_S s6, (_OFFSETOF_SC_REGS + S6 * SZREG)(a0) + REG_S s7, (_OFFSETOF_SC_REGS + S7 * SZREG)(a0) + REG_S gp, (_OFFSETOF_SC_REGS + GP * SZREG)(a0) + REG_S sp, (_OFFSETOF_SC_REGS + SP * SZREG)(a0) + REG_S s8, (_OFFSETOF_SC_REGS + S8 * SZREG)(a0) li v0, 1 # be nice if we could tell sw v0, (_OFFSETOF_SC_REGS + 34 * SZREG)(a0) # sc_fpused = 1 cfc1 v0, $31 @@ -132,4 +128,9 @@ REG_EPILOGUE botch: jal _C_LABEL(abort) -END(__setjmp14) +END(setjmp) + +WEAK_ALIAS(longjmp, __longjmp) +LEAF(__longjmp) + j ra +END(__longjmp) ==== //depot/projects/mips2/src/lib/libc/mips/gen/sigsetjmp.S#2 (text+ko) ==== @@ -32,10 +32,8 @@ * SUCH DAMAGE. */ -#include <sys/syscall.h> -#include <mips/regnum.h> -#include <mips/asm.h> -#include <machine/setjmp.h> +#include <machine/regnum.h> +#include <machine/asm.h> #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") @@ -58,31 +56,33 @@ * signal mask. */ -LEAF(__sigsetjmp14) +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? + WEAK_ALIAS(__sigsetjmp, sigsetjmp) + # XXXMIPS: sw a1, (_JBLEN*4)(a0) # save "savemask" + # XXXMIPS: bne a1, 0x0, 1f # do saving of signal mask? la t9, _setjmp jr t9 -1: la t9, __setjmp14 +1: la t9, setjmp jr t9 -END(__sigsetjmp14) +END(sigsetjmp) -LEAF(__siglongjmp14) +LEAF(siglongjmp) #ifdef __ABICALLS__ .set noreorder .cpload t9 .set reorder #endif - lw t0, (_JBLEN * 4)(a0) # get "savemask" - bne t0, 0x0, 1f # restore signal mask? + WEAK_ALIAS(__siglongjmp, siglongjmp) + # XXXMIPS: lw t0, (_JBLEN * 4)(a0) # get "savemask" + # XXXMIPS: bne t0, 0x0, 1f # restore signal mask? la t9, _longjmp jr t9 -1: la t9, __longjmp14 +1: la t9, __longjmp jr t9 -END(__siglongjmp14) +END(siglongjmp)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609021557.k82FvYto029784>