Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Use the signal trampoline version constants from <s...



details:   https://anonhg.NetBSD.org/src/rev/6cee863acb20
branches:  trunk
changeset: 1024518:6cee863acb20
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Oct 27 04:14:59 2021 +0000

description:
Use the signal trampoline version constants from <sys/signal.h>.

diffstat:

 sys/arch/aarch64/aarch64/netbsd32_machdep.c    |   7 ++++---
 sys/arch/aarch64/aarch64/sig_machdep.c         |   6 +++---
 sys/arch/alpha/alpha/compat_16_machdep.c       |   8 ++++----
 sys/arch/amd64/amd64/netbsd32_machdep.c        |  10 +++++-----
 sys/arch/amd64/amd64/netbsd32_machdep_16.c     |  11 ++++++-----
 sys/arch/arm/arm/compat_16_machdep.c           |   8 ++++----
 sys/arch/hppa/hppa/sig_machdep.c               |   6 +++---
 sys/arch/i386/i386/compat_16_machdep.c         |   8 ++++----
 sys/arch/m68k/m68k/compat_16_machdep.c         |   8 ++++----
 sys/arch/mips/mips/compat_16_machdep.c         |   8 ++++----
 sys/arch/mips/mips/netbsd32_machdep.c          |  10 +++++-----
 sys/arch/mips/mips/netbsd32_machdep_16.c       |   7 ++++---
 sys/arch/powerpc/powerpc/compat_16_machdep.c   |   8 ++++----
 sys/arch/powerpc/powerpc/sig_machdep.c         |   6 +++---
 sys/arch/sh3/sh3/compat_16_machdep.c           |   8 ++++----
 sys/arch/sparc/sparc/compat_16_machdep.c       |   8 ++++----
 sys/arch/sparc/sparc/machdep.c                 |   6 +++---
 sys/arch/sparc64/sparc64/compat_16_machdep.c   |   8 ++++----
 sys/arch/sparc64/sparc64/netbsd32_machdep.c    |   6 +++---
 sys/arch/sparc64/sparc64/netbsd32_machdep_16.c |   7 ++++---
 sys/arch/vax/vax/sig_machdep.c                 |   7 ++++---
 21 files changed, 83 insertions(+), 78 deletions(-)

diffs (truncated from 653 to 300 lines):

diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/aarch64/aarch64/netbsd32_machdep.c
--- a/sys/arch/aarch64/aarch64/netbsd32_machdep.c       Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/aarch64/aarch64/netbsd32_machdep.c       Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.19 2021/09/23 15:19:03 ryo Exp $        */
+/*     $NetBSD: netbsd32_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $    */
 
 /*
  * Copyright (c) 2018 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.19 2021/09/23 15:19:03 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -379,7 +379,8 @@
 {
 #ifdef COMPAT_16
 #error non EABI generation binaries are not supported
-       if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
+       if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers <
+           __SIGTRAMP_SIGINFO_VERSION)
                netbsd32_sendsig_sigcontext(ksi, mask);
        else
 #endif
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/aarch64/aarch64/sig_machdep.c
--- a/sys/arch/aarch64/aarch64/sig_machdep.c    Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/aarch64/aarch64/sig_machdep.c    Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.7 2021/10/27 04:14:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.6 2021/09/23 15:19:03 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sig_machdep.c,v 1.7 2021/10/27 04:14:59 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -87,7 +87,7 @@
 
        mutex_enter(p->p_lock);
 
-       if (error || sd->sd_vers != 2) {
+       if (error || sd->sd_vers != __SIGTRAMP_SIGINFO_VERSION) {
                /*
                 * Thread has trashed its stack.  Blow it away.
                 */
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/alpha/alpha/compat_16_machdep.c
--- a/sys/arch/alpha/alpha/compat_16_machdep.c  Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/alpha/alpha/compat_16_machdep.c  Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_16_machdep.c,v 1.22 2019/03/25 19:24:30 maxv Exp $ */
+/* $NetBSD: compat_16_machdep.c,v 1.23 2021/10/27 04:14:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -85,7 +85,7 @@
 #include <machine/cpu.h>
 #include <machine/reg.h>
 
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.22 2019/03/25 19:24:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.23 2021/10/27 04:14:59 thorpej Exp $");
 
 
 #ifdef DEBUG
@@ -192,13 +192,13 @@
         * dependent code in libc.
         */
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:         /* legacy on-stack sigtramp */
+       case __SIGTRAMP_SIGCODE_VERSION:        /* legacy on-stack sigtramp */
                buildcontext(l,(void *)catcher,
                             (void *)p->p_sigctx.ps_sigcode,
                             (void *)fp);
                break;
 #ifdef COMPAT_16
-       case 1:
+       case __SIGTRAMP_SIGCONTEXT_VERSION:
                buildcontext(l,(void *)catcher,
                             (const void *)ps->sa_sigdesc[sig].sd_tramp,
                             (void *)fp);
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.137 2020/11/20 17:44:56 thorpej Exp $   */
+/*     $NetBSD: netbsd32_machdep.c,v 1.138 2021/10/27 04:14:59 thorpej Exp $   */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.137 2020/11/20 17:44:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.138 2021/10/27 04:14:59 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -236,13 +236,13 @@
 
        /* Build stack frame for signal trampoline. */
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:         /* handled by sendsig_sigcontext */
-       case 1:         /* handled by sendsig_sigcontext */
+       case __SIGTRAMP_SIGCODE_VERSION:     /* handled by sendsig_sigcontext */
+       case __SIGTRAMP_SIGCONTEXT_VERSION: /* handled by sendsig_sigcontext */
        default:        /* unknown version */
                printf("nsendsig: bad version %d\n",
                    ps->sa_sigdesc[sig].sd_vers);
                sigexit(l, SIGILL);
