summaryrefslogtreecommitdiffstats
path: root/sys/alpha/linux/linux_sysvec.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1998-04-28 18:15:08 +0000
committereivind <eivind@FreeBSD.org>1998-04-28 18:15:08 +0000
commit67c7bb9c04ed76649b6be0484dcfaa84fa554bcd (patch)
tree1a99fec62896b96dd22a726554f4d62d24de741f /sys/alpha/linux/linux_sysvec.c
parent470efec49a7164af77eed73b6ff91740609ea273 (diff)
downloadFreeBSD-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/alpha/linux/linux_sysvec.c')
-rw-r--r--sys/alpha/linux/linux_sysvec.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c
index 134ff9e..a7da306 100644
--- a/sys/alpha/linux/linux_sysvec.c
+++ b/sys/alpha/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,
OpenPOWER on IntegriCloud