diff options
author | eivind <eivind@FreeBSD.org> | 1998-04-28 18:15:08 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1998-04-28 18:15:08 +0000 |
commit | 67c7bb9c04ed76649b6be0484dcfaa84fa554bcd (patch) | |
tree | 1a99fec62896b96dd22a726554f4d62d24de741f /sys/i386/linux/linux_sysvec.c | |
parent | 470efec49a7164af77eed73b6ff91740609ea273 (diff) | |
download | FreeBSD-src-67c7bb9c04ed76649b6be0484dcfaa84fa554bcd.zip FreeBSD-src-67c7bb9c04ed76649b6be0484dcfaa84fa554bcd.tar.gz |
Translate T_PROTFLT to SIGSEGV instead of SIGBUS when running under
Linux emulation. This make Allegro Common Lisp 4.3 work under
FreeBSD!
Submitted by: Fred Gilham <gilham@csl.sri.com>
Commented on by: bde, dg, msmith, tg
Hoping he got everything right: eivind
Diffstat (limited to 'sys/i386/linux/linux_sysvec.c')
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index 134ff9e..a7da306 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_sysvec.c,v 1.26 1998/02/13 07:34:52 bde Exp $ + * $Id: linux_sysvec.c,v 1.27 1998/04/13 17:49:51 sos Exp $ */ /* XXX we use functions that might not exist. */ @@ -98,6 +98,29 @@ int linux_to_bsd_signal[LINUX_NSIG] = { SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGWINCH, SIGURG, SIGURG, 0 }; +/* + * If FreeBSD & Linux have a difference of opinion about what a trap + * means, deal with it here. + */ +static int +translate_traps(int signal, int trap_code) +{ + switch(signal) { + case SIGBUS: + switch(trap_code) { + case T_PROTFLT: + case T_TSSFLT: + case T_DOUBLEFLT: + case T_PAGEFLT: + return SIGSEGV; + default: + return signal; + } + default: + return signal; + } +} + static int linux_fixup(int **stack_base, struct image_params *imgp) { @@ -374,6 +397,7 @@ struct sysentvec linux_sysvec = { bsd_to_linux_signal, ELAST, bsd_to_linux_errno, + translate_traps, linux_fixup, linux_sendsig, linux_sigcode, @@ -390,6 +414,7 @@ struct sysentvec elf_linux_sysvec = { bsd_to_linux_signal, ELAST, bsd_to_linux_errno, + translate_traps, elf_linux_fixup, linux_sendsig, linux_sigcode, |