diff options
author | 2023-02-15 19:45:09 -1000 | |
---|---|---|
committer | 2023-03-10 20:45:47 +0100 | |
commit | 0908007f76bd3af297e6abdf6edb83a18b0938e0 (patch) | |
tree | 0172fa12075c86535fb4aa664ba6128b57489c0a /linux-user/sparc | |
parent | linux-user/sparc: Handle software breakpoint trap (diff) | |
download | qemu-0908007f76bd3af297e6abdf6edb83a18b0938e0.tar.xz qemu-0908007f76bd3af297e6abdf6edb83a18b0938e0.zip |
linux-user/sparc: Handle division by zero traps
In addition to the hw trap vector, there is a software trap
assigned for older sparc without hw division instructions.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230216054516.1267305-9-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/sparc')
-rw-r--r-- | linux-user/sparc/cpu_loop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index c14eaea163..e04c842867 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -211,6 +211,11 @@ void cpu_loop (CPUSPARCState *env) force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->pc); break; + case TT_TRAP + 0x02: /* div0 */ + case TT_DIV_ZERO: + force_sig_fault(TARGET_SIGFPE, TARGET_FPE_INTDIV, env->pc); + break; + case TT_TRAP + 0x03: /* flush windows */ flush_windows(env); /* next instruction */ |