[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/28] linux-user/sparc: Handle division by zero traps
From: |
Laurent Vivier |
Subject: |
[PULL 20/28] linux-user/sparc: Handle division by zero traps |
Date: |
Wed, 8 Mar 2023 14:28:49 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
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>
---
linux-user/sparc/cpu_loop.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c
index c14eaea16370..e04c84286769 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 */
--
2.39.2
- [PULL 21/28] linux-user/sparc: Handle getcc, setcc, getpsr traps, (continued)
- [PULL 21/28] linux-user/sparc: Handle getcc, setcc, getpsr traps, Laurent Vivier, 2023/03/08
- [PULL 22/28] linux-user/sparc: Handle priviledged opcode trap, Laurent Vivier, 2023/03/08
- [PULL 28/28] linux-user: fix bug about incorrect base addresss of gdt on i386 and x86_64, Laurent Vivier, 2023/03/08
- [PULL 12/28] linux-user: Add translation for argument of msync(), Laurent Vivier, 2023/03/08
- [PULL 25/28] linux-user/sparc: Handle unimplemented flush trap, Laurent Vivier, 2023/03/08
- [PULL 24/28] linux-user/sparc: Handle coprocessor disabled trap, Laurent Vivier, 2023/03/08
- [PULL 26/28] linux-user/sparc: Handle floating-point exceptions, Laurent Vivier, 2023/03/08
- [PULL 27/28] linux-user/sparc: Handle tag overflow traps, Laurent Vivier, 2023/03/08
- [PULL 19/28] linux-user/sparc: Handle software breakpoint trap, Laurent Vivier, 2023/03/08
- [PULL 16/28] linux-user/sparc: Use TT_TRAP for flush windows, Laurent Vivier, 2023/03/08
- [PULL 20/28] linux-user/sparc: Handle division by zero traps,
Laurent Vivier <=
- Re: [PULL 00/28] Linux user for 8.0 patches, Peter Maydell, 2023/03/10
- [PULL 00/28] Linux user for 8.0 patches, Laurent Vivier, 2023/03/10
- [PULL 01/28] linux-user: Fix access to /proc/self/exe, Laurent Vivier, 2023/03/10
- [PULL 08/28] linux-user: Provide print_raw_param64() for 64-bit values, Laurent Vivier, 2023/03/10
- [PULL 07/28] linux-user: Fix brk() to release pages, Laurent Vivier, 2023/03/10
- [PULL 05/28] linux-user: add support for xtensa FDPIC, Laurent Vivier, 2023/03/10
- [PULL 12/28] linux-user: Add translation for argument of msync(), Laurent Vivier, 2023/03/10
- [PULL 03/28] linux-user: add target to host netlink conversions, Laurent Vivier, 2023/03/10
- [PULL 04/28] linux-user: Fix unaligned memory access in prlimit64 syscall, Laurent Vivier, 2023/03/10
- [PULL 14/28] linux-user/sparc: Tidy syscall trap, Laurent Vivier, 2023/03/10