[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 55/55] user: Prefer fast cpu_env() over slower CPU QOM cast macro
From: |
Thomas Huth |
Subject: |
[PULL 55/55] user: Prefer fast cpu_env() over slower CPU QOM cast macro |
Date: |
Tue, 12 Mar 2024 13:43:39 +0100 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Mechanical patch produced running the command documented
in scripts/coccinelle/cpu_env.cocci_template header.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-ID: <20240129164514.73104-30-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
bsd-user/signal.c | 3 +--
linux-user/signal.c | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index e9f80a06d3..3ac50c2d71 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -463,14 +463,13 @@ static int fatal_signal(int sig)
void force_sig_fault(int sig, int code, abi_ulong addr)
{
CPUState *cpu = thread_cpu;
- CPUArchState *env = cpu_env(cpu);
target_siginfo_t info = {};
info.si_signo = sig;
info.si_errno = 0;
info.si_code = code;
info.si_addr = addr;
- queue_signal(env, sig, QEMU_SI_FAULT, &info);
+ queue_signal(cpu_env(cpu), sig, QEMU_SI_FAULT, &info);
}
static void host_signal_handler(int host_sig, siginfo_t *info, void *puc)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index cc7dd78e41..1aebf3fc47 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -623,7 +623,6 @@ void signal_init(void)
void force_sig(int sig)
{
CPUState *cpu = thread_cpu;
- CPUArchState *env = cpu_env(cpu);
target_siginfo_t info = {};
info.si_signo = sig;
@@ -631,7 +630,7 @@ void force_sig(int sig)
info.si_code = TARGET_SI_KERNEL;
info._sifields._kill._pid = 0;
info._sifields._kill._uid = 0;
- queue_signal(env, info.si_signo, QEMU_SI_KILL, &info);
+ queue_signal(cpu_env(cpu), info.si_signo, QEMU_SI_KILL, &info);
}
/*
@@ -641,14 +640,13 @@ void force_sig(int sig)
void force_sig_fault(int sig, int code, abi_ulong addr)
{
CPUState *cpu = thread_cpu;
- CPUArchState *env = cpu_env(cpu);
target_siginfo_t info = {};
info.si_signo = sig;
info.si_errno = 0;
info.si_code = code;
info._sifields._sigfault._addr = addr;
- queue_signal(env, sig, QEMU_SI_FAULT, &info);
+ queue_signal(cpu_env(cpu), sig, QEMU_SI_FAULT, &info);
}
/* Force a SIGSEGV if we couldn't write to memory trying to set
--
2.44.0
- [PULL 39/55] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro, (continued)
- [PULL 39/55] target/avr: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 51/55] target/sh4: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 40/55] target/cris: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 37/55] target: Replace CPU_GET_CLASS(cpu -> obj) in cpu_reset_hold() handler, Thomas Huth, 2024/03/12
- [PULL 44/55] target/m68k: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 42/55] target/i386/hvf: Use CPUState typedef, Thomas Huth, 2024/03/12
- [PULL 48/55] target/openrisc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 49/55] target/ppc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 50/55] target/rx: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 52/55] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 55/55] user: Prefer fast cpu_env() over slower CPU QOM cast macro,
Thomas Huth <=
- [PULL 29/55] hw/virtio/vhost: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 33/55] error: Move ERRP_GUARD() to the beginning of the function, Thomas Huth, 2024/03/12
- [PULL 32/55] target/s390x/cpu_models: Fix missing ERRP_GUARD() for error_prepend(), Thomas Huth, 2024/03/12
- [PULL 53/55] target/tricore: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- [PULL 54/55] target/xtensa: Prefer fast cpu_env() over slower CPU QOM cast macro, Thomas Huth, 2024/03/12
- Re: [PULL 00/55] Misc ERRP_GUARD() and cpu_env() patches, Peter Maydell, 2024/03/12