On Sun, 9 Jan 2022 at 16:29, Warner Losh <i...@bsdimp.com> wrote:
>
> Implement host_to_target_signal and target_to_host_signal.
>
> Signed-off-by: Stacey Son <s...@freebsd.org>
> Signed-off-by: Kyle Evans <kev...@freebsd.org>
> Signed-off-by: Warner Losh <i...@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.mayd...@linaro.org>

thanks
-- PMM

Reply via email to