diff options
author | dfr <dfr@FreeBSD.org> | 1998-11-18 23:51:40 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-11-18 23:51:40 +0000 |
commit | 86637d9d69b15e53584133a4b1ffd05cddf6fdf6 (patch) | |
tree | bf4ca46703c1f63783e4ebabfb874b105ac71e16 | |
parent | f6dc1e18228c92ebe10059f63b1e111c2705a246 (diff) | |
download | FreeBSD-src-86637d9d69b15e53584133a4b1ffd05cddf6fdf6.zip FreeBSD-src-86637d9d69b15e53584133a4b1ffd05cddf6fdf6.tar.gz |
Add sc_traparg_a0, sc_traparg_a1 and sc_traparg_a2 to the sigcontext
structure for the alpha. These give extra information about some
signals (such as SIGSEGV) and should be compatible with Digital Unix.
Submitted by: jdp
-rw-r--r-- | sys/alpha/alpha/alpha-gdbstub.c | 10 | ||||
-rw-r--r-- | sys/alpha/alpha/interrupt.c | 5 | ||||
-rw-r--r-- | sys/alpha/alpha/machdep.c | 11 | ||||
-rw-r--r-- | sys/alpha/alpha/trap.c | 9 | ||||
-rw-r--r-- | sys/alpha/include/frame.h | 62 | ||||
-rw-r--r-- | sys/alpha/include/signal.h | 8 |
6 files changed, 65 insertions, 40 deletions
diff --git a/sys/alpha/alpha/alpha-gdbstub.c b/sys/alpha/alpha/alpha-gdbstub.c index d57230d..0f8e963 100644 --- a/sys/alpha/alpha/alpha-gdbstub.c +++ b/sys/alpha/alpha/alpha-gdbstub.c @@ -538,11 +538,11 @@ clear_single_step(db_regs_t* regs) * Entries not in integer register set are set to -1. */ static int tf2gdb[FRAME_SIZE] = { - R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6, - R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6, - R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA, - R_T12, R_AT, R_SP, -1, -1, R_GP, R_A0, R_A1, - R_A2, +/*0*/ R_V0, R_T0, R_T1, R_T2, R_T3, R_T4, R_T5, R_T6, +/*8*/ R_T7, R_S0, R_S1, R_S2, R_S3, R_S4, R_S5, R_S6, +/*16*/ R_A3, R_A4, R_A5, R_T8, R_T9, R_T10, R_T11, R_RA, +/*24*/ R_T12, R_AT, R_SP, -1, -1, -1, -1, -1, +/*32*/ R_GP, R_A0, R_A1, R_A2, }; /* diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index a29d63c..4006028 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -1,4 +1,4 @@ -/* $Id: interrupt.c,v 1.5 1998/08/10 07:53:58 dfr Exp $ */ +/* $Id: interrupt.c,v 1.6 1998/11/15 18:25:15 dfr Exp $ */ /* $NetBSD: interrupt.c,v 1.23 1998/02/24 07:38:01 thorpej Exp $ */ /* @@ -74,6 +74,9 @@ interrupt(a0, a1, a2, framep) panic("possible stack overflow\n"); } + framep->tf_regs[FRAME_TRAPARG_A0] = a0; + framep->tf_regs[FRAME_TRAPARG_A1] = a1; + framep->tf_regs[FRAME_TRAPARG_A2] = a2; switch (a0) { case ALPHA_INTR_XPROC: /* interprocessor interrupt */ printf("interprocessor interrupt!\n"); diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index 9a2c8fc..2084b6c 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: machdep.c,v 1.21 1998/11/11 00:02:25 msmith Exp $ + * $Id: machdep.c,v 1.22 1998/11/15 18:25:15 dfr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1281,7 +1281,14 @@ sendsig(sig_t catcher, int sig, int mask, u_long code) sizeof(struct fpreg)); ksc.sc_fp_control = 0; /* XXX ? */ bzero(ksc.sc_reserved, sizeof ksc.sc_reserved); /* XXX */ - bzero(ksc.sc_xxx, sizeof ksc.sc_xxx); /* XXX */ + ksc.sc_xxx1[0] = 0; /* XXX */ + ksc.sc_xxx1[1] = 0; /* XXX */ + ksc.sc_traparg_a0 = frame->tf_regs[FRAME_TRAPARG_A0]; + ksc.sc_traparg_a1 = frame->tf_regs[FRAME_TRAPARG_A1]; + ksc.sc_traparg_a2 = frame->tf_regs[FRAME_TRAPARG_A2]; + ksc.sc_xxx2[0] = 0; /* XXX */ + ksc.sc_xxx2[1] = 0; /* XXX */ + ksc.sc_xxx2[2] = 0; /* XXX */ #ifdef COMPAT_OSF1 diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c index 69442a0..2964ac0 100644 --- a/sys/alpha/alpha/trap.c +++ b/sys/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $Id: trap.c,v 1.4 1998/07/05 12:24:17 dfr Exp $ */ +/* $Id: trap.c,v 1.5 1998/07/15 20:16:27 dfr Exp $ */ /* $NetBSD: trap.c,v 1.31 1998/03/26 02:21:46 thorpej Exp $ */ /* @@ -493,6 +493,9 @@ trap(a0, a1, a2, entry, framep) #ifdef DEBUG printtrap(a0, a1, a2, entry, framep, 1, user); #endif + framep->tf_regs[FRAME_TRAPARG_A0] = a0; + framep->tf_regs[FRAME_TRAPARG_A1] = a1; + framep->tf_regs[FRAME_TRAPARG_A2] = a2; trapsignal(p, i, ucode); out: if (user) { @@ -539,10 +542,14 @@ syscall(code, framep) u_int64_t args[10]; /* XXX */ u_int hidden = 0, nargs; + framep->tf_regs[FRAME_TRAPARG_A0] = 0; + framep->tf_regs[FRAME_TRAPARG_A1] = 0; + framep->tf_regs[FRAME_TRAPARG_A2] = 0; #if notdef /* can't happen, ever. */ if ((framep->tf_regs[FRAME_PS] & ALPHA_PSL_USERMODE) == 0) { panic("syscall"); #endif + cnt.v_syscall++; p = curproc; p->p_md.md_tf = framep; diff --git a/sys/alpha/include/frame.h b/sys/alpha/include/frame.h index 19aaef6..8af1d71 100644 --- a/sys/alpha/include/frame.h +++ b/sys/alpha/include/frame.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: frame.h,v 1.1 1998/01/10 10:13:14 jb Exp $ */ /* From: NetBSD: frame.h,v 1.4 1997/04/06 08:47:27 cgd Exp */ /* @@ -47,35 +47,39 @@ */ /* Quadword offsets of the registers to be saved. */ -#define FRAME_V0 0 -#define FRAME_T0 1 -#define FRAME_T1 2 -#define FRAME_T2 3 -#define FRAME_T3 4 -#define FRAME_T4 5 -#define FRAME_T5 6 -#define FRAME_T6 7 -#define FRAME_T7 8 -#define FRAME_S0 9 -#define FRAME_S1 10 -#define FRAME_S2 11 -#define FRAME_S3 12 -#define FRAME_S4 13 -#define FRAME_S5 14 -#define FRAME_S6 15 -#define FRAME_A3 16 -#define FRAME_A4 17 -#define FRAME_A5 18 -#define FRAME_T8 19 -#define FRAME_T9 20 -#define FRAME_T10 21 -#define FRAME_T11 22 -#define FRAME_RA 23 -#define FRAME_T12 24 -#define FRAME_AT 25 -#define FRAME_SP 26 +#define FRAME_V0 0 +#define FRAME_T0 1 +#define FRAME_T1 2 +#define FRAME_T2 3 +#define FRAME_T3 4 +#define FRAME_T4 5 +#define FRAME_T5 6 +#define FRAME_T6 7 +#define FRAME_T7 8 +#define FRAME_S0 9 +#define FRAME_S1 10 +#define FRAME_S2 11 +#define FRAME_S3 12 +#define FRAME_S4 13 +#define FRAME_S5 14 +#define FRAME_S6 15 +#define FRAME_A3 16 +#define FRAME_A4 17 +#define FRAME_A5 18 +#define FRAME_T8 19 +#define FRAME_T9 20 +#define FRAME_T10 21 +#define FRAME_T11 22 +#define FRAME_RA 23 +#define FRAME_T12 24 +#define FRAME_AT 25 +#define FRAME_SP 26 +/* The following are set only when a signal is to be delivered to a process. */ +#define FRAME_TRAPARG_A0 27 +#define FRAME_TRAPARG_A1 28 +#define FRAME_TRAPARG_A2 29 -#define FRAME_SW_SIZE (FRAME_SP + 1) +#define FRAME_SW_SIZE (FRAME_TRAPARG_A2 + 1) #define FRAME_HW_OFFSET FRAME_SW_SIZE #define FRAME_PS (FRAME_HW_OFFSET + ALPHA_HWFRAME_PS) diff --git a/sys/alpha/include/signal.h b/sys/alpha/include/signal.h index 32f14c2..eb335c0 100644 --- a/sys/alpha/include/signal.h +++ b/sys/alpha/include/signal.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: signal.h,v 1.1 1998/01/10 10:13:16 jb Exp $ */ /* From: NetBSD: signal.h,v 1.3 1997/04/06 08:47:43 cgd Exp */ /* @@ -56,7 +56,11 @@ struct sigcontext { unsigned long sc_fpcr; /* FP control register (see above) */ unsigned long sc_fp_control; /* FP software control word */ long sc_reserved[2]; /* XXX */ - long sc_xxx[8]; /* XXX */ + long sc_xxx1[2]; /* sc_ssize, sc_sbase on DUX */ + unsigned long sc_traparg_a0; /* a0 argument to trap at exception */ + unsigned long sc_traparg_a1; /* a1 argument to trap at exception */ + unsigned long sc_traparg_a2; /* a2 argument to trap at exception */ + long sc_xxx2[3]; /* sc_fp_trap_pc, sc_fp_trigger_sum, sc_fp_trigger_inst */ }; #endif /* !_ANSI_SOURCE */ |