Skip to content

Commit

Permalink
linux-user/arm: Do not fill in si_code for fpa11 exceptions
Browse files Browse the repository at this point in the history
There is no such decoding in linux/arch/arm/nwfpe/fpmodule.c.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20210423165413.338259-4-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
rth7680 authored and vivier committed May 15, 2021
1 parent d827f6d commit 0a50285
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions linux-user/arm/cpu_loop.c
Expand Up @@ -262,29 +262,15 @@ static bool emulate_arm_fpa11(CPUARMState *env, uint32_t opcode)
/* Exception enabled? */
FPSR fpsr = ts->fpa.fpsr;
if (fpsr & (arm_fpe << 16)) {
target_siginfo_t info;
target_siginfo_t info = { };

/*
* The kernel's nwfpe emulator does not pass a real si_code.
* It merely uses send_sig(SIGFPE, current, 1).
*/
info.si_signo = TARGET_SIGFPE;
info.si_errno = 0;

/* ordered by priority, least first */
if (arm_fpe & BIT_IXC) {
info.si_code = TARGET_FPE_FLTRES;
}
if (arm_fpe & BIT_UFC) {
info.si_code = TARGET_FPE_FLTUND;
}
if (arm_fpe & BIT_OFC) {
info.si_code = TARGET_FPE_FLTOVF;
}
if (arm_fpe & BIT_DZC) {
info.si_code = TARGET_FPE_FLTDIV;
}
if (arm_fpe & BIT_IOC) {
info.si_code = TARGET_FPE_FLTINV;
}
info.si_code = TARGET_SI_KERNEL;

info._sifields._sigfault._addr = env->regs[15];
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
} else {
env->regs[15] += 4;
Expand Down

0 comments on commit 0a50285

Please sign in to comment.