I think that EXCP_RANGE should for us be unreachable in user-only
mode (because it can only happen if the relevant bits in SR are
set, and SR is writeable only in supervisor mode, and its starting
value doesn't set these bits). So we could just delete the EXCP_RANGE
handling and let it hit the default g_assert_not_reached() case.
EXCP_FPE is more tricky -- this happens for FP exceptions, where
the enabling bit is in the FPCSR, which does appear to be writeable
from user mode. So either:
* our mtspr is wrong and should either be not allowing writes
to FPCSR in usermode (or at least sanitizing them)
* the Linux kernel for openrisc is wrong, because a userspace
program that sets FPCSR.FPEE can make it run into unhandled_exception()
and die(), and it should be doing something else, like delivering
a suitable SIGFPE