Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/include Merge all MD __sigaction14_sigtramp.c c...



details:   https://anonhg.NetBSD.org/src/rev/9c79aad770f0
branches:  trunk
changeset: 990409:9c79aad770f0
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Oct 26 16:16:34 2021 +0000

description:
Merge all MD __sigaction14_sigtramp.c copies into one:
- sparc and sparc64 were not using version 0 sigcontext when there were
  no arguments in the signal version. This was probably a bug.
- vax is using +1 the version numbers of the other archs.
- Only hppa was defining __LIBC12_SOURCE__ so it was getting a working
  sigcontext before. all the other ports that supported sigcontext had
  the compat code disabled.
[pointed out by thorpej, thanks!]
If we want to remove sigcontext support from userland at least now there
is less work to do so.

diffstat:

 lib/libc/arch/aarch64/sys/__sigaction14_sigtramp.c   |  79 ----------------
 lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c     |  74 ---------------
 lib/libc/arch/arm/sys/__sigaction14_sigtramp.c       |  79 ----------------
 lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c      |  53 -----------
 lib/libc/arch/i386/sys/__sigaction14_sigtramp.c      |  79 ----------------
 lib/libc/arch/ia64/sys/__sigaction14_sigtramp.c      |  74 ---------------
 lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c      |  82 -----------------
 lib/libc/arch/mips/sys/__sigaction14_sigtramp.c      |  79 ----------------
 lib/libc/arch/or1k/sys/__sigaction14_sigtramp.c      |  82 -----------------
 lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c   |  82 -----------------
 lib/libc/arch/powerpc64/sys/__sigaction14_sigtramp.c |  82 -----------------
 lib/libc/arch/riscv/sys/__sigaction14_sigtramp.c     |  79 ----------------
 lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c       |  76 ----------------
 lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c     |  72 ---------------
 lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c   |  72 ---------------
 lib/libc/arch/vax/sys/__sigaction14_sigtramp.c       |  81 -----------------
 lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c    |  65 -------------
 lib/libc/sys/Makefile.inc                            |   4 +-
 lib/libc/sys/__sigaction14_sigtramp.c                |  94 ++++++++++++++++++++
 sys/arch/alpha/include/signal.h                      |   3 +-
 sys/arch/arm/include/signal.h                        |   3 +-
 sys/arch/hppa/include/signal.h                       |   5 +-
 sys/arch/i386/include/signal.h                       |   3 +-
 sys/arch/m68k/include/signal.h                       |   3 +-
 sys/arch/mips/include/signal.h                       |   3 +-
 sys/arch/powerpc/include/signal.h                    |   3 +-
 sys/arch/sh3/include/signal.h                        |   3 +-
 sys/arch/sparc/include/signal.h                      |   3 +-
 sys/arch/vax/include/signal.h                        |   6 +-
 29 files changed, 120 insertions(+), 1303 deletions(-)

diffs (truncated from 1656 to 300 lines):

diff -r 189dadbd2859 -r 9c79aad770f0 lib/libc/arch/aarch64/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/aarch64/sys/__sigaction14_sigtramp.c        Tue Oct 26 10:07:20 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.1 2014/08/10 05:47:37 matt Exp $  */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * 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.
- *
- * 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __sigaction14_sigtramp.c,v 1.1 2014/08/10 05:47:37 matt Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <stddef.h>
-#include <signal.h>
-#include <errno.h>
-
-#include "extern.h"
-
-__weak_alias(__sigaction14, __libc_sigaction14)
-
-int
-__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
-{
-       extern const int __sigtramp_siginfo_2[];
-
-       /*
-        * If no sigaction, use the "default" trampoline since it won't
-        * be used.
-        */
-       if (act == NULL)
-               return  __sigaction_sigtramp(sig, act, oact, NULL, 0);
-
-#ifdef __LIBC12_SOURCE__
-       /*
-        * We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
-        * set in the sigaction.
-        */
-       if ((act->sa_flags & SA_SIGINFO) == 0) {
-               extern const int __sigtramp_sigcontext_1[];
-               int sav = errno;
-               int rv =  __sigaction_sigtramp(sig, act, oact,
-                   __sigtramp_sigcontext_1, 1);
-               if (rv >= 0 || errno != EINVAL)
-                       return rv;
-               errno = sav;
-       }
-#endif
-
-       /*
-        * If SA_SIGINFO was specificed or the compatibility trampolines
-        * can't be used, use the siginfo trampoline.
-        */
-       return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
-}
diff -r 189dadbd2859 -r 9c79aad770f0 lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c  Tue Oct 26 10:07:20 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.7 2008/04/28 20:22:55 martin Exp $        */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * 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.
- *
- * 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 <sys/types.h>
-#include <stddef.h>
-#include <signal.h>
-#include <errno.h>
-
-#include "extern.h"
-
-__weak_alias(__sigaction14, __libc_sigaction14)
-
-int
-__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
-{
-       extern const int __sigtramp_siginfo_2[];
-
-       /*
-        * If no sigaction, use the "default" trampoline since it won't
-        * be used.
-        */
-       if (act == NULL)
-               return  __sigaction_sigtramp(sig, act, oact, NULL, 0);
-
-#ifdef __LIBC12_SOURCE__
-       /*
-        * We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
-        * set in the sigaction.
-        */
-       if ((act->sa_flags & SA_SIGINFO) == 0) {
-               extern const int __sigtramp_sigcontext_1[];
-               int sav = errno;
-               int rv =  __sigaction_sigtramp(sig, act, oact,
-                   __sigtramp_sigcontext_1, 1);
-               if (rv >= 0 || errno != EINVAL)
-                       return rv;
-               errno = sav;
-       }
-#endif
-
-       /*
-        * If SA_SIGINFO was specified or the compatibility trampolines
-        * can't be used, use the siginfo trampoline.
-        */
-       return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
-}
diff -r 189dadbd2859 -r 9c79aad770f0 lib/libc/arch/arm/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/arm/sys/__sigaction14_sigtramp.c    Tue Oct 26 10:07:20 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.7 2008/04/28 20:22:55 martin Exp $        */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * 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.
- *
- * 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __sigaction14_sigtramp.c,v 1.7 2008/04/28 20:22:55 martin Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/types.h>
-#include <stddef.h>
-#include <signal.h>
-#include <errno.h>
-
-#include "extern.h"
-
-__weak_alias(__sigaction14, __libc_sigaction14)
-
-int
-__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
-{
-       extern const int __sigtramp_siginfo_2[];
-
-       /*
-        * If no sigaction, use the "default" trampoline since it won't
-        * be used.
-        */
-       if (act == NULL)
-               return  __sigaction_sigtramp(sig, act, oact, NULL, 0);
-
-#ifdef __LIBC12_SOURCE__
-       /*
-        * We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
-        * set in the sigaction.
-        */
-       if ((act->sa_flags & SA_SIGINFO) == 0) {
-               extern const int __sigtramp_sigcontext_1[];
-               int sav = errno;
-               int rv =  __sigaction_sigtramp(sig, act, oact,
-                   __sigtramp_sigcontext_1, 1);
-               if (rv >= 0 || errno != EINVAL)
-                       return rv;
-               errno = sav;
-       }
-#endif
-
-       /*
-        * If SA_SIGINFO was specificed or the compatibility trampolines
-        * can't be used, use the siginfo trampoline.
-        */
-       return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
-}
diff -r 189dadbd2859 -r 9c79aad770f0 lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c   Tue Oct 26 10:07:20 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.4 2008/04/28 20:22:56 martin Exp $        */
-
-/*-
- * Copyright (c) 2002 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe.
- *
- * 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.
- *
- * 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 <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: __sigaction14_sigtramp.c,v 1.4 2008/04/28 20:22:56 martin Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#define        __LIBC12_SOURCE__
-
-#include <sys/types.h>
-#include <signal.h>
-
-#include "extern.h"
-
-__weak_alias(__sigaction14, __libc_sigaction14)
-
-int
-__libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
-{
-       extern int __sigtramp_siginfo_2[];
-
-       return (__sigaction_sigtramp(sig, act, oact,
-                                    __sigtramp_siginfo_2, 2));



Home | Main Index | Thread Index | Old Index