Module Name: src Committed By: martin Date: Mon Jun 17 16:48:57 UTC 2024
Modified Files: src/sys/arch/vax/include [netbsd-10]: mcontext.h src/sys/arch/vax/vax [netbsd-10]: machdep.c sig_machdep.c Log Message: Pull up following revision(s) (requested by thorpej in ticket #694): sys/arch/vax/vax/sig_machdep.c: revision 1.27 sys/arch/vax/include/mcontext.h: revision 1.11 sys/arch/vax/vax/machdep.c: revision 1.200 Implement _UC_SETSTACK / _UC_CLRSTACK. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.26.1 src/sys/arch/vax/include/mcontext.h cvs rdiff -u -r1.196.20.2 -r1.196.20.3 src/sys/arch/vax/vax/machdep.c cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/arch/vax/vax/sig_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/vax/include/mcontext.h diff -u src/sys/arch/vax/include/mcontext.h:1.10 src/sys/arch/vax/include/mcontext.h:1.10.26.1 --- src/sys/arch/vax/include/mcontext.h:1.10 Fri Dec 27 00:32:17 2019 +++ src/sys/arch/vax/include/mcontext.h Mon Jun 17 16:48:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $ */ +/* $NetBSD: mcontext.h,v 1.10.26.1 2024/06/17 16:48:57 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -65,7 +65,9 @@ typedef struct { } mcontext_t; /* Machine-dependent uc_flags */ -#define _UC_TLSBASE 0x00080000 +#define _UC_SETSTACK 0x00010000 +#define _UC_CLRSTACK 0x00020000 +#define _UC_TLSBASE 0x00080000 #define _UC_MACHINE_SP(uc) ((uc)->uc_mcontext.__gregs[_REG_SP]) #define _UC_MACHINE_FP(uc) ((uc)->uc_mcontext.__gregs[_REG_FP]) Index: src/sys/arch/vax/vax/machdep.c diff -u src/sys/arch/vax/vax/machdep.c:1.196.20.2 src/sys/arch/vax/vax/machdep.c:1.196.20.3 --- src/sys/arch/vax/vax/machdep.c:1.196.20.2 Sat Feb 17 15:50:20 2024 +++ src/sys/arch/vax/vax/machdep.c Mon Jun 17 16:48:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.196.20.2 2024/02/17 15:50:20 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.196.20.3 2024/06/17 16:48:57 martin Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -83,7 +83,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196.20.2 2024/02/17 15:50:20 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.196.20.3 2024/06/17 16:48:57 martin Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -701,6 +701,14 @@ cpu_setmcontext(struct lwp *l, const mco lwp_setprivate(l, tlsbase); tf->tf_sp += sizeof(tlsbase); } + + mutex_enter(l->l_proc->p_lock); + if (flags & _UC_SETSTACK) + l->l_sigstk.ss_flags |= SS_ONSTACK; + if (flags & _UC_CLRSTACK) + l->l_sigstk.ss_flags &= ~SS_ONSTACK; + mutex_exit(l->l_proc->p_lock); + return 0; } Index: src/sys/arch/vax/vax/sig_machdep.c diff -u src/sys/arch/vax/vax/sig_machdep.c:1.26 src/sys/arch/vax/vax/sig_machdep.c:1.26.4.1 --- src/sys/arch/vax/vax/sig_machdep.c:1.26 Mon Nov 1 05:07:16 2021 +++ src/sys/arch/vax/vax/sig_machdep.c Mon Jun 17 16:48:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: sig_machdep.c,v 1.26 2021/11/01 05:07:16 thorpej Exp $ */ +/* $NetBSD: sig_machdep.c,v 1.26.4.1 2024/06/17 16:48:57 martin Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.26 2021/11/01 05:07:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.26.4.1 2024/06/17 16:48:57 martin Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -171,6 +171,8 @@ setupstack_siginfo3(const struct ksiginf uc.uc_flags = _UC_SIGMASK; uc.uc_sigmask = *mask; uc.uc_link = l->l_ctxlink; + uc.uc_flags |= (l->l_sigstk.ss_flags & SS_ONSTACK) + ? _UC_SETSTACK : _UC_CLRSTACK; sendsig_reset(l, ksi->ksi_signo); mutex_exit(p->p_lock); cpu_getmcontext(l, &uc.uc_mcontext, &uc.uc_flags);