-       case 2:
+       case __SIGTRAMP_SIGINFO_VERSION:
                break;
        }
 
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/amd64/amd64/netbsd32_machdep_16.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep_16.c        Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $ */
+/*     $NetBSD: netbsd32_machdep_16.c,v 1.6 2021/10/27 04:14:59 thorpej Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.5 2019/12/12 02:15:42 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.6 2021/10/27 04:14:59 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -118,10 +118,10 @@
 
        /* Build stack frame for signal trampoline. */
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:
+       case __SIGTRAMP_SIGCODE_VERSION:
                frame.sf_ra = (uint32_t)(u_long)p->p_sigctx.ps_sigcode;
                break;
-       case 1:
+       case __SIGTRAMP_SIGCONTEXT_VERSION:
                frame.sf_ra = (uint32_t)(u_long)ps->sa_sigdesc[sig].sd_tramp;
                break;
        default:
@@ -179,7 +179,8 @@
 void
 netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-       if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers < 2)
+       if (curproc->p_sigacts->sa_sigdesc[ksi->ksi_signo].sd_vers <
+           __SIGTRAMP_SIGINFO_VERSION)
                netbsd32_sendsig_sigcontext(ksi, mask);
        else
                netbsd32_sendsig_siginfo(ksi, mask);
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/arm/arm/compat_16_machdep.c
--- a/sys/arch/arm/arm/compat_16_machdep.c      Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/arm/arm/compat_16_machdep.c      Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.19 2021/02/01 19:31:34 skrll Exp $     */
+/*     $NetBSD: compat_16_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $   */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.19 2021/02/01 19:31:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.20 2021/10/27 04:14:59 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -174,12 +174,12 @@
        tf->tf_usr_sp = (int)fp;
        
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:         /* legacy on-stack sigtramp */
+       case __SIGTRAMP_SIGCODE_VERSION:        /* legacy on-stack sigtramp */
                tf->tf_usr_lr = (int)p->p_sigctx.ps_sigcode;
                /* XXX This should not be needed. */
                cpu_icache_sync_all();
                break;
-       case 1:
+       case __SIGTRAMP_SIGCONTEXT_VERSION:
                tf->tf_usr_lr = (int)ps->sa_sigdesc[sig].sd_tramp;
                break;
 
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/hppa/hppa/sig_machdep.c
--- a/sys/arch/hppa/hppa/sig_machdep.c  Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/hppa/hppa/sig_machdep.c  Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.27 2019/04/15 20:45:08 skrll Exp $   */
+/*     $NetBSD: sig_machdep.c,v 1.28 2021/10/27 04:14:59 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.27 2019/04/15 20:45:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.28 2021/10/27 04:14:59 thorpej Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -137,7 +137,7 @@
                printf("sendsig_siginfo: bad version %d\n",
                       ps->sa_sigdesc[sig].sd_vers);
                sigexit(l, SIGILL);
-       case 2:
+       case __SIGTRAMP_SIGINFO_VERSION:
                break;
        }
 
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/i386/i386/compat_16_machdep.c
--- a/sys/arch/i386/i386/compat_16_machdep.c    Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/i386/i386/compat_16_machdep.c    Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.32 2019/05/19 08:49:08 maxv Exp $      */
+/*     $NetBSD: compat_16_machdep.c,v 1.33 2021/10/27 04:14:59 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.32 2019/05/19 08:49:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.33 2021/10/27 04:14:59 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -163,11 +163,11 @@
 
        /* Build stack frame for signal trampoline. */
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:         /* legacy on-stack sigtramp */
+       case __SIGTRAMP_SIGCODE_VERSION:        /* legacy on-stack sigtramp */
                frame.sf_ra = (int)p->p_sigctx.ps_sigcode;
                break;
 
-       case 1:
+       case __SIGTRAMP_SIGCONTEXT_VERSION:
                frame.sf_ra = (int)ps->sa_sigdesc[sig].sd_tramp;
                break;
 
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/m68k/m68k/compat_16_machdep.c
--- a/sys/arch/m68k/m68k/compat_16_machdep.c    Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/m68k/m68k/compat_16_machdep.c    Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*    $NetBSD: compat_16_machdep.c,v 1.17 2019/04/06 03:06:26 thorpej Exp $   */
+/*    $NetBSD: compat_16_machdep.c,v 1.18 2021/10/27 04:14:59 thorpej Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.17 2019/04/06 03:06:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.18 2021/10/27 04:14:59 thorpej Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -105,11 +105,11 @@
 
        /* Build stack frame for signal trampoline. */
        switch (ps->sa_sigdesc[sig].sd_vers) {
-       case 0:         /* legacy on-stack sigtramp */
+       case __SIGTRAMP_SIGCODE_VERSION:        /* legacy on-stack sigtramp */
                kf.sf_ra = (int)p->p_sigctx.ps_sigcode;
                break;
 
-       case 1:
+       case __SIGTRAMP_SIGCONTEXT_VERSION:
                kf.sf_ra = (int)ps->sa_sigdesc[sig].sd_tramp;
                break;
 
diff -r dccf9fa80b27 -r 6cee863acb20 sys/arch/mips/mips/compat_16_machdep.c
--- a/sys/arch/mips/mips/compat_16_machdep.c    Wed Oct 27 04:10:47 2021 +0000
+++ b/sys/arch/mips/mips/compat_16_machdep.c    Wed Oct 27 04:14:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.22 2017/03/16 16:13:20 chs Exp $       */
+/*     $NetBSD: compat_16_machdep.c,v 1.23 2021/10/27 04:15:00 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
 



Home | Main Index | Thread Index | Old Index