linux-user/sparc: Fix sparc64_{get, set}_context traps
These traps are present for sparc64 with ilp32, aka sparc32plus.
Enabling them means adjusting the defines over in signal.c,
and fixing an incorrect usage of abi_ulong when we really meant
the full register, target_ulong.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230216054516.1267305-7-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c
index 2bcf325..edbc4f3 100644
--- a/linux-user/sparc/cpu_loop.c
+++ b/linux-user/sparc/cpu_loop.c
@@ -213,6 +213,17 @@
env->npc = env->npc + 4;
break;
+#ifdef TARGET_SPARC64
+ case TT_TRAP + 0x6e:
+ flush_windows(env);
+ sparc64_get_context(env);
+ break;
+ case TT_TRAP + 0x6f:
+ flush_windows(env);
+ sparc64_set_context(env);
+ break;
+#endif
+
case TARGET_TT_SPILL: /* window overflow */
save_window(env);
break;
@@ -220,18 +231,6 @@
restore_window(env);
break;
-#ifdef TARGET_SPARC64
-#ifndef TARGET_ABI32
- case 0x16e:
- flush_windows(env);
- sparc64_get_context(env);
- break;
- case 0x16f:
- flush_windows(env);
- sparc64_set_context(env);
- break;
-#endif
-#endif
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
break;