Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys/arch/mips/mips Remove netbsd32_sendsig_sigcont...
details: https://anonhg.NetBSD.org/src/rev/7e2a9f7265d6
branches: pgoyette-compat
changeset: 830835:7e2a9f7265d6
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sat Sep 29 09:44:53 2018 +0000
description:
Remove netbsd32_sendsig_sigcontext() - it belongs in netbsd32_machdep.c
diffstat:
sys/arch/mips/mips/netbsd32_machdep_16.c | 91 +------------------------------
1 files changed, 4 insertions(+), 87 deletions(-)
diffs (120 lines):
diff -r b491e7f991c0 -r 7e2a9f7265d6 sys/arch/mips/mips/netbsd32_machdep_16.c
--- a/sys/arch/mips/mips/netbsd32_machdep_16.c Sat Sep 29 08:38:45 2018 +0000
+++ b/sys/arch/mips/mips/netbsd32_machdep_16.c Sat Sep 29 09:44:53 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $ */
+/* $NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.4 2018/09/29 07:47:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep_16.c,v 1.1.2.5 2018/09/29 09:44:53 pgoyette Exp $");
#include "opt_compat_netbsd.h"
#include "opt_coredump.h"
@@ -67,9 +67,9 @@
#include <uvm/uvm_extern.h>
-void netbsd32_sendsig_siginfo(const ksiginfo_t *, const sigset_t *);
+int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
-int netbsd32_sendsig_16(const ksiginfo_t *, const sigset_t *);
+void sendsig_context(const ksiginfo_t *, const sigset_t *);
extern struct netbsd32_sendsig_hook_t netbsd32_sendsig_hook;
@@ -85,89 +85,6 @@
return compat_16_sys___sigreturn14(l, &ua, retval);
}
-struct sigframe_siginfo32 {
- siginfo32_t sf_si;
- ucontext32_t sf_uc;
-};
-
-/*
- * Send a signal to process.
- */
-static void
-netbsd32_sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
-{
- struct lwp * const l = curlwp;
- struct proc * const p = l->l_proc;
- struct sigacts * const ps = p->p_sigacts;
- int onstack, error;
- int sig = ksi->ksi_signo;
- struct sigframe_siginfo32 *sfp = getframe(l, sig, &onstack);
- struct sigframe_siginfo32 sf;
- struct trapframe * const tf = l->l_md.md_utf;
- size_t sfsz;
- sig_t catcher = SIGACTION(p, sig).sa_handler;
-
- sfp--;
-
- netbsd32_si_to_si32(&sf.sf_si, (const siginfo_t *)&ksi->ksi_info);
-
- /* 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 */
- default: /* unknown version */
- printf("%s: bad version %d\n", __func__,
- ps->sa_sigdesc[sig].sd_vers);
- sigexit(l, SIGILL);
- case 2:
- break;
- }
-
- sf.sf_uc.uc_flags = _UC_SIGMASK
- | ((l->l_sigstk.ss_flags & SS_ONSTACK)
- ? _UC_SETSTACK : _UC_CLRSTACK);
- sf.sf_uc.uc_sigmask = *mask;
- sf.sf_uc.uc_link = (intptr_t)l->l_ctxlink;
- memset(&sf.sf_uc.uc_stack, 0, sizeof(sf.sf_uc.uc_stack));
- sfsz = offsetof(struct sigframe_siginfo32, sf_uc.uc_mcontext);
- if (p->p_md.md_abi == _MIPS_BSD_API_O32)
- sfsz += sizeof(mcontext_o32_t);
- else
- sfsz += sizeof(mcontext32_t);
- sendsig_reset(l, sig);
- mutex_exit(p->p_lock);
- cpu_getmcontext32(l, &sf.sf_uc.uc_mcontext, &sf.sf_uc.uc_flags);
- error = copyout(&sf, sfp, sfsz);
- mutex_enter(p->p_lock);
-
- if (error != 0) {
- /*
- * Process has trashed its stack; give it an illegal
- * instruction to halt it in its tracks.
- */
- sigexit(l, SIGILL);
- /* NOTREACHED */
- }
-
- /*
- * Set up the registers to directly invoke the signal
- * handler. The return address will be set up to point
- * to the signal trampoline to bounce us back.
- */
- tf->tf_regs[_R_A0] = sig;
- tf->tf_regs[_R_A1] = (intptr_t)&sfp->sf_si;
- tf->tf_regs[_R_A2] = (intptr_t)&sfp->sf_uc;
-
- tf->tf_regs[_R_PC] = (intptr_t)catcher;
- tf->tf_regs[_R_T9] = (intptr_t)catcher;
- tf->tf_regs[_R_SP] = (intptr_t)sfp;
- tf->tf_regs[_R_RA] = (intptr_t)ps->sa_sigdesc[sig].sd_tramp;
-
- /* Remember that we're now on the signal stack. */
- if (onstack)
- l->l_sigstk.ss_flags |= SS_ONSTACK;
-}
-
int
netbsd32_sendsig_16(const ksiginfo_t *ksi, const sigset_t *mask)
{
Home |
Main Index |
Thread Index |
Old Index