Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys SA_SIGINFO support for m68k (compat sunos)
details: https://anonhg.NetBSD.org/src/rev/7d6d6949460e
branches: trunk
changeset: 552257:7d6d6949460e
user: cl <cl%NetBSD.org@localhost>
date: Mon Sep 22 14:34:57 2003 +0000
description:
SA_SIGINFO support for m68k (compat sunos)
diffstat:
sys/arch/m68k/m68k/sunos_machdep.c | 41 ++++++++++---------------------------
sys/compat/sunos/sunos.h | 6 ++++-
2 files changed, 16 insertions(+), 31 deletions(-)
diffs (108 lines):
diff -r ea99de0daad3 -r 7d6d6949460e sys/arch/m68k/m68k/sunos_machdep.c
--- a/sys/arch/m68k/m68k/sunos_machdep.c Mon Sep 22 14:32:15 2003 +0000
+++ b/sys/arch/m68k/m68k/sunos_machdep.c Mon Sep 22 14:34:57 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos_machdep.c,v 1.24 2003/08/07 16:28:19 agc Exp $ */
+/* $NetBSD: sunos_machdep.c,v 1.25 2003/09/22 14:34:57 cl Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunos_machdep.c,v 1.24 2003/08/07 16:28:19 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunos_machdep.c,v 1.25 2003/09/22 14:34:57 cl Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -132,26 +132,17 @@
* SIG_DFL for "dangerous" signals.
*/
void
-sunos_sendsig(sig, mask, code)
- int sig;
- sigset_t *mask;
- u_long code;
+sunos_sendsig(ksiginfo_t *ksi, sigset_t *mask)
{
+ u_long code = ksi->ksi_trap;
+ int sig = ksi->ksi_signo;
struct lwp *l = curlwp;
struct proc *p = l->l_proc;
- struct sunos_sigframe *fp, kf;
- struct frame *frame;
- short ft;
- int onstack, fsize;
+ struct frame *frame = (struct frame *)l->l_md.md_regs;
+ int onstack;
+ struct sunos_sigframe *fp = getframe(l, sig, &onstack), kf;
sig_t catcher = SIGACTION(p, sig).sa_handler;
-
- frame = (struct frame *)l->l_md.md_regs;
- ft = frame->f_format;
-
- /* Do we need to jump onto the signal stack? */
- onstack =
- (p->p_sigctx.ps_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0 &&
- (SIGACTION(p, sig).sa_flags & SA_ONSTACK) != 0;
+ short ft = frame->f_format;
/*
* if this is a hardware fault (ft >= FMT9), sunos_sendsig
@@ -167,13 +158,6 @@
return;
}
- /* Allocate space for the signal handler context. */
- fsize = sizeof(struct sunos_sigframe);
- if (onstack)
- fp = (struct sunos_sigframe *)((caddr_t)p->p_sigctx.ps_sigstk.ss_sp +
- p->p_sigctx.ps_sigstk.ss_size);
- else
- fp = (struct sunos_sigframe *)(frame->f_regs[SP]);
fp--;
#ifdef DEBUG
@@ -199,7 +183,7 @@
/* Save signal mask. */
native_sigset_to_sigset13(mask, &kf.sf_sc.sc_mask);
- if (copyout(&kf, fp, fsize) != 0) {
+ if (copyout(&kf, fp, sizeof(kf)) != 0) {
#ifdef DEBUG
if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid)
printf("sendsig(%d): copyout failed on sig %d\n",
@@ -218,10 +202,7 @@
p->p_pid, sig, &fp->sf_sc,kf.sf_sc.sc_sp);
#endif
- /* have the user-level trampoline code sort out what registers it
- has to preserve. */
- frame->f_regs[SP] = (int)fp;
- frame->f_pc = (u_int) catcher;
+ buildcontext(l, catcher, fp);
/* Remember that we're now on the signal stack. */
if (onstack)
diff -r ea99de0daad3 -r 7d6d6949460e sys/compat/sunos/sunos.h
--- a/sys/compat/sunos/sunos.h Mon Sep 22 14:32:15 2003 +0000
+++ b/sys/compat/sunos/sunos.h Mon Sep 22 14:34:57 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunos.h,v 1.14 2003/01/24 21:55:17 fvdl Exp $ */
+/* $NetBSD: sunos.h,v 1.15 2003/09/22 14:34:58 cl Exp $ */
#ifndef _COMPAT_SUNOS_SUNOS_H_
#define _COMPAT_SUNOS_SUNOS_H_
@@ -154,7 +154,11 @@
__BEGIN_DECLS
/* Defined in arch/<arch>/sunos_machdep.c */
+#ifdef __HAVE_SIGINFO
+void sunos_sendsig __P((struct ksiginfo *, sigset_t *));
+#else
void sunos_sendsig __P((int, sigset_t *, u_long));
+#endif
__END_DECLS
#endif /* _COMPAT_SUNOS_SUNOS_H_ */
Home |
Main Index |
Thread Index |
Old Index