summaryrefslogtreecommitdiffstats
path: root/linux-user/nios2/cpu_loop.c
diff options
context:
space:
mode:
authorRichard Henderson2022-04-21 17:17:12 +0200
committerRichard Henderson2022-04-26 17:16:41 +0200
commit345b7a8757e89a8f70a1fa09c6d51310650ef8be (patch)
tree57adcb4bfe3cb0e3d115c846475b5113989d388e /linux-user/nios2/cpu_loop.c
parenttarget/nios2: Remove CPU_INTERRUPT_NMI (diff)
downloadqemu-345b7a8757e89a8f70a1fa09c6d51310650ef8be.tar.gz
qemu-345b7a8757e89a8f70a1fa09c6d51310650ef8be.tar.xz
qemu-345b7a8757e89a8f70a1fa09c6d51310650ef8be.zip
target/nios2: Support division error exception
Division may (optionally) raise a division exception. Since the linux kernel has been prepared for this for some time, enable it by default. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220421151735.31996-42-richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/nios2/cpu_loop.c')
-rw-r--r--linux-user/nios2/cpu_loop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/linux-user/nios2/cpu_loop.c b/linux-user/nios2/cpu_loop.c
index c5e68ac048..11ecb71843 100644
--- a/linux-user/nios2/cpu_loop.c
+++ b/linux-user/nios2/cpu_loop.c
@@ -38,6 +38,10 @@ void cpu_loop(CPUNios2State *env)
/* just indicate that signals should be handled asap */
break;
+ case EXCP_DIV:
+ force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc);
+ break;
+
case EXCP_TRAP:
/*
* TODO: This advance should be done in the translator, as