Merge over the remaining changes from i386 of the ksiginfo_t changes so
that this compiles. Pointy hat to: davidxu
This commit is contained in:
parent
f104248124
commit
0d876e6b17
@ -180,7 +180,7 @@ int cold = 1;
|
||||
static void osendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask);
|
||||
#endif
|
||||
#ifdef COMPAT_FREEBSD4
|
||||
static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask)
|
||||
static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask);
|
||||
#endif
|
||||
|
||||
long Maxmem = 0;
|
||||
@ -310,7 +310,7 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
sf.sf_arg2 = (register_t)&fp->sf_siginfo;
|
||||
sf.sf_siginfo.si_signo = sig;
|
||||
sf.sf_siginfo.si_code = code;
|
||||
sf.sf_siginfo.sf_value = ksi->ksi_value;
|
||||
sf.sf_siginfo.si_value = ksi->ksi_value;
|
||||
sf.sf_ahu.sf_action = (__osiginfohandler_t *)catcher;
|
||||
} else {
|
||||
/* Old FreeBSD-style arguments. */
|
||||
@ -397,22 +397,20 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
|
||||
#ifdef COMPAT_FREEBSD4
|
||||
static void
|
||||
freebsd4_sendsig(catcher, sig, mask, code)
|
||||
sig_t catcher;
|
||||
int sig;
|
||||
sigset_t *mask;
|
||||
u_long code;
|
||||
freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
{
|
||||
struct sigframe4 sf, *sfp;
|
||||
struct proc *p;
|
||||
struct thread *td;
|
||||
struct sigacts *psp;
|
||||
struct trapframe *regs;
|
||||
int sig;
|
||||
int oonstack;
|
||||
|
||||
td = curthread;
|
||||
p = td->td_proc;
|
||||
PROC_LOCK_ASSERT(p, MA_OWNED);
|
||||
sig = ksi->ksi_signo;
|
||||
psp = p->p_sigacts;
|
||||
mtx_assert(&psp->ps_mtx, MA_OWNED);
|
||||
regs = td->td_frame;
|
||||
@ -453,12 +451,12 @@ freebsd4_sendsig(catcher, sig, mask, code)
|
||||
|
||||
/* Fill in POSIX parts */
|
||||
sf.sf_si.si_signo = sig;
|
||||
sf.sf_si.si_code = code;
|
||||
sf.sf_si.si_addr = (void *)regs->tf_err;
|
||||
sf.sf_si.si_code = ksi->ksi_code;
|
||||
sf.sf_si.si_addr = ksi->ksi_addr;
|
||||
} else {
|
||||
/* Old FreeBSD-style arguments. */
|
||||
sf.sf_siginfo = code;
|
||||
sf.sf_addr = regs->tf_err;
|
||||
sf.sf_siginfo = ksi->ksi_code;
|
||||
sf.sf_addr = (register_t)ksi->ksi_addr;
|
||||
sf.sf_ahu.sf_handler = catcher;
|
||||
}
|
||||
mtx_unlock(&psp->ps_mtx);
|
||||
@ -518,11 +516,7 @@ freebsd4_sendsig(catcher, sig, mask, code)
|
||||
#endif /* COMPAT_FREEBSD4 */
|
||||
|
||||
void
|
||||
sendsig(catcher, sig, mask, code)
|
||||
sig_t catcher;
|
||||
int sig;
|
||||
sigset_t *mask;
|
||||
u_long code;
|
||||
sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
|
||||
{
|
||||
struct sigframe sf, *sfp;
|
||||
struct proc *p;
|
||||
@ -530,22 +524,24 @@ sendsig(catcher, sig, mask, code)
|
||||
struct sigacts *psp;
|
||||
char *sp;
|
||||
struct trapframe *regs;
|
||||
int sig;
|
||||
int oonstack;
|
||||
|
||||
td = curthread;
|
||||
p = td->td_proc;
|
||||
PROC_LOCK_ASSERT(p, MA_OWNED);
|
||||
sig = ksi->ksi_signo;
|
||||
psp = p->p_sigacts;
|
||||
mtx_assert(&psp->ps_mtx, MA_OWNED);
|
||||
#ifdef COMPAT_FREEBSD4
|
||||
if (SIGISMEMBER(psp->ps_freebsd4, sig)) {
|
||||
freebsd4_sendsig(catcher, sig, mask, code);
|
||||
freebsd4_sendsig(catcher, ksi, mask);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef COMPAT_43
|
||||
if (SIGISMEMBER(psp->ps_osigset, sig)) {
|
||||
osendsig(catcher, sig, mask, code);
|
||||
osendsig(catcher, ksi, mask);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -591,13 +587,12 @@ sendsig(catcher, sig, mask, code)
|
||||
sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher;
|
||||
|
||||
/* Fill in POSIX parts */
|
||||
sf.sf_si.si_signo = sig;
|
||||
sf.sf_si.si_code = code;
|
||||
sf.sf_si.si_addr = (void *)regs->tf_err;
|
||||
sf.sf_si = ksi->ksi_info;
|
||||
sf.sf_si.si_signo = sig; /* maybe a translated signal */
|
||||
} else {
|
||||
/* Old FreeBSD-style arguments. */
|
||||
sf.sf_siginfo = code;
|
||||
sf.sf_addr = regs->tf_err;
|
||||
sf.sf_siginfo = ksi->ksi_code;
|
||||
sf.sf_addr = (register_t)ksi->ksi_addr;
|
||||
sf.sf_ahu.sf_handler = catcher;
|
||||
}
|
||||
mtx_unlock(&psp->ps_mtx);
|
||||
@ -655,26 +650,6 @@ sendsig(catcher, sig, mask, code)
|
||||
mtx_lock(&psp->ps_mtx);
|
||||
}
|
||||
|
||||
/*
|
||||
* Build siginfo_t for SA thread
|
||||
*/
|
||||
void
|
||||
cpu_thread_siginfo(int sig, u_long code, siginfo_t *si)
|
||||
{
|
||||
struct proc *p;
|
||||
struct thread *td;
|
||||
|
||||
td = curthread;
|
||||
p = td->td_proc;
|
||||
PROC_LOCK_ASSERT(p, MA_OWNED);
|
||||
|
||||
bzero(si, sizeof(*si));
|
||||
si->si_signo = sig;
|
||||
si->si_code = code;
|
||||
si->si_addr = (void *)td->td_frame->tf_err;
|
||||
/* XXXKSE fill other fields */
|
||||
}
|
||||
|
||||
/*
|
||||
* System call to cleanup state after a signal
|
||||
* has been taken. Reset signal mask and
|
||||
@ -699,6 +674,7 @@ osigreturn(td, uap)
|
||||
struct osigcontext *scp;
|
||||
struct proc *p = td->td_proc;
|
||||
int eflags, error;
|
||||
ksiginfo_t ksi;
|
||||
|
||||
regs = td->td_frame;
|
||||
error = copyin(uap->sigcntxp, &sc, sizeof(sc));
|
||||
@ -827,6 +803,7 @@ freebsd4_sigreturn(td, uap)
|
||||
struct trapframe *regs;
|
||||
const struct ucontext4 *ucp;
|
||||
int cs, eflags, error;
|
||||
ksiginfo_t ksi;
|
||||
|
||||
error = copyin(uap->sigcntxp, &uc, sizeof(uc));
|
||||
if (error != 0)
|
||||
@ -944,6 +921,7 @@ sigreturn(td, uap)
|
||||
struct trapframe *regs;
|
||||
const ucontext_t *ucp;
|
||||
int cs, eflags, error, ret;
|
||||
ksiginfo_t ksi;
|
||||
|
||||
error = copyin(uap->sigcntxp, &uc, sizeof(uc));
|
||||
if (error != 0)
|
||||
|
Loading…
Reference in New Issue
Block a user