diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2012-03-29 02:04:15 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2012-03-29 02:04:15 +0000 |
commit | 5143d82211c0f5904312768de3efdb65ed086d7f (patch) | |
tree | ccad466d63b9725ce3ea1a7f54e8354241b60e69 /sys/mips | |
parent | 39dec33f2b1a90ece885ce3dc3ba5967cbcdbc8c (diff) | |
download | src-5143d82211c0f5904312768de3efdb65ed086d7f.tar.gz src-5143d82211c0f5904312768de3efdb65ed086d7f.zip |
Notes
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/mips/trap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/mips/mips/trap.c b/sys/mips/mips/trap.c index f2b343a5109d..27d3a4811131 100644 --- a/sys/mips/mips/trap.c +++ b/sys/mips/mips/trap.c @@ -290,6 +290,20 @@ static int allow_unaligned_acc = 1; SYSCTL_INT(_vm, OID_AUTO, allow_unaligned_acc, CTLFLAG_RW, &allow_unaligned_acc, 0, "Allow unaligned accesses"); +/* + * FP emulation is assumed to work on O32, but the code is outdated and crufty + * enough that it's a more sensible default to have it disabled when using + * other ABIs. At the very least, it needs a lot of help in using + * type-semantic ABI-oblivious macros for everything it does. + */ +#if defined(__mips_o32) +static int emulate_fp = 1; +#else +static int emulate_fp = 0; +#endif +SYSCTL_INT(_machdep, OID_AUTO, emulate_fp, CTLFLAG_RW, + &allow_unaligned_acc, 0, "Emulate unimplemented FPU instructions"); + static int emulate_unaligned_access(struct trapframe *frame, int mode); extern void fswintrberr(void); /* XXX */ @@ -988,6 +1002,11 @@ dofault: #endif case T_FPE + T_USER: + if (!emulate_fp) { + i = SIGILL; + addr = trapframe->pc; + break; + } MipsFPTrap(trapframe->sr, trapframe->cause, trapframe->pc); goto out; |