aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/mips/exc2signal.c')
-rw-r--r--sysdeps/mach/hurd/mips/exc2signal.c65
1 files changed, 32 insertions, 33 deletions
diff --git a/sysdeps/mach/hurd/mips/exc2signal.c b/sysdeps/mach/hurd/mips/exc2signal.c
index f907c89cf0..235b2e2947 100644
--- a/sysdeps/mach/hurd/mips/exc2signal.c
+++ b/sysdeps/mach/hurd/mips/exc2signal.c
@@ -1,21 +1,21 @@
/* Translate Mach exception codes into signal numbers. MIPS version.
-Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <hurd.h>
#include <hurd/signal.h>
@@ -25,56 +25,55 @@ Cambridge, MA 02139, USA. */
into a signal number and signal subcode. */
void
-_hurd_exception2signal (int exception, int code, int subcode,
- int *signo, long int *sigcode, int *error)
+_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
{
- *error = 0;
+ detail->error = 0;
- switch (exception)
+ switch (detail->exc)
{
default:
*signo = SIGIOT;
- *sigcode = exception;
+ detail->code = detail->exc;
break;
case EXC_BAD_ACCESS:
- if (code == KERN_PROTECTION_FAILURE)
+ if (detail->exc_code == KERN_PROTECTION_FAILURE)
*signo = SIGSEGV;
else
*signo = SIGBUS;
- *sigcode = subcode;
- *error = code;
+ detail->code = detail->exc_subcode;
+ detail->error = detail->exc_code;
break;
case EXC_BAD_INSTRUCTION:
*signo = SIGILL;
- if (code == EXC_MIPS_II)
- *sigcode = code;
+ if (detail->exc_code == EXC_MIPS_II)
+ detail->code = detail->exc_subcode;
else
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_ARITHMETIC:
- switch (code)
+ switch (detail->exc_code)
{
case EXC_MIPS_OV: /* integer overflow */
*signo = SIGFPE;
- *sigcode = EXC_MIPS_FLT_OVERFLOW;
+ detail->code = detail->exc_subcode;
break;
default:
*signo = SIGFPE;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_MIPS_INT:
/* Subcode is the fp_status word saved by the hardware.
Give an error code corresponding to the first bit set. */
- if (subcode == EXC_MIPS_FLT_UNIMP)
+ if (detail->exc_subcode == EXC_MIPS_FLT_UNIMP)
*signo = SIGILL;
else
*signo = SIGFPE;
- *sigcode = subcode;
+ detail->code = detail->exc_subcode;
break;
}
break;
@@ -82,17 +81,17 @@ _hurd_exception2signal (int exception, int code, int subcode,
case EXC_EMULATION:
/* 3.0 doesn't give this one, why, I don't know. */
*signo = SIGEMT;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_SOFTWARE:
*signo = SIGEMT;
- *sigcode = 0;
+ detail->code = 0;
break;
case EXC_BREAKPOINT:
*signo = SIGTRAP;
- *sigcode = code;
+ detail->code = 0;
break;
}
}