From f80595ca7da3548ffa00ca36069a755394a59dbe Mon Sep 17 00:00:00 2001 From: tsutsui Date: Sat, 17 Sep 2005 11:49:39 +0000 Subject: [PATCH] Switch mips to the new libc compat code layout. --- lib/libc/arch/mips/Makefile.inc | 4 +- lib/libc/arch/mips/gen/Makefile.inc | 7 +- .../mips/gen/{__longjmp14.c => longjmp.c} | 2 +- lib/libc/arch/mips/gen/setjmp.S | 79 ++++++++----------- lib/libc/arch/mips/gen/sigsetjmp.S | 16 ++-- lib/libc/compat/arch/mips/Makefile.inc | 4 + lib/libc/compat/arch/mips/gen/Makefile.inc | 10 +++ .../arch/mips/gen/compat__setjmp.S} | 4 +- .../arch/mips/gen/compat_setjmp.S} | 79 +++++++++++-------- .../arch/mips/gen/compat_sigsetjmp.S} | 16 ++-- lib/libc/compat/arch/mips/sys/Makefile.inc | 6 ++ .../arch/mips/sys/compat_Ovfork.S} | 4 +- .../arch/mips/sys/compat___semctl.S} | 2 +- .../arch/mips/sys/compat___sigreturn14.S} | 4 +- .../arch/mips/sys/compat___sigtramp1.S} | 2 +- .../arch/mips/sys/compat_msgctl.S} | 2 +- .../arch/mips/sys/compat_shmctl.S} | 2 +- .../arch/mips/sys/compat_sigaction.S} | 2 +- .../arch/mips/sys/compat_sigpending.S} | 4 +- .../arch/mips/sys/compat_sigprocmask.S} | 4 +- .../arch/mips/sys/compat_sigreturn.S} | 4 +- .../arch/mips/sys/compat_sigsuspend.S} | 4 +- 22 files changed, 140 insertions(+), 121 deletions(-) rename lib/libc/arch/mips/gen/{__longjmp14.c => longjmp.c} (98%) create mode 100644 lib/libc/compat/arch/mips/Makefile.inc create mode 100644 lib/libc/compat/arch/mips/gen/Makefile.inc rename lib/libc/{arch/mips/gen/_setjmp.S => compat/arch/mips/gen/compat__setjmp.S} (97%) rename lib/libc/{arch/mips/gen/__setjmp14.S => compat/arch/mips/gen/compat_setjmp.S} (69%) rename lib/libc/{arch/mips/gen/__sigsetjmp14.S => compat/arch/mips/gen/compat_sigsetjmp.S} (90%) create mode 100644 lib/libc/compat/arch/mips/sys/Makefile.inc rename lib/libc/{arch/mips/sys/Ovfork.S => compat/arch/mips/sys/compat_Ovfork.S} (94%) rename lib/libc/{arch/mips/sys/__semctl.S => compat/arch/mips/sys/compat___semctl.S} (96%) rename lib/libc/{arch/mips/sys/__sigreturn14.S => compat/arch/mips/sys/compat___sigreturn14.S} (92%) rename lib/libc/{arch/mips/sys/__sigtramp1.S => compat/arch/mips/sys/compat___sigtramp1.S} (96%) rename lib/libc/{arch/mips/sys/msgctl.S => compat/arch/mips/sys/compat_msgctl.S} (96%) rename lib/libc/{arch/mips/sys/shmctl.S => compat/arch/mips/sys/compat_shmctl.S} (96%) rename lib/libc/{arch/mips/sys/sigaction.S => compat/arch/mips/sys/compat_sigaction.S} (96%) rename lib/libc/{arch/mips/sys/sigpending.S => compat/arch/mips/sys/compat_sigpending.S} (93%) rename lib/libc/{arch/mips/sys/sigprocmask.S => compat/arch/mips/sys/compat_sigprocmask.S} (94%) rename lib/libc/{arch/mips/sys/sigreturn.S => compat/arch/mips/sys/compat_sigreturn.S} (93%) rename lib/libc/{arch/mips/sys/sigsuspend.S => compat/arch/mips/sys/compat_sigsuspend.S} (93%) diff --git a/lib/libc/arch/mips/Makefile.inc b/lib/libc/arch/mips/Makefile.inc index 81c9af8b7a05..eca0ab4f74ec 100644 --- a/lib/libc/arch/mips/Makefile.inc +++ b/lib/libc/arch/mips/Makefile.inc @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.6 2003/11/02 08:37:48 christos Exp $ +# $NetBSD: Makefile.inc,v 1.7 2005/09/17 11:49:39 tsutsui Exp $ KMINCLUDES= KMSRCS= -SRCS+= __sigaction14_sigtramp.c __sigtramp1.S __sigtramp2.S +SRCS+= __sigaction14_sigtramp.c __sigtramp2.S diff --git a/lib/libc/arch/mips/gen/Makefile.inc b/lib/libc/arch/mips/gen/Makefile.inc index 6b44cb7ff630..173d701c5eee 100644 --- a/lib/libc/arch/mips/gen/Makefile.inc +++ b/lib/libc/arch/mips/gen/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.25 2005/04/15 22:39:11 kleink Exp $ +# $NetBSD: Makefile.inc,v 1.26 2005/09/17 11:49:39 tsutsui Exp $ SRCS+= fabs.S ldexp.S modf.S @@ -16,9 +16,8 @@ SRCS+= nanf.c SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ fpsetround.c fpsetsticky.c -SRCS+= setjmp.S __setjmp14.S __longjmp14.c -SRCS+= _setjmp.S -SRCS+= sigsetjmp.S __sigsetjmp14.S +SRCS+= setjmp.S longjmp.c +SRCS+= sigsetjmp.S SRCS+= byte_swap_2.S byte_swap_4.S bswap64.c SRCS+= makecontext.c resumecontext.c _resumecontext.S swapcontext.S _lwp.c diff --git a/lib/libc/arch/mips/gen/__longjmp14.c b/lib/libc/arch/mips/gen/longjmp.c similarity index 98% rename from lib/libc/arch/mips/gen/__longjmp14.c rename to lib/libc/arch/mips/gen/longjmp.c index c531b05f30c1..97cffd5f4d58 100644 --- a/lib/libc/arch/mips/gen/__longjmp14.c +++ b/lib/libc/arch/mips/gen/longjmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: __longjmp14.c,v 1.5 2005/09/14 09:05:36 martin Exp $ */ +/* $NetBSD: longjmp.c,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/gen/setjmp.S b/lib/libc/arch/mips/gen/setjmp.S index 52eb125a2477..f98cd0399d98 100644 --- a/lib/libc/arch/mips/gen/setjmp.S +++ b/lib/libc/arch/mips/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: setjmp.S,v 1.16 2003/11/26 08:36:49 he Exp $ */ +/* $NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: setjmp.S,v 1.16 2003/11/26 08:36:49 he Exp $") + ASMSTR("$NetBSD: setjmp.S,v 1.17 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -61,7 +61,7 @@ #define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + 12) -NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) +NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) #ifdef __ABICALLS__ .set noreorder @@ -72,37 +72,45 @@ NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) #ifdef __ABICALLS__ .cprestore 16 #endif - sw ra, CALLFRAME_RA(sp) # save state - sw a0, SETJMP_FRAME_SIZE(sp) - move a0, zero # get current signal mask - jal _C_LABEL(sigblock) - lw v1, SETJMP_FRAME_SIZE(sp) # v1 = jmpbuf - sw v0, (1 * 4)(v1) # save sc_mask = sigblock(0) + sw ra, CALLFRAME_RA(sp) # save RA + sw a0, SETJMP_FRAME_SIZE(sp) # squirrel away sc + + /* Get the signal mask. */ + addu a2, a0, _OFFSETOF_SC_MASK # &sc.sc_mask + move a1, zero + 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) - lw a0, SETJMP_FRAME_SIZE(sp) # restore jmpbuf + nop lw v1, CALLFRAME_SIZ+8(sp) # get old ss_onstack + lw a0, SETJMP_FRAME_SIZE(sp) # restore sc pointer and v1, v1, 1 # extract onstack flag sw v1, 0(a0) # save it in sc_onstack - lw ra, CALLFRAME_RA(sp) - addu sp, sp, SETJMP_FRAME_SIZE - blt v0, zero, botch # check for sigstack() error + + lw ra, CALLFRAME_RA(sp) # restore RA + addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame + + blt v0, zero, botch # check for sigaltstack() error + 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 + SZREG * _R_ZERO)(a0) # saved in sc_regs[0] - REG_S s0, (_OFFSETOF_SC_REGS + SZREG * _R_S0)(a0) - REG_S s1, (_OFFSETOF_SC_REGS + SZREG * _R_S1)(a0) - REG_S s2, (_OFFSETOF_SC_REGS + SZREG * _R_S2)(a0) - REG_S s3, (_OFFSETOF_SC_REGS + SZREG * _R_S3)(a0) - REG_S s4, (_OFFSETOF_SC_REGS + SZREG * _R_S4)(a0) - REG_S s5, (_OFFSETOF_SC_REGS + SZREG * _R_S5)(a0) - REG_S s6, (_OFFSETOF_SC_REGS + SZREG * _R_S6)(a0) - REG_S s7, (_OFFSETOF_SC_REGS + SZREG * _R_S7)(a0) - REG_S gp, (_OFFSETOF_SC_REGS + SZREG * _R_GP)(a0) - REG_S sp, (_OFFSETOF_SC_REGS + SZREG * _R_SP)(a0) - REG_S s8, (_OFFSETOF_SC_REGS + SZREG * _R_S8)(a0) + 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) li v0, 1 # be nice if we could tell sw v0, (_OFFSETOF_SC_REGS + 34 * SZREG)(a0) # sc_fpused = 1 cfc1 v0, $31 @@ -118,27 +126,10 @@ NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) swc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) 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 + sw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) move v0, zero j ra -END(setjmp) - -LEAF(longjmp) -#ifdef __ABICALLS__ - .set noreorder - .cpload t9 - .set reorder - subu sp, sp, 32 - .cprestore 16 -#endif - REG_PROLOGUE - /* save return value in sc_regs[_R_V0] */ - REG_S a1, (_OFFSETOF_SC_REGS + _R_V0 * SZREG)(a0) REG_EPILOGUE - li v0, SYS_compat_13_sigreturn13 - syscall botch: - jal _C_LABEL(longjmperror) jal _C_LABEL(abort) -END(longjmp) +END(__setjmp14) diff --git a/lib/libc/arch/mips/gen/sigsetjmp.S b/lib/libc/arch/mips/gen/sigsetjmp.S index 141f67b904e3..61a84cbca99e 100644 --- a/lib/libc/arch/mips/gen/sigsetjmp.S +++ b/lib/libc/arch/mips/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigsetjmp.S,v 1.7 2003/08/07 16:42:15 agc Exp $ */ +/* $NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993, 1995, @@ -39,7 +39,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigsetjmp.S,v 1.7 2003/08/07 16:42:15 agc Exp $") + ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -58,7 +58,7 @@ * signal mask. */ -LEAF(sigsetjmp) +LEAF(__sigsetjmp14) #ifdef __ABICALLS__ .set noreorder .cpload t9 @@ -69,11 +69,11 @@ LEAF(sigsetjmp) la t9, _setjmp jr t9 -1: la t9, setjmp +1: la t9, __setjmp14 jr t9 -END(sigsetjmp) +END(__sigsetjmp14) -LEAF(siglongjmp) +LEAF(__siglongjmp14) #ifdef __ABICALLS__ .set noreorder .cpload t9 @@ -83,6 +83,6 @@ LEAF(siglongjmp) bne t0, 0x0, 1f # restore signal mask? la t9, _longjmp jr t9 -1: la t9, longjmp +1: la t9, __longjmp14 jr t9 -END(siglongjmp) +END(__siglongjmp14) diff --git a/lib/libc/compat/arch/mips/Makefile.inc b/lib/libc/compat/arch/mips/Makefile.inc new file mode 100644 index 000000000000..7d2e292fa8e8 --- /dev/null +++ b/lib/libc/compat/arch/mips/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ + +.include "${.CURDIR}/compat/arch/mips/gen/Makefile.inc" +.include "${.CURDIR}/compat/arch/mips/sys/Makefile.inc" diff --git a/lib/libc/compat/arch/mips/gen/Makefile.inc b/lib/libc/compat/arch/mips/gen/Makefile.inc new file mode 100644 index 000000000000..07ec91aca2ba --- /dev/null +++ b/lib/libc/compat/arch/mips/gen/Makefile.inc @@ -0,0 +1,10 @@ +# $NetBSD: Makefile.inc,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ + +# objects built from assembler sources (need lint stubs) +SRCS+= compat_setjmp.S compat__setjmp.S compat_sigsetjmp.S + +SRCS.mips.gen=Lint__setjmp.c + +LSRCS+= ${SRCS.mips.gen} +DPSRCS+= ${SRCS.mips.gen} +CLEANFILES+= ${SRCS.mips.gen} diff --git a/lib/libc/arch/mips/gen/_setjmp.S b/lib/libc/compat/arch/mips/gen/compat__setjmp.S similarity index 97% rename from lib/libc/arch/mips/gen/_setjmp.S rename to lib/libc/compat/arch/mips/gen/compat__setjmp.S index dfa71f862f53..a1daf92998f3 100644 --- a/lib/libc/arch/mips/gen/_setjmp.S +++ b/lib/libc/compat/arch/mips/gen/compat__setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: _setjmp.S,v 1.18 2003/11/26 08:36:49 he Exp $ */ +/* $NetBSD: compat__setjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -40,7 +40,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)_setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: _setjmp.S,v 1.18 2003/11/26 08:36:49 he Exp $") + ASMSTR("$NetBSD: compat__setjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ diff --git a/lib/libc/arch/mips/gen/__setjmp14.S b/lib/libc/compat/arch/mips/gen/compat_setjmp.S similarity index 69% rename from lib/libc/arch/mips/gen/__setjmp14.S rename to lib/libc/compat/arch/mips/gen/compat_setjmp.S index fd283ff05cc2..dbe82acd1dd1 100644 --- a/lib/libc/arch/mips/gen/__setjmp14.S +++ b/lib/libc/compat/arch/mips/gen/compat_setjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: __setjmp14.S,v 1.10 2004/03/23 02:21:49 simonb Exp $ */ +/* $NetBSD: compat_setjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -41,7 +41,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: __setjmp14.S,v 1.10 2004/03/23 02:21:49 simonb Exp $") + ASMSTR("$NetBSD: compat_setjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -61,7 +61,7 @@ #define SETJMP_FRAME_SIZE (CALLFRAME_SIZ + 12) -NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) +NON_LEAF(setjmp, SETJMP_FRAME_SIZE, ra) .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) #ifdef __ABICALLS__ .set noreorder @@ -72,45 +72,37 @@ NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) #ifdef __ABICALLS__ .cprestore 16 #endif - sw ra, CALLFRAME_RA(sp) # save RA - sw a0, SETJMP_FRAME_SIZE(sp) # squirrel away sc - - /* Get the signal mask. */ - addu a2, a0, _OFFSETOF_SC_MASK # &sc.sc_mask - move a1, zero - jal _C_LABEL(__sigprocmask14) # get current signal mask - move a0, zero # (in delay slot) - - /* Get the signal stack. */ + sw ra, CALLFRAME_RA(sp) # save state + sw a0, SETJMP_FRAME_SIZE(sp) + move a0, zero # get current signal mask + jal _C_LABEL(sigblock) + lw v1, SETJMP_FRAME_SIZE(sp) # v1 = jmpbuf + sw v0, (1 * 4)(v1) # save sc_mask = sigblock(0) move a0, zero addu a1, sp, CALLFRAME_SIZ # pointer to struct sigaltstack jal _C_LABEL(__sigaltstack14) - nop + lw a0, SETJMP_FRAME_SIZE(sp) # restore jmpbuf lw v1, CALLFRAME_SIZ+8(sp) # get old ss_onstack - lw a0, SETJMP_FRAME_SIZE(sp) # restore sc pointer and v1, v1, 1 # extract onstack flag sw v1, 0(a0) # save it in sc_onstack - - lw ra, CALLFRAME_RA(sp) # restore RA - addu sp, sp, SETJMP_FRAME_SIZE # pop stack frame - - blt v0, zero, botch # check for sigaltstack() error - + lw ra, CALLFRAME_RA(sp) + addu sp, sp, SETJMP_FRAME_SIZE + blt v0, zero, botch # check for sigstack() error 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 + SZREG * _R_ZERO)(a0) # saved in sc_regs[0] + REG_S s0, (_OFFSETOF_SC_REGS + SZREG * _R_S0)(a0) + REG_S s1, (_OFFSETOF_SC_REGS + SZREG * _R_S1)(a0) + REG_S s2, (_OFFSETOF_SC_REGS + SZREG * _R_S2)(a0) + REG_S s3, (_OFFSETOF_SC_REGS + SZREG * _R_S3)(a0) + REG_S s4, (_OFFSETOF_SC_REGS + SZREG * _R_S4)(a0) + REG_S s5, (_OFFSETOF_SC_REGS + SZREG * _R_S5)(a0) + REG_S s6, (_OFFSETOF_SC_REGS + SZREG * _R_S6)(a0) + REG_S s7, (_OFFSETOF_SC_REGS + SZREG * _R_S7)(a0) + REG_S gp, (_OFFSETOF_SC_REGS + SZREG * _R_GP)(a0) + REG_S sp, (_OFFSETOF_SC_REGS + SZREG * _R_SP)(a0) + REG_S s8, (_OFFSETOF_SC_REGS + SZREG * _R_S8)(a0) li v0, 1 # be nice if we could tell sw v0, (_OFFSETOF_SC_REGS + 34 * SZREG)(a0) # sc_fpused = 1 cfc1 v0, $31 @@ -126,10 +118,27 @@ NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra) swc1 $f29, (29 * 4 + _OFFSETOF_SC_FPREGS)(a0) swc1 $f30, (30 * 4 + _OFFSETOF_SC_FPREGS)(a0) swc1 $f31, (31 * 4 + _OFFSETOF_SC_FPREGS)(a0) - sw v0, (32 * 4 + _OFFSETOF_SC_FPREGS)(a0) + sw v0, ((32 * 4) + _OFFSETOF_SC_FPREGS)(a0) + REG_EPILOGUE move v0, zero j ra +END(setjmp) + +LEAF(longjmp) +#ifdef __ABICALLS__ + .set noreorder + .cpload t9 + .set reorder + subu sp, sp, 32 + .cprestore 16 +#endif + REG_PROLOGUE + /* save return value in sc_regs[_R_V0] */ + REG_S a1, (_OFFSETOF_SC_REGS + _R_V0 * SZREG)(a0) REG_EPILOGUE + li v0, SYS_compat_13_sigreturn13 + syscall botch: + jal _C_LABEL(longjmperror) jal _C_LABEL(abort) -END(__setjmp14) +END(longjmp) diff --git a/lib/libc/arch/mips/gen/__sigsetjmp14.S b/lib/libc/compat/arch/mips/gen/compat_sigsetjmp.S similarity index 90% rename from lib/libc/arch/mips/gen/__sigsetjmp14.S rename to lib/libc/compat/arch/mips/gen/compat_sigsetjmp.S index e657d1d70359..07bfac9fa835 100644 --- a/lib/libc/arch/mips/gen/__sigsetjmp14.S +++ b/lib/libc/compat/arch/mips/gen/compat_sigsetjmp.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigsetjmp14.S,v 1.4 2003/08/07 16:42:15 agc Exp $ */ +/* $NetBSD: compat_sigsetjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993, 1995, @@ -39,7 +39,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: __sigsetjmp14.S,v 1.4 2003/08/07 16:42:15 agc Exp $") + ASMSTR("$NetBSD: compat_sigsetjmp.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ #ifdef __ABICALLS__ @@ -58,7 +58,7 @@ * signal mask. */ -LEAF(__sigsetjmp14) +LEAF(sigsetjmp) #ifdef __ABICALLS__ .set noreorder .cpload t9 @@ -69,11 +69,11 @@ LEAF(__sigsetjmp14) 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 @@ -83,6 +83,6 @@ LEAF(__siglongjmp14) 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) diff --git a/lib/libc/compat/arch/mips/sys/Makefile.inc b/lib/libc/compat/arch/mips/sys/Makefile.inc new file mode 100644 index 000000000000..73e76ccd922c --- /dev/null +++ b/lib/libc/compat/arch/mips/sys/Makefile.inc @@ -0,0 +1,6 @@ +# $NetBSD: Makefile.inc,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ + +SRCS+=compat_Ovfork.S compat___semctl.S compat___sigreturn14.S \ + compat___sigtramp1.S compat_msgctl.S compat_shmctl.S compat_sigaction.S \ + compat_sigpending.S compat_sigprocmask.S compat_sigreturn.S \ + compat_sigsuspend.S diff --git a/lib/libc/arch/mips/sys/Ovfork.S b/lib/libc/compat/arch/mips/sys/compat_Ovfork.S similarity index 94% rename from lib/libc/arch/mips/sys/Ovfork.S rename to lib/libc/compat/arch/mips/sys/compat_Ovfork.S index 2b9360e9d79e..1376c514d468 100644 --- a/lib/libc/arch/mips/sys/Ovfork.S +++ b/lib/libc/compat/arch/mips/sys/compat_Ovfork.S @@ -1,4 +1,4 @@ -/* $NetBSD: Ovfork.S,v 1.10 2003/08/07 16:42:17 agc Exp $ */ +/* $NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)Ovfork.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: Ovfork.S,v 1.10 2003/08/07 16:42:17 agc Exp $") + ASMSTR("$NetBSD: compat_Ovfork.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ WARN_REFERENCES(vfork, \ diff --git a/lib/libc/arch/mips/sys/__semctl.S b/lib/libc/compat/arch/mips/sys/compat___semctl.S similarity index 96% rename from lib/libc/arch/mips/sys/__semctl.S rename to lib/libc/compat/arch/mips/sys/compat___semctl.S index 27b9964e5a93..8116664f457f 100644 --- a/lib/libc/arch/mips/sys/__semctl.S +++ b/lib/libc/compat/arch/mips/sys/compat___semctl.S @@ -1,4 +1,4 @@ -/* $NetBSD: __semctl.S,v 1.1 1999/08/25 05:09:30 thorpej Exp $ */ +/* $NetBSD: compat___semctl.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/sys/__sigreturn14.S b/lib/libc/compat/arch/mips/sys/compat___sigreturn14.S similarity index 92% rename from lib/libc/arch/mips/sys/__sigreturn14.S rename to lib/libc/compat/arch/mips/sys/compat___sigreturn14.S index cbdbdda36b62..73c188e12cdb 100644 --- a/lib/libc/arch/mips/sys/__sigreturn14.S +++ b/lib/libc/compat/arch/mips/sys/compat___sigreturn14.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigreturn14.S,v 1.4 2004/03/26 20:35:37 drochner Exp $ */ +/* $NetBSD: compat___sigreturn14.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)sigreturn.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: __sigreturn14.S,v 1.4 2004/03/26 20:35:37 drochner Exp $") + ASMSTR("$NetBSD: compat___sigreturn14.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ /* diff --git a/lib/libc/arch/mips/sys/__sigtramp1.S b/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S similarity index 96% rename from lib/libc/arch/mips/sys/__sigtramp1.S rename to lib/libc/compat/arch/mips/sys/compat___sigtramp1.S index fbf6b716c51a..d64c01b20606 100644 --- a/lib/libc/arch/mips/sys/__sigtramp1.S +++ b/lib/libc/compat/arch/mips/sys/compat___sigtramp1.S @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp1.S,v 1.2 2004/03/26 20:35:37 drochner Exp $ */ +/* $NetBSD: compat___sigtramp1.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/sys/msgctl.S b/lib/libc/compat/arch/mips/sys/compat_msgctl.S similarity index 96% rename from lib/libc/arch/mips/sys/msgctl.S rename to lib/libc/compat/arch/mips/sys/compat_msgctl.S index 3fba1a8bd1aa..495d49de4d5a 100644 --- a/lib/libc/arch/mips/sys/msgctl.S +++ b/lib/libc/compat/arch/mips/sys/compat_msgctl.S @@ -1,4 +1,4 @@ -/* $NetBSD: msgctl.S,v 1.1 1999/08/25 05:09:30 thorpej Exp $ */ +/* $NetBSD: compat_msgctl.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/sys/shmctl.S b/lib/libc/compat/arch/mips/sys/compat_shmctl.S similarity index 96% rename from lib/libc/arch/mips/sys/shmctl.S rename to lib/libc/compat/arch/mips/sys/compat_shmctl.S index 8f80a599a906..1615ce7157d5 100644 --- a/lib/libc/arch/mips/sys/shmctl.S +++ b/lib/libc/compat/arch/mips/sys/compat_shmctl.S @@ -1,4 +1,4 @@ -/* $NetBSD: shmctl.S,v 1.1 1999/08/25 05:09:30 thorpej Exp $ */ +/* $NetBSD: compat_shmctl.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/sys/sigaction.S b/lib/libc/compat/arch/mips/sys/compat_sigaction.S similarity index 96% rename from lib/libc/arch/mips/sys/sigaction.S rename to lib/libc/compat/arch/mips/sys/compat_sigaction.S index 19d6d850a2bf..c479fc69b1dd 100644 --- a/lib/libc/arch/mips/sys/sigaction.S +++ b/lib/libc/compat/arch/mips/sys/compat_sigaction.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigaction.S,v 1.2 1998/12/02 01:01:04 thorpej Exp $ */ +/* $NetBSD: compat_sigaction.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. diff --git a/lib/libc/arch/mips/sys/sigpending.S b/lib/libc/compat/arch/mips/sys/compat_sigpending.S similarity index 93% rename from lib/libc/arch/mips/sys/sigpending.S rename to lib/libc/compat/arch/mips/sys/compat_sigpending.S index eb45067b221f..d61a47c40420 100644 --- a/lib/libc/arch/mips/sys/sigpending.S +++ b/lib/libc/compat/arch/mips/sys/compat_sigpending.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigpending.S,v 1.11 2003/08/07 16:42:17 agc Exp $ */ +/* $NetBSD: compat_sigpending.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)sigpending.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigpending.S,v 1.11 2003/08/07 16:42:17 agc Exp $") + ASMSTR("$NetBSD: compat_sigpending.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ WARN_REFERENCES(sigpending, \ diff --git a/lib/libc/arch/mips/sys/sigprocmask.S b/lib/libc/compat/arch/mips/sys/compat_sigprocmask.S similarity index 94% rename from lib/libc/arch/mips/sys/sigprocmask.S rename to lib/libc/compat/arch/mips/sys/compat_sigprocmask.S index a1b3535aee99..4de2b053e557 100644 --- a/lib/libc/arch/mips/sys/sigprocmask.S +++ b/lib/libc/compat/arch/mips/sys/compat_sigprocmask.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigprocmask.S,v 1.11 2003/08/07 16:42:17 agc Exp $ */ +/* $NetBSD: compat_sigprocmask.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)sigprocmask.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigprocmask.S,v 1.11 2003/08/07 16:42:17 agc Exp $") + ASMSTR("$NetBSD: compat_sigprocmask.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ WARN_REFERENCES(sigprocmask, \ diff --git a/lib/libc/arch/mips/sys/sigreturn.S b/lib/libc/compat/arch/mips/sys/compat_sigreturn.S similarity index 93% rename from lib/libc/arch/mips/sys/sigreturn.S rename to lib/libc/compat/arch/mips/sys/compat_sigreturn.S index 92e686a06aca..0c6247f19730 100644 --- a/lib/libc/arch/mips/sys/sigreturn.S +++ b/lib/libc/compat/arch/mips/sys/compat_sigreturn.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigreturn.S,v 1.8 2004/03/26 22:15:03 drochner Exp $ */ +/* $NetBSD: compat_sigreturn.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)sigreturn.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigreturn.S,v 1.8 2004/03/26 22:15:03 drochner Exp $") + ASMSTR("$NetBSD: compat_sigreturn.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ /* diff --git a/lib/libc/arch/mips/sys/sigsuspend.S b/lib/libc/compat/arch/mips/sys/compat_sigsuspend.S similarity index 93% rename from lib/libc/arch/mips/sys/sigsuspend.S rename to lib/libc/compat/arch/mips/sys/compat_sigsuspend.S index 1c34c71a3f6c..3218d1221094 100644 --- a/lib/libc/arch/mips/sys/sigsuspend.S +++ b/lib/libc/compat/arch/mips/sys/compat_sigsuspend.S @@ -1,4 +1,4 @@ -/* $NetBSD: sigsuspend.S,v 1.11 2003/08/07 16:42:17 agc Exp $ */ +/* $NetBSD: compat_sigsuspend.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)sigsuspend.s 8.1 (Berkeley) 6/4/93") - ASMSTR("$NetBSD: sigsuspend.S,v 1.11 2003/08/07 16:42:17 agc Exp $") + ASMSTR("$NetBSD: compat_sigsuspend.S,v 1.1 2005/09/17 11:49:39 tsutsui Exp $") #endif /* LIBC_SCCS and not lint */ WARN_REFERENCES(sigsuspend, \