1
/* Translate Mach exception codes into signal numbers. MIPS version.
2
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
3
This file is part of the GNU C Library.
5
The GNU C Library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
The GNU C Library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with the GNU C Library; if not, write to the Free
17
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21
#include <hurd/signal.h>
22
#include <mach/exception.h>
24
/* Translate the Mach exception codes, as received in an `exception_raise' RPC,
25
into a signal number and signal subcode. */
28
_hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
36
detail->code = detail->exc;
40
if (detail->exc_code == KERN_PROTECTION_FAILURE)
44
detail->code = detail->exc_subcode;
45
detail->error = detail->exc_code;
48
case EXC_BAD_INSTRUCTION:
50
if (detail->exc_code == EXC_MIPS_II)
51
detail->code = detail->exc_subcode;
57
switch (detail->exc_code)
59
case EXC_MIPS_OV: /* integer overflow */
61
detail->code = detail->exc_subcode;
70
/* Subcode is the fp_status word saved by the hardware.
71
Give an error code corresponding to the first bit set. */
72
if (detail->exc_subcode == EXC_MIPS_FLT_UNIMP)
76
detail->code = detail->exc_subcode;
82
/* 3.0 doesn't give this one, why, I don't know. */