aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorMatheus Ferst <matheus.ferst@eldorado.org.br>2022-01-13 14:04:55 -0300
committerLaurent Vivier <laurent@vivier.eu>2022-03-08 16:01:08 +0100
commit62089c849d49f92823c68624720cdac8fa4b43e0 (patch)
treeb8a95211658bb1cdf6dd72113228217e0f65ae11 /tests/tcg
parent083fe9a12d2025bb719ce8fb8cef86266f9bdddd (diff)
tests/tcg/ppc64le: change signal_save_restore_xer to use SIGTRAP
Now that linux-user delivers the signal on tw, we can change signal_save_restore_xer to use SIGTRAP instead of SIGILL. Suggested-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br> Message-Id: <20220113170456.1796911-3-matheus.ferst@eldorado.org.br> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/ppc64le/signal_save_restore_xer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/tcg/ppc64le/signal_save_restore_xer.c b/tests/tcg/ppc64le/signal_save_restore_xer.c
index e4f8a07dd7..9227f4f455 100644
--- a/tests/tcg/ppc64le/signal_save_restore_xer.c
+++ b/tests/tcg/ppc64le/signal_save_restore_xer.c
@@ -11,7 +11,7 @@
uint64_t saved;
-void sigill_handler(int sig, siginfo_t *si, void *ucontext)
+void sigtrap_handler(int sig, siginfo_t *si, void *ucontext)
{
ucontext_t *uc = ucontext;
uc->uc_mcontext.regs->nip += 4;
@@ -23,14 +23,14 @@ int main(void)
{
uint64_t initial = XER_CA | XER_CA32, restored;
struct sigaction sa = {
- .sa_sigaction = sigill_handler,
+ .sa_sigaction = sigtrap_handler,
.sa_flags = SA_SIGINFO
};
- sigaction(SIGILL, &sa, NULL);
+ sigaction(SIGTRAP, &sa, NULL);
asm("mtspr 1, %1\n\t"
- ".long 0x0\n\t"
+ "trap\n\t"
"mfspr %0, 1\n\t"
: "=r" (restored)
: "r" (initial));