[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/28] linux-user/sparc: Tidy window spill/fill traps
From: |
Laurent Vivier |
Subject: |
[PULL 17/28] linux-user/sparc: Tidy window spill/fill traps |
Date: |
Wed, 8 Mar 2023 14:28:46 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Add some macros to localize the hw difference between v9 and pre-v9.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230216054516.1267305-6-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/sparc/cpu_loop.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c
index e1d08ff2045c..2bcf32590fa1 100644
--- a/linux-user/sparc/cpu_loop.c
+++ b/linux-user/sparc/cpu_loop.c
@@ -158,6 +158,15 @@ static void flush_windows(CPUSPARCState *env)
#define syscall_cc xcc
#endif
+/* Avoid ifdefs below for the v9 and pre-v9 hw traps. */
+#ifdef TARGET_SPARC64
+#define TARGET_TT_SPILL TT_SPILL
+#define TARGET_TT_FILL TT_FILL
+#else
+#define TARGET_TT_SPILL TT_WIN_OVF
+#define TARGET_TT_FILL TT_WIN_UNF
+#endif
+
void cpu_loop (CPUSPARCState *env)
{
CPUState *cs = env_cpu(env);
@@ -204,20 +213,14 @@ void cpu_loop (CPUSPARCState *env)
env->npc = env->npc + 4;
break;
-#ifndef TARGET_SPARC64
- case TT_WIN_OVF: /* window overflow */
- save_window(env);
- break;
- case TT_WIN_UNF: /* window underflow */
- restore_window(env);
- break;
-#else
- case TT_SPILL: /* window overflow */
+ case TARGET_TT_SPILL: /* window overflow */
save_window(env);
break;
- case TT_FILL: /* window underflow */
+ case TARGET_TT_FILL: /* window underflow */
restore_window(env);
break;
+
+#ifdef TARGET_SPARC64
#ifndef TARGET_ABI32
case 0x16e:
flush_windows(env);
--
2.39.2
- [PULL 07/28] linux-user: Fix brk() to release pages, (continued)
- [PULL 07/28] linux-user: Fix brk() to release pages, Laurent Vivier, 2023/03/08
- [PULL 05/28] linux-user: add support for xtensa FDPIC, Laurent Vivier, 2023/03/08
- [PULL 08/28] linux-user: Provide print_raw_param64() for 64-bit values, Laurent Vivier, 2023/03/08
- [PULL 09/28] linux-user: Add strace for prlimit64() syscall, Laurent Vivier, 2023/03/08
- [PULL 06/28] linux-user: fill out task state in /proc/self/stat, Laurent Vivier, 2023/03/08
- [PULL 03/28] linux-user: add target to host netlink conversions, Laurent Vivier, 2023/03/08
- [PULL 02/28] linux-user: fix timerfd read endianness conversion, Laurent Vivier, 2023/03/08
- [PULL 04/28] linux-user: Fix unaligned memory access in prlimit64 syscall, Laurent Vivier, 2023/03/08
- [PULL 13/28] linux-user: Emulate CLONE_PIDFD flag in clone(), Laurent Vivier, 2023/03/08
- [PULL 14/28] linux-user/sparc: Tidy syscall trap, Laurent Vivier, 2023/03/08
- [PULL 17/28] linux-user/sparc: Tidy window spill/fill traps,
Laurent Vivier <=
- [PULL 18/28] linux-user/sparc: Fix sparc64_{get, set}_context traps, Laurent Vivier, 2023/03/08
- [PULL 23/28] linux-user/sparc: Handle privilidged action trap, Laurent Vivier, 2023/03/08
- [PULL 15/28] linux-user/sparc: Tidy syscall error return, Laurent Vivier, 2023/03/08
- [PULL 11/28] linux-user: handle netlink flag NLA_F_NESTED, Laurent Vivier, 2023/03/08
- [PULL 10/28] linux-user: fix sockaddr_in6 endianness, Laurent Vivier, 2023/03/08
- [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