[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 07/25] linux-user/hppa: Use force_sig_fault
From: |
Richard Henderson |
Subject: |
[PATCH v3 07/25] linux-user/hppa: Use force_sig_fault |
Date: |
Sat, 18 Sep 2021 18:57:00 -0700 |
Use the new function instead of setting up a target_siginfo_t
and calling queue_signal. Fill in the missing PC for SIGTRAP.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/hppa/cpu_loop.c | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c
index a6122b3594..c01ccbbdc0 100644
--- a/linux-user/hppa/cpu_loop.c
+++ b/linux-user/hppa/cpu_loop.c
@@ -20,6 +20,8 @@
#include "qemu/osdep.h"
#include "qemu.h"
#include "cpu_loop-common.h"
+#include "signal-common.h"
+
static abi_ulong hppa_lws(CPUHPPAState *env)
{
@@ -108,7 +110,6 @@ static abi_ulong hppa_lws(CPUHPPAState *env)
void cpu_loop(CPUHPPAState *env)
{
CPUState *cs = env_cpu(env);
- target_siginfo_t info;
abi_ulong ret;
int trapnr;
@@ -143,35 +144,20 @@ void cpu_loop(CPUHPPAState *env)
env->iaoq_b = env->gr[31] + 4;
break;
case EXCP_UNALIGN:
- info.si_signo = TARGET_SIGBUS;
- info.si_errno = 0;
- info.si_code = 0;
- info._sifields._sigfault._addr = env->cr[CR_IOR];
- queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+ force_sig_fault(TARGET_SIGBUS, TARGET_BUS_ADRALN, env->cr[CR_IOR]);
break;
case EXCP_ILL:
case EXCP_PRIV_OPR:
case EXCP_PRIV_REG:
- info.si_signo = TARGET_SIGILL;
- info.si_errno = 0;
- info.si_code = TARGET_ILL_ILLOPN;
- info._sifields._sigfault._addr = env->iaoq_f;
- queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+ force_sig_fault(TARGET_SIGILL, TARGET_ILL_ILLOPN, env->iaoq_f);
break;
case EXCP_OVERFLOW:
case EXCP_COND:
case EXCP_ASSIST:
- info.si_signo = TARGET_SIGFPE;
- info.si_errno = 0;
- info.si_code = 0;
- info._sifields._sigfault._addr = env->iaoq_f;
- queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+ force_sig_fault(TARGET_SIGFPE, 0, env->iaoq_f);
break;
case EXCP_DEBUG:
- info.si_signo = TARGET_SIGTRAP;
- info.si_errno = 0;
- info.si_code = TARGET_TRAP_BRKPT;
- queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
+ force_sig_fault(TARGET_SIGTRAP, TARGET_TRAP_BRKPT, env->iaoq_f);
break;
case EXCP_INTERRUPT:
/* just indicate that signals should be handled asap */
--
2.25.1
- [PATCH v3 00/25] linux-user: Clean up siginfo_t handling, Richard Henderson, 2021/09/18
- [PATCH v3 01/25] linux-user/arm: Use force_sig_fault(), Richard Henderson, 2021/09/18
- [PATCH v3 03/25] linux-user/alpha: Set TRAP_UNK for bugchk and unknown gentrap, Richard Henderson, 2021/09/18
- [PATCH v3 04/25] linux-user/alpha: Set FPE_FLTUNK for gentrap ROPRAND, Richard Henderson, 2021/09/18
- [PATCH v3 02/25] linux-user/aarch64: Use force_sig_fault(), Richard Henderson, 2021/09/18
- [PATCH v3 05/25] linux-user/alpha: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 06/25] linux-user/cris: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 10/25] linux-user/i386: Split out maybe_handle_vm86_trap, Richard Henderson, 2021/09/18
- [PATCH v3 07/25] linux-user/hppa: Use force_sig_fault,
Richard Henderson <=
- [PATCH v3 08/25] linux-user/hppa: Use the proper si_code for PRIV_OPR, PRIV_REG, OVERFLOW, Richard Henderson, 2021/09/18
- [PATCH v3 11/25] linux-user/i386: Use force_sig, force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 14/25] linux-user/microblaze: Fix SIGFPE si_codes, Richard Henderson, 2021/09/18
- [PATCH v3 09/25] linux-user/hppa: Set FPE_CONDTRAP for COND, Richard Henderson, 2021/09/18
- [PATCH v3 17/25] target/mips: Extract break code into env->error_code, Richard Henderson, 2021/09/18
- [PATCH v3 12/25] linux-user/m68k: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 13/25] linux-user/microblaze: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 16/25] linux-user/mips: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 22/25] linux-user/s390x: Use force_sig_fault, Richard Henderson, 2021/09/18
- [PATCH v3 24/25] linux-user/sparc: Use force_sig_fault, Richard Henderson, 2021/09/18