Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/arch New __sigaction14() system call stub which reg...



details:   https://anonhg.NetBSD.org/src/rev/234c8cc3be5c
branches:  trunk
changeset: 533816:234c8cc3be5c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jul 09 23:32:35 2002 +0000

description:
New __sigaction14() system call stub which registers the signal
trampoline, and the signal trampolines themselves.

NOTE: These are not yet enabled; they will be enabled after further
testing on more architectures.

diffstat:

 lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c   |   58 +++++++
 lib/libc/arch/alpha/sys/__sigtramp1.S              |   45 +++++
 lib/libc/arch/arm/sys/__sigaction14_sigtramp.c     |   58 +++++++
 lib/libc/arch/arm/sys/__sigtramp1.S                |   54 ++++++
 lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c    |   58 +++++++
 lib/libc/arch/hppa/sys/__sigtramp1.S               |  112 +++++++++++++
 lib/libc/arch/i386/sys/__sigaction14_sigtramp.c    |   58 +++++++
 lib/libc/arch/i386/sys/__sigtramp1.S               |   58 +++++++
 lib/libc/arch/m68k/sys/__sigaction14_sigtramp.c    |   58 +++++++
 lib/libc/arch/m68k/sys/__sigtramp1.S               |   58 +++++++
 lib/libc/arch/mips/sys/__sigaction14_sigtramp.c    |   58 +++++++
 lib/libc/arch/mips/sys/__sigtramp1.S               |   54 ++++++
 lib/libc/arch/ns32k/sys/__sigaction14_sigtramp.c   |   58 +++++++
 lib/libc/arch/ns32k/sys/__sigtramp1.S              |   57 +++++++
 lib/libc/arch/powerpc/sys/__sigaction14_sigtramp.c |   58 +++++++
 lib/libc/arch/powerpc/sys/__sigtramp1.S            |   56 ++++++
 lib/libc/arch/sh3/sys/__sigaction14_sigtramp.c     |   58 +++++++
 lib/libc/arch/sh3/sys/__sigtramp1.S                |   53 ++++++
 lib/libc/arch/sparc/sys/__sigaction14_sigtramp.c   |   58 +++++++
 lib/libc/arch/sparc/sys/__sigtramp1.S              |  170 +++++++++++++++++++++
 lib/libc/arch/sparc64/sys/__sigaction14_sigtramp.c |   58 +++++++
 lib/libc/arch/sparc64/sys/__sigtramp1.S            |  166 ++++++++++++++++++++
 lib/libc/arch/vax/sys/__sigaction14_sigtramp.c     |   58 +++++++
 lib/libc/arch/vax/sys/__sigtramp1.S                |   47 +++++
 lib/libc/arch/x86_64/sys/__sigaction14_sigtramp.c  |   58 +++++++
 lib/libc/arch/x86_64/sys/__sigtramp1.S             |   58 +++++++
 26 files changed, 1742 insertions(+), 0 deletions(-)

diffs (truncated from 1846 to 300 lines):

diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/alpha/sys/__sigaction14_sigtramp.c  Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,58 @@
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.1 2002/07/09 23:32:35 thorpej 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.
+ * 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.
+ */
+
+#define        __LIBC12_SOURCE__
+
+#include <sys/types.h>
+#include <signal.h>
+
+#include "extern.h"
+
+int
+__sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+       extern int __sigtramp_sigcontext_1[];
+
+       /*
+        * Right here we should select the SA_SIGINFO trampoline
+        * if SA_SIGINFO is set in the sigaction.
+        */
+
+       return (__sigaction_sigtramp(sig, act, oact,
+                                    __sigtramp_sigcontext_1, 1));
+}
diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/alpha/sys/__sigtramp1.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/alpha/sys/__sigtramp1.S     Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,45 @@
+/*     $NetBSD: __sigtramp1.S,v 1.1 2002/07/09 23:32:35 thorpej Exp $  */
+
+/*
+ * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#include "SYS.h"
+
+/*
+ * The Alpha 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
+ */
+NESTED_NOPROFILE(__sigtramp_sigcontext_1,0,0,ra,0,0)
+       mov     sp, a0                  /* get pointer to sigcontext */
+       CALLSYS_NOERROR(__sigreturn14)  /* and call sigreturn() with it */
+       mov     v0, a0                  /* if that failed, get error code */
+       CALLSYS_NOERROR(exit)           /* and call exit() with it */
+END(__sigtramp_sigcontext_1)
diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/arm/sys/__sigaction14_sigtramp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/arm/sys/__sigaction14_sigtramp.c    Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,58 @@
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.1 2002/07/09 23:32:36 thorpej 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.
+ * 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.
+ */
+
+#define        __LIBC12_SOURCE__
+
+#include <sys/types.h>
+#include <signal.h>
+
+#include "extern.h"
+
+int
+__sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+       extern int __sigtramp_sigcontext_1[];
+
+       /*
+        * Right here we should select the SA_SIGINFO trampoline
+        * if SA_SIGINFO is set in the sigaction.
+        */
+
+       return (__sigaction_sigtramp(sig, act, oact,
+                                    __sigtramp_sigcontext_1, 1));
+}
diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/arm/sys/__sigtramp1.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/arm/sys/__sigtramp1.S       Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,54 @@
+/*     $NetBSD: __sigtramp1.S,v 1.1 2002/07/09 23:32:36 thorpej 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.
+ * 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 "SYS.h"
+
+/*
+ * The ARM 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
+ */
+ENTRY_NP(__sigtramp_sigcontext_1)
+       mov     r0, sp                  /* get pointer to sigcontext */
+       SYSTRAP(__sigreturn14)          /* and call sigreturn */
+
+       /* If that failed, exit with the error code. */
+       SYSTRAP(exit)
diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/hppa/sys/__sigaction14_sigtramp.c   Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,58 @@
+/*     $NetBSD: __sigaction14_sigtramp.c,v 1.1 2002/07/09 23:32:36 thorpej 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.
+ * 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.
+ */
+
+#define        __LIBC12_SOURCE__
+
+#include <sys/types.h>
+#include <signal.h>
+
+#include "extern.h"
+
+int
+__sigaction14(int sig, const struct sigaction *act, struct sigaction *oact)
+{
+       extern int __sigtramp_sigcontext_1[];
+
+       /*
+        * Right here we should select the SA_SIGINFO trampoline
+        * if SA_SIGINFO is set in the sigaction.
+        */
+
+       return (__sigaction_sigtramp(sig, act, oact,
+                                    __sigtramp_sigcontext_1, 1));
+}
diff -r 2836739f25d9 -r 234c8cc3be5c lib/libc/arch/hppa/sys/__sigtramp1.S
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/arch/hppa/sys/__sigtramp1.S      Tue Jul 09 23:32:35 2002 +0000
@@ -0,0 +1,112 @@
+/*     $NetBSD: __sigtramp1.S,v 1.1 2002/07/09 23:32:36 thorpej Exp $  */
+
+/*



Home | Main Index | Thread Index | Old Index