Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc Switch mips to the new libc compat code layout.



details:   https://anonhg.NetBSD.org/src/rev/b7687ca086b1
branches:  trunk
changeset: 584434:b7687ca086b1
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Sep 17 11:49:39 2005 +0000

description:
Switch mips to the new libc compat code layout.

diffstat:

 lib/libc/arch/mips/Makefile.inc                      |    4 +-
 lib/libc/arch/mips/gen/Makefile.inc                  |    7 +-
 lib/libc/arch/mips/gen/__longjmp14.c                 |  112 --------------
 lib/libc/arch/mips/gen/__setjmp14.S                  |  135 ----------------
 lib/libc/arch/mips/gen/__sigsetjmp14.S               |   88 -----------
 lib/libc/arch/mips/gen/_setjmp.S                     |  151 -------------------
 lib/libc/arch/mips/gen/longjmp.c                     |  112 ++++++++++++++
 lib/libc/arch/mips/gen/setjmp.S                      |   79 ++++-----
 lib/libc/arch/mips/gen/sigsetjmp.S                   |   16 +-
 lib/libc/arch/mips/sys/Ovfork.S                      |   68 --------
 lib/libc/arch/mips/sys/__semctl.S                    |   42 -----
 lib/libc/arch/mips/sys/__sigreturn14.S               |   46 -----
 lib/libc/arch/mips/sys/__sigtramp1.S                 |   54 ------
 lib/libc/arch/mips/sys/msgctl.S                      |   45 -----
 lib/libc/arch/mips/sys/shmctl.S                      |   45 -----
 lib/libc/arch/mips/sys/sigaction.S                   |   45 -----
 lib/libc/arch/mips/sys/sigpending.S                  |   60 -------
 lib/libc/arch/mips/sys/sigprocmask.S                 |   68 --------
 lib/libc/arch/mips/sys/sigreturn.S                   |   49 ------
 lib/libc/arch/mips/sys/sigsuspend.S                  |   60 -------
 lib/libc/compat/arch/mips/Makefile.inc               |    4 +
 lib/libc/compat/arch/mips/gen/Makefile.inc           |   10 +
 lib/libc/compat/arch/mips/gen/compat__setjmp.S       |  151 +++++++++++++++++++
 lib/libc/compat/arch/mips/gen/compat_setjmp.S        |  144 ++++++++++++++++++
 lib/libc/compat/arch/mips/gen/compat_sigsetjmp.S     |   88 +++++++++++
 lib/libc/compat/arch/mips/sys/Makefile.inc           |    6 +
 lib/libc/compat/arch/mips/sys/compat_Ovfork.S        |   68 ++++++++
 lib/libc/compat/arch/mips/sys/compat___semctl.S      |   42 +++++
 lib/libc/compat/arch/mips/sys/compat___sigreturn14.S |   46 +++++
 lib/libc/compat/arch/mips/sys/compat___sigtramp1.S   |   54 ++++++
 lib/libc/compat/arch/mips/sys/compat_msgctl.S        |   45 +++++
 lib/libc/compat/arch/mips/sys/compat_shmctl.S        |   45 +++++
 lib/libc/compat/arch/mips/sys/compat_sigaction.S     |   45 +++++
 lib/libc/compat/arch/mips/sys/compat_sigpending.S    |   60 +++++++
 lib/libc/compat/arch/mips/sys/compat_sigprocmask.S   |   68 ++++++++
 lib/libc/compat/arch/mips/sys/compat_sigreturn.S     |   49 ++++++
 lib/libc/compat/arch/mips/sys/compat_sigsuspend.S    |   60 +++++++
 37 files changed, 1145 insertions(+), 1126 deletions(-)

diffs (truncated from 2506 to 300 lines):

diff -r 3073ae61a338 -r b7687ca086b1 lib/libc/arch/mips/Makefile.inc
--- a/lib/libc/arch/mips/Makefile.inc   Sat Sep 17 10:28:26 2005 +0000
+++ b/lib/libc/arch/mips/Makefile.inc   Sat Sep 17 11:49:39 2005 +0000
@@ -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 -r 3073ae61a338 -r b7687ca086b1 lib/libc/arch/mips/gen/Makefile.inc
--- a/lib/libc/arch/mips/gen/Makefile.inc       Sat Sep 17 10:28:26 2005 +0000
+++ b/lib/libc/arch/mips/gen/Makefile.inc       Sat Sep 17 11:49:39 2005 +0000
@@ -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+= 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 -r 3073ae61a338 -r b7687ca086b1 lib/libc/arch/mips/gen/__longjmp14.c
--- a/lib/libc/arch/mips/gen/__longjmp14.c      Sat Sep 17 10:28:26 2005 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*     $NetBSD: __longjmp14.c,v 1.5 2005/09/14 09:05:36 martin Exp $   */
-
-/*-
- * Copyright (c) 2003 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Christian Limpach and Matt Thomas.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "namespace.h"
-#include <sys/types.h>
-#include <ucontext.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <machine/regnum.h>
-
-#define __LIBC12_SOURCE__
-#include <setjmp.h>
-#include <compat/include/setjmp.h>
-
-void
-__longjmp14(jmp_buf env, int val)
-{
-       struct sigcontext *sc = (void *)env;
-       ucontext_t uc;
-
-       /* Ensure non-zero SP and sigcontext magic number is present */
-       if (sc->sc_regs[_R_SP] == 0 || sc->sc_regs[_R_ZERO] != 0xACEDBADE)
-               goto err;
-
-       /* Ensure non-zero return value */
-       if (val == 0)
-               val = 1;
-
-       /*
-        * Set _UC_{SET,CLR}STACK according to SS_ONSTACK.
-        *
-        * Restore the signal mask with sigprocmask() instead of _UC_SIGMASK,
-        * since libpthread may want to interpose on signal handling.
-        */
-       uc.uc_flags = _UC_CPU | (sc->sc_onstack ? _UC_SETSTACK : _UC_CLRSTACK);
-
-       sigprocmask(SIG_SETMASK, &sc->sc_mask, NULL);
-
-       /* Clear uc_link */
-       uc.uc_link = 0;
-
-       /* Save return value in context */
-       uc.uc_mcontext.__gregs[_R_V0] = val;
-
-       /* Copy saved registers */
-       uc.uc_mcontext.__gregs[_REG_S0] = sc->sc_regs[_R_S0];
-       uc.uc_mcontext.__gregs[_REG_S1] = sc->sc_regs[_R_S1];
-       uc.uc_mcontext.__gregs[_REG_S2] = sc->sc_regs[_R_S2];
-       uc.uc_mcontext.__gregs[_REG_S3] = sc->sc_regs[_R_S3];
-       uc.uc_mcontext.__gregs[_REG_S4] = sc->sc_regs[_R_S4];
-       uc.uc_mcontext.__gregs[_REG_S5] = sc->sc_regs[_R_S5];
-       uc.uc_mcontext.__gregs[_REG_S6] = sc->sc_regs[_R_S6];
-       uc.uc_mcontext.__gregs[_REG_S7] = sc->sc_regs[_R_S7];
-       uc.uc_mcontext.__gregs[_REG_S8] = sc->sc_regs[_R_S8];
-       uc.uc_mcontext.__gregs[_REG_SP] = sc->sc_regs[_R_SP];
-       uc.uc_mcontext.__gregs[_REG_RA] = sc->sc_regs[_R_RA];
-       uc.uc_mcontext.__gregs[_REG_EPC] = sc->sc_pc;
-
-       /* Copy FP state */
-       if (sc->sc_fpused) {
-               /* FP saved regs are $f20 .. $f31 */
-               memcpy(&uc.uc_mcontext.__fpregs.__fp_r.__fp_regs[20],
-                   &sc->sc_fpregs[20], 32 - 20);
-               uc.uc_mcontext.__fpregs.__fp_csr =
-                   sc->sc_fpregs[_R_FSR - _FPBASE];
-               /* XXX sc_fp_control */
-               uc.uc_flags |= _UC_FPU;
-       }
-
-       setcontext(&uc);
- err:
-       longjmperror();
-       abort();
-       /* NOTREACHED */
-}
diff -r 3073ae61a338 -r b7687ca086b1 lib/libc/arch/mips/gen/__setjmp14.S
--- a/lib/libc/arch/mips/gen/__setjmp14.S       Sat Sep 17 10:28:26 2005 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*     $NetBSD: __setjmp14.S,v 1.10 2004/03/23 02:21:49 simonb Exp $   */
-
-/*-
- * Copyright (c) 1991, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 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
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * 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>
-
-#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 $")
-#endif /* LIBC_SCCS and not lint */
-
-#ifdef __ABICALLS__
-       .abicalls
-#endif
-
-/*
- * C library -- setjmp, longjmp
- *
- *     longjmp(a,v)
- * will generate a "return(v)" from
- * the last call to
- *     setjmp(a)
- * by restoring registers from the stack,
- * and a struct sigcontext, see <signal.h>
- */
-
-#define SETJMP_FRAME_SIZE      (CALLFRAME_SIZ + 12)
-
-NON_LEAF(__setjmp14, SETJMP_FRAME_SIZE, ra)
-       .mask   0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ)
-#ifdef __ABICALLS__
-       .set    noreorder
-       .cpload t9
-       .set    reorder
-#endif
-       subu    sp, sp, SETJMP_FRAME_SIZE       # allocate stack frame
-#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. */
-       move    a0, zero
-       addu    a1, sp, CALLFRAME_SIZ   # pointer to struct sigaltstack
-       jal     _C_LABEL(__sigaltstack14)
-       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)            # 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 + _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
-       swc1    $f20, (20 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f21, (21 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f22, (22 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f23, (23 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f24, (24 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f25, (25 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f26, (26 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f27, (27 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       swc1    $f28, (28 * 4 + _OFFSETOF_SC_FPREGS)(a0)
-       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)
-       move    v0, zero
-       j       ra
-       REG_EPILOGUE
-botch:
-       jal     _C_LABEL(abort)
-END(__setjmp14)
diff -r 3073ae61a338 -r b7687ca086b1 lib/libc/arch/mips/gen/__sigsetjmp14.S
--- a/lib/libc/arch/mips/gen/__sigsetjmp14.S    Sat Sep 17 10:28:26 2005 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*     $NetBSD: __sigsetjmp14.S,v 1.4 2003/08/07 16:42:15 agc Exp $    */
-
-/*-
- * Copyright (c) 1991, 1993, 1995,
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Havard Eidnes.



Home | Main Index | Thread Index | Old Index