Module Name: src
Committed By: thorpej
Date: Fri May 17 21:37:07 UTC 2024
Modified Files:
src/sys/arch/vax/include: mcontext.h
src/sys/arch/vax/vax: machdep.c sig_machdep.c
Log Message:
Implement _UC_SETSTACK / _UC_CLRSTACK.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/include/mcontext.h
cvs rdiff -u -r1.199 -r1.200 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.26 -r1.27 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.11
--- src/sys/arch/vax/include/mcontext.h:1.10 Fri Dec 27 00:32:17 2019
+++ src/sys/arch/vax/include/mcontext.h Fri May 17 21:37:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $ */
+/* $NetBSD: mcontext.h,v 1.11 2024/05/17 21:37:07 thorpej 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.199 src/sys/arch/vax/vax/machdep.c:1.200
--- src/sys/arch/vax/vax/machdep.c:1.199 Tue Mar 5 14:15:36 2024
+++ src/sys/arch/vax/vax/machdep.c Fri May 17 21:37:07 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.199 2024/03/05 14:15:36 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.200 2024/05/17 21:37:07 thorpej 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.199 2024/03/05 14:15:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2024/05/17 21:37:07 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -696,6 +696,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.27
--- 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 Fri May 17 21:37:07 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.27 2024/05/17 21:37:07 thorpej 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.27 2024/05/17 21:37:07 thorpej 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);