aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/unaligned.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2015-04-03 18:27:15 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-07 19:10:19 -0400
commit304acb717e5b67cf56f05bc5b21123758e1f7ea0 (patch)
tree031d9969f99864c02701d9df056f92c894a56116 /arch/mips/kernel/unaligned.c
parent443c44032a54f9acf027a8e688380fddc809bc19 (diff)
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>
Diffstat (limited to 'arch/mips/kernel/unaligned.c')
-rw-r--r--arch/mips/kernel/unaligned.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
index bbb69695a0a1..cf51ad36f213 100644
--- a/arch/mips/kernel/unaligned.c
+++ b/arch/mips/kernel/unaligned.c
@@ -1076,7 +1076,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
1076 own_fpu(1); /* Restore FPU state. */ 1076 own_fpu(1); /* Restore FPU state. */
1077 1077
1078 /* Signal if something went wrong. */ 1078 /* Signal if something went wrong. */
1079 process_fpemu_return(res, fault_addr); 1079 process_fpemu_return(res, fault_addr, 0);
1080 1080
1081 if (res == 0) 1081 if (res == 0)
1082 break; 1082 break;
@@ -1511,7 +1511,7 @@ fpu_emul:
1511 own_fpu(1); /* restore FPU state */ 1511 own_fpu(1); /* restore FPU state */
1512 1512
1513 /* If something went wrong, signal */ 1513 /* If something went wrong, signal */
1514 process_fpemu_return(res, fault_addr); 1514 process_fpemu_return(res, fault_addr, 0);
1515 1515
1516 if (res == 0) 1516 if (res == 0)
1517 goto success; 1517 goto success;