[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/30] bsd-user/signal.c: implement abstract target / host si
|
From: |
Peter Maydell |
|
Subject: |
Re: [PATCH 09/30] bsd-user/signal.c: implement abstract target / host signal translation |
|
Date: |
Thu, 13 Jan 2022 17:44:54 +0000 |
On Sun, 9 Jan 2022 at 16:29, Warner Losh <imp@bsdimp.com> wrote:
>
> Implement host_to_target_signal and target_to_host_signal.
>
> Signed-off-by: Stacey Son <sson@FreeBSD.org>
> Signed-off-by: Kyle Evans <kevans@freebsd.org>
> Signed-off-by: Warner Losh <imp@bsdimp.com>
> ---
> bsd-user/qemu.h | 2 ++
> bsd-user/signal.c | 11 +++++++++++
> 2 files changed, 13 insertions(+)
>
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index 1b3b974afe9..334f8b1d715 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -210,6 +210,8 @@ long do_sigreturn(CPUArchState *env);
> long do_rt_sigreturn(CPUArchState *env);
> void queue_signal(CPUArchState *env, int sig, target_siginfo_t *info);
> abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong
> sp);
> +int target_to_host_signal(int sig);
> +int host_to_target_signal(int sig);
>
> /* mmap.c */
> int target_mprotect(abi_ulong start, abi_ulong len, int prot);
> diff --git a/bsd-user/signal.c b/bsd-user/signal.c
> index 844dfa19095..7ea86149981 100644
> --- a/bsd-user/signal.c
> +++ b/bsd-user/signal.c
> @@ -2,6 +2,7 @@
> * Emulation of BSD signals
> *
> * Copyright (c) 2003 - 2008 Fabrice Bellard
> + * Copyright (c) 2013 Stacey Son
> *
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -27,6 +28,16 @@
> * fork.
> */
>
> +int host_to_target_signal(int sig)
> +{
> + return sig;
> +}
> +
> +int target_to_host_signal(int sig)
> +{
> + return sig;
> +}
> +
This could use a comment:
/*
* For the BSDs signal numbers are always the same regardless of
* CPU architecture, so (unlike Linux) these functions are just
* the identity mapping.
*/
(assuming that is correct, of course!)
Otherwise
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- Re: [PATCH 06/30] bsd-user/arm/target_arch_cpu.h: Correct code pointer, (continued)
Re: [PATCH 06/30] bsd-user/arm/target_arch_cpu.h: Correct code pointer, Richard Henderson, 2022/01/23
[PATCH 08/30] bsd-user/arm/target_arch_cpu.h: Implement data faults, Warner Losh, 2022/01/09
Re: [PATCH 08/30] bsd-user/arm/target_arch_cpu.h: Implement data faults, Richard Henderson, 2022/01/23
[PATCH 09/30] bsd-user/signal.c: implement abstract target / host signal translation, Warner Losh, 2022/01/09
- Re: [PATCH 09/30] bsd-user/signal.c: implement abstract target / host signal translation,
Peter Maydell <=
[PATCH 10/30] bsd-user/signal.c: Implement signal_init(), Warner Losh, 2022/01/09
[PATCH 13/30] bsd-user/host/x86_64/host-signal.h: Implement host_signal_*, Warner Losh, 2022/01/09
[PATCH 12/30] bsd-user/host/i386/host-signal.h: Implement host_signal_*, Warner Losh, 2022/01/09