From 345b7a8757e89a8f70a1fa09c6d51310650ef8be Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 21 Apr 2022 08:17:12 -0700 Subject: 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 Signed-off-by: Richard Henderson Message-Id: <20220421151735.31996-42-richard.henderson@linaro.org> --- linux-user/nios2/cpu_loop.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux-user/nios2') 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 -- cgit v1.2.3