Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch/x86_64 kill sigcontext passing to signal handl...



details:   https://anonhg.NetBSD.org/src/rev/4ed708ba1f3b
branches:  trunk
changeset: 559888:4ed708ba1f3b
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Mar 25 14:21:29 2004 +0000

description:
kill sigcontext passing to signal handlers, we don't have to worry
about compatibility

diffstat:

 lib/libc/arch/x86_64/Makefile.inc                 |   4 +-
 lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c |  23 ++-------
 lib/libc/arch/x86_64/sys/__sigtramp1.S            |  54 -----------------------
 3 files changed, 7 insertions(+), 74 deletions(-)

diffs (118 lines):

diff -r cd303362346d -r 4ed708ba1f3b lib/libc/arch/x86_64/Makefile.inc
--- a/lib/libc/arch/x86_64/Makefile.inc Thu Mar 25 14:10:08 2004 +0000
+++ b/lib/libc/arch/x86_64/Makefile.inc Thu Mar 25 14:21:29 2004 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile.inc,v 1.3 2003/10/06 22:57:23 fvdl Exp $
+#      $NetBSD: Makefile.inc,v 1.4 2004/03/25 14:21:29 drochner Exp $
 
 KMSRCS=        bcmp.S bcopy.S bzero.S ffs.S index.S rindex.S \
        memchr.S memcmp.S memcpy.S memmove.S memset.S \
        strcat.S strchr.S strcmp.S strcpy.S strlen.S strrchr.S
 
-SRCS+= __sigaction14_sigtramp.c __sigtramp1.S __sigtramp2.S
+SRCS+= __sigaction14_sigtramp.c __sigtramp2.S
diff -r cd303362346d -r 4ed708ba1f3b lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c
--- a/lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c Thu Mar 25 14:10:08 2004 +0000
+++ b/lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c Thu Mar 25 14:21:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: __sigaction14_sigtramp.c,v 1.6 2004/03/23 16:19:41 drochner Exp $      */
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.7 2004/03/25 14:21:29 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -50,33 +50,20 @@
 int
 __libc_sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
 {
-       extern const int __sigtramp_sigcontext_1[];
        extern const int __sigtramp_siginfo_2[];
-       int rv;
 
+#if 0
        /*
         * If no sigaction, use the "default" trampoline since it won't
         * be used.
         */
        if (act == NULL)
                return  __sigaction_sigtramp(sig, act, oact, NULL, 0);
+#endif
 
        /*
-        * We select the non-SA_SIGINFO trampoline if SA_SIGINFO is not
-        * set in the sigaction.
-        */
-       if ((act->sa_flags & SA_SIGINFO) == 0) {
-               int sav = errno;
-               rv =  __sigaction_sigtramp(sig, act, oact,
-                   __sigtramp_sigcontext_1, 1);
-               if (rv >= 0 || errno != EINVAL)
-                       return rv;
-               errno = sav;
-       }
-
-       /*
-        * If SA_SIGINFO was specified or the compatibility trampolines
-        * can't be used, use the siginfo trampoline.
+        * Don't provide sigcontext compatibility,
+        * always use the siginfo trampoline.
         */
        return __sigaction_sigtramp(sig, act, oact, __sigtramp_siginfo_2, 2);
 }
diff -r cd303362346d -r 4ed708ba1f3b lib/libc/arch/x86_64/sys/__sigtramp1.S
--- a/lib/libc/arch/x86_64/sys/__sigtramp1.S    Thu Mar 25 14:10:08 2004 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*     $NetBSD: __sigtramp1.S,v 1.4 2003/03/15 12:34:33 fvdl Exp $     */
-
-/*
- * Copyright (c) 2001 Wasabi Systems, Inc.
- * All rights reserved.
- *
- * Written by Frank van der Linden for Wasabi Systems, Inc.
- *
- * 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 for the NetBSD Project by
- *      Wasabi Systems, Inc.
- * 4. The name of Wasabi Systems, Inc. may not be used to endorse
- *    or promote products derived from this software without specific prior
- *    written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
- * 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.h"
-
-/*
- * The x86-64 signal trampoline is invoked only to return from
- * the signal; the kernel calls the signal handler directly.
- *
- * On entry, the stack looks like:
- *
- *     sp->    sigcontext structure
- */
-NENTRY(__sigtramp_sigcontext_1)
-       movq    %rsp,%rdi
-       pushq   %rdi                    /* fake return address */
-       movl    $SYS___sigreturn14,%eax
-       int     $0x80                   /* to avoid clobbering registers */
-       movl    $SYS_exit,%eax
-       syscall



Home | Main Index | Thread Index | Old Index