MIPS: Set `si_code' for SIGFPE signals sent from emulation too
authorMaciej W. Rozycki <macro@linux-mips.org>
Fri, 3 Apr 2015 22:27:15 +0000 (23:27 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 7 Apr 2015 23:10:19 +0000 (01:10 +0200)
commit304acb717e5b67cf56f05bc5b21123758e1f7ea0
tree031d9969f99864c02701d9df056f92c894a56116
parent443c44032a54f9acf027a8e688380fddc809bc19
MIPS: Set `si_code' for SIGFPE signals sent from emulation too

Rework `process_fpemu_return' and move IEEE 754 exception interpretation
there, from `do_fpe'.  Record the cause bits set in FCSR before they are
cleared and pass them through to `process_fpemu_return' so as to set
`si_code' correctly too for SIGFPE signals sent from emulation rather
than those issued by hardware with the FPE processor exception only.

For simplicity `mipsr2_decoder' assumes `*fcr31' has been preinitialised
and only sets it to anything if an FPU instruction has been emulated,
which in turn is the only case SIGFPE can be issued for here.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9705/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/fpu_emulator.h
arch/mips/include/asm/mips-r2-to-r6-emul.h
arch/mips/kernel/mips-r2-to-r6-emul.c
arch/mips/kernel/traps.c
arch/mips/kernel/unaligned.c