-/* $OpenBSD: frame.h,v 1.2 1996/12/28 06:25:09 rahnds Exp $ */
+/* $OpenBSD: frame.h,v 1.3 1997/02/05 01:33:51 rahnds Exp $ */
/* $NetBSD: frame.h,v 1.1 1996/09/30 16:34:25 ws Exp $ */
/*
#include <machine/types.h>
-/*
- * We have to save all registers on every trap, because
- * 1. user could attach this process every time
- * 2. we must be able to restore all user registers in case of fork
- * Actually, we do not save the fp registers on trap, since
- * these are not used by the kernel. They are saved only when switching
- * between processes using the FPU.
- *
- * Change ordering to cluster together these register_t's. XXX
- */
-struct trapframe {
- register_t fixreg[32];
- register_t lr;
- int cr;
- int xer;
- register_t ctr;
- register_t srr0;
- register_t srr1;
- register_t dar; /* dar & dsisr are only filled on a DSI trap */
- int dsisr;
- int exc;
-};
/*
* This is to ensure alignment of the stackpointer
*/
register_t r31;
};
+struct sigframe {
+ int sf_signum;
+ siginfo_t *sf_sip;
+ struct sigcontext sf_sc;
+ siginfo_t sf_si;
+};
#endif /* _MACHINE_FRAME_H_ */
+/* $OpenBSD: signal.h,v 1.2 1997/02/05 01:33:53 rahnds Exp $ */
/* $NetBSD: signal.h,v 1.1 1996/09/30 16:34:34 ws Exp $ */
/*
#ifndef _MACHINE_SIGNAL_H_
#define _MACHINE_SIGNAL_H_
-#include <machine/frame.h>
-
typedef int sig_atomic_t;
+/*
+ * We have to save all registers on every trap, because
+ * 1. user could attach this process every time
+ * 2. we must be able to restore all user registers in case of fork
+ * Actually, we do not save the fp registers on trap, since
+ * these are not used by the kernel. They are saved only when switching
+ * between processes using the FPU.
+ *
+ * Change ordering to cluster together these register_t's. XXX
+ */
+struct trapframe {
+ register_t fixreg[32];
+ register_t lr;
+ int cr;
+ int xer;
+ register_t ctr;
+ register_t srr0;
+ register_t srr1;
+ register_t dar; /* dar & dsisr are only filled on a DSI trap */
+ int dsisr;
+ int exc;
+};
+
struct sigcontext {
int sc_onstack; /* saved onstack flag */
int sc_mask; /* saved signal mask */
struct trapframe sc_frame; /* saved registers */
};
-
-struct sigframe {
- int sf_signum;
- int sf_code;
- struct sigcontext sf_sc;
-};
#endif /* _MACHINE_SIGNAL_H_ */
-/* $OpenBSD: machdep.c,v 1.4 1997/01/20 20:43:48 rahnds Exp $ */
+/* $OpenBSD: machdep.c,v 1.5 1997/02/05 01:33:54 rahnds Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
* Send a signal to process.
*/
void
-sendsig(catcher, sig, mask, code)
+sendsig(catcher, sig, mask, code, type, val)
sig_t catcher;
int sig, mask;
u_long code;
+ int type;
+ union sigval val;
{
struct proc *p = curproc;
struct trapframe *tf;
fp = (struct sigframe *)tf->fixreg[1];
fp = (struct sigframe *)((int)(fp - 1) & ~0xf);
- frame.sf_code = code;
-
/*
* Generate signal context for SYS_sigreturn.
*/
frame.sf_sc.sc_onstack = oldonstack;
frame.sf_sc.sc_mask = mask;
+ frame.sf_sip = NULL;
bcopy(tf, &frame.sf_sc.sc_frame, sizeof *tf);
+ if (psp->ps_siginfo & sigmask(sig)) {
+ frame.sf_sip = &fp->sf_si;
+ initsiginfo(&frame.sf_si, sig, code, type, val);
+ }
if (copyout(&frame, fp, sizeof frame) != 0)
sigexit(p, SIGILL);
+
tf->fixreg[1] = (int)fp;
tf->lr = (int)catcher;
tf->fixreg[3] = (int)sig;
- tf->fixreg[4] = (int)code;
+ tf->fixreg[4] = (psp->ps_siginfo & sigmask(sig)) ? (int)&fp->sf_si : NULL;
tf->fixreg[5] = (int)&frame.sf_sc;
tf->srr0 = (int)(((char *)PS_STRINGS)
- (p->p_emul->e_esigcode - p->p_emul->e_sigcode));
-/* $OpenBSD: trap.c,v 1.3 1996/12/28 06:22:27 rahnds Exp $ */
+/* $OpenBSD: trap.c,v 1.4 1997/02/05 01:33:55 rahnds Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
break;
}
printf("dsi on addr %x iar %x\n", frame->dar, frame->srr0);
- trapsignal(p, SIGSEGV, EXC_DSI);
+ trapsignal(p, SIGSEGV, EXC_DSI, SEGV_MAPERR, frame->dar);
break;
case EXC_ISI|EXC_USER:
{
break;
}
printf("isi iar %x\n", frame->srr0);
- trapsignal(p, SIGSEGV, EXC_ISI);
+ trapsignal(p, SIGSEGV, EXC_ISI, SEGV_MAPERR, frame->srr0);
break;
case EXC_SC|EXC_USER:
{
case EXC_PGM|EXC_USER:
printf("pgm iar %x\n", frame->srr0);
- trapsignal(p, SIGILL,EXC_PGM);
+ trapsignal(p, SIGILL, EXC_PGM, ILL_ILLOPC, frame->srr0);
break;
case EXC_AST|EXC_USER:
/* This is just here that we trap */