From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>, laurent@vivier.eu
Subject: [PATCH v4 05/24] linux-user/hppa: Use force_sig_fault
Date: Mon, 20 Dec 2021 13:05:09 -0800 [thread overview]
Message-ID: <20211220210529.150423-6-richard.henderson@linaro.org> (raw)
In-Reply-To: <20211220210529.150423-1-richard.henderson@linaro.org>
Use the new function instead of setting up a target_siginfo_t
and calling queue_signal. Fill in the missing PC for SIGTRAP
and missing si_code for SIGBUS.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/hppa/cpu_loop.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c
index 375576c8f0..b09caa1111 100644
--- a/linux-user/hppa/cpu_loop.c
+++ b/linux-user/hppa/cpu_loop.c
@@ -110,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;
@@ -147,26 +146,15 @@ void cpu_loop(CPUHPPAState *env)
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
next prev parent reply other threads:[~2021-12-20 21:12 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 21:05 [PATCH v4 00/24] linux-user: Clean up siginfo_t handling Richard Henderson
2021-12-20 21:05 ` [PATCH v4 01/24] linux-user/alpha: Set TRAP_UNK for bugchk and unknown gentrap Richard Henderson
2021-12-20 21:05 ` [PATCH v4 02/24] linux-user/alpha: Set FPE_FLTUNK for gentrap ROPRAND Richard Henderson
2021-12-20 21:05 ` [PATCH v4 03/24] linux-user/alpha: Use force_sig_fault Richard Henderson
2021-12-20 21:05 ` [PATCH v4 04/24] linux-user/cris: " Richard Henderson
2021-12-20 21:05 ` Richard Henderson [this message]
2021-12-20 21:05 ` [PATCH v4 06/24] linux-user/hppa: Use the proper si_code for PRIV_OPR, PRIV_REG, OVERFLOW Richard Henderson
2021-12-20 21:05 ` [PATCH v4 07/24] linux-user: Remove TARGET_NSIGFPE Richard Henderson
2021-12-20 22:42 ` Philippe Mathieu-Daudé
2021-12-20 21:05 ` [PATCH v4 08/24] linux-user/hppa: Set FPE_CONDTRAP for COND Richard Henderson
2021-12-20 22:44 ` Philippe Mathieu-Daudé
2021-12-20 21:05 ` [PATCH v4 09/24] linux-user/i386: Split out maybe_handle_vm86_trap Richard Henderson
2021-12-20 21:05 ` [PATCH v4 10/24] linux-user/i386: Use force_sig, force_sig_fault Richard Henderson
2021-12-20 21:05 ` [PATCH v4 11/24] linux-user/m68k: Use force_sig_fault Richard Henderson
2021-12-20 21:05 ` [PATCH v4 12/24] linux-user/microblaze: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 13/24] linux-user/microblaze: Fix SIGFPE si_codes Richard Henderson
2021-12-20 21:05 ` [PATCH v4 14/24] linux-user/mips: Improve do_break Richard Henderson
2021-12-20 21:05 ` [PATCH v4 15/24] linux-user/mips: Use force_sig_fault Richard Henderson
2021-12-20 21:05 ` [PATCH v4 16/24] target/mips: Extract break code into env->error_code Richard Henderson
2021-12-20 21:05 ` [PATCH v4 17/24] target/mips: Extract trap " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 18/24] linux-user/openrisc: Use force_sig_fault Richard Henderson
2021-12-20 21:05 ` [PATCH v4 19/24] linux-user/ppc: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 20/24] linux-user/riscv: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 21/24] linux-user/s390x: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 22/24] linux-user/sh4: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 23/24] linux-user/sparc: " Richard Henderson
2021-12-20 21:05 ` [PATCH v4 24/24] linux-user/xtensa: " Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211220210529.150423-6-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).