From 9e6d313531ba5e8d5c554d77a8763dcefc322039 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 2 Feb 1997 00:47:44 +0000 Subject: attempt at siginfo.. Per must look this over --- sys/arch/arc/arc/machdep.c | 9 +++++---- sys/arch/arc/arc/trap.c | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'sys') diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c index 36aba12888a..77f3414f72b 100644 --- a/sys/arch/arc/arc/machdep.c +++ b/sys/arch/arc/arc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.18 1997/02/01 11:02:41 deraadt Exp $ */ +/* $OpenBSD: machdep.c,v 1.19 1997/02/02 00:47:42 deraadt Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 8.3 (Berkeley) 1/12/94 - * $Id: machdep.c,v 1.18 1997/02/01 11:02:41 deraadt Exp $ + * $Id: machdep.c,v 1.19 1997/02/02 00:47:42 deraadt Exp $ */ /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -743,11 +743,12 @@ int sigpid = 0; * Send an interrupt to process. */ void -sendsig(catcher, sig, mask, code, addr) +sendsig(catcher, sig, mask, code, type, val) sig_t catcher; int sig, mask; u_long code; - caddr_t addr; + int type; + union sigval val; { register struct proc *p = curproc; register struct sigframe *fp; diff --git a/sys/arch/arc/arc/trap.c b/sys/arch/arc/arc/trap.c index cb847833d5d..237e83c72b3 100644 --- a/sys/arch/arc/arc/trap.c +++ b/sys/arch/arc/arc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.7 1997/01/28 03:54:53 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.8 1997/02/02 00:47:43 deraadt Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ * from: Utah Hdr: trap.c 1.32 91/04/06 * * from: @(#)trap.c 8.5 (Berkeley) 1/11/94 - * $Id: trap.c,v 1.7 1997/01/28 03:54:53 deraadt Exp $ + * $Id: trap.c,v 1.8 1997/02/02 00:47:43 deraadt Exp $ */ #include @@ -249,6 +249,7 @@ trap(statusReg, causeReg, vadr, pc, args) u_quad_t sticks; vm_prot_t ftype; extern unsigned onfault_table[]; + int typ = 0; #ifdef DEBUG trp->status = statusReg; @@ -433,14 +434,19 @@ trap(statusReg, causeReg, vadr, pc, args) } ucode = vadr; i = SIGSEGV; + typ = SEGV_MAPERR; break; } case T_ADDR_ERR_LD+T_USER: /* misaligned or kseg access */ case T_ADDR_ERR_ST+T_USER: /* misaligned or kseg access */ + i = SIGBUS; + typ = BUS_ADRALN; + break; case T_BUS_ERR_IFETCH+T_USER: /* BERR asserted to cpu */ case T_BUS_ERR_LD_ST+T_USER: /* BERR asserted to cpu */ i = SIGBUS; + typ = BUS_OBJERR; break; case T_SYSCALL+T_USER: @@ -652,6 +658,7 @@ trap(statusReg, causeReg, vadr, pc, args) #endif if (p->p_md.md_ss_addr != va || instr != BREAK_SSTEP) { i = SIGTRAP; + typ = TRAP_TRACE; break; } @@ -676,16 +683,19 @@ trap(statusReg, causeReg, vadr, pc, args) p->p_md.md_ss_addr = 0; i = SIGTRAP; + typ = TRAP_BRKPT; break; } case T_RES_INST+T_USER: i = SIGILL; + typ = ILL_ILLOPC; break; case T_COP_UNUSABLE+T_USER: if ((causeReg & CR_COP_ERR) != 0x10000000) { i = SIGILL; /* only FPU instructions allowed */ + typ = ILL_ILLOPC; break; } MachSwitchFPState(machFPCurProcPtr, p->p_md.md_regs); @@ -709,6 +719,7 @@ trap(statusReg, causeReg, vadr, pc, args) case T_OVFLOW+T_USER: i = SIGFPE; + typ = FPE_FLTOVF; break; case T_ADDR_ERR_LD: /* misaligned access */ @@ -768,7 +779,7 @@ trap(statusReg, causeReg, vadr, pc, args) p->p_md.md_regs[PC] = pc; p->p_md.md_regs[CAUSE] = causeReg; p->p_md.md_regs[BADVADDR] = vadr; - trapsignal(p, i, ucode, (caddr_t)vadr); + trapsignal(p, i, ucode, typ, (caddr_t)vadr); out: /* * Note: we should only get here if returning to user mode. -- cgit v1.2.3