[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/21] linux-user/arm: Implement setup_sigtramp
From: |
Alex Bennée |
Subject: |
Re: [PATCH 04/21] linux-user/arm: Implement setup_sigtramp |
Date: |
Wed, 16 Jun 2021 14:46:12 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Richard Henderson <richard.henderson@linaro.org> writes:
> ARM is more complicated than the others, in that we also
> have trampolines for using SA_RESTORER with FDPIC, and
> we need to create trampolines for both ARM and Thumb modes.
>
> Cc: qemu-arm@nongnu.org
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/arm/target_signal.h | 2 +
> linux-user/arm/signal.c | 170 +++++++++++++++++++--------------
> 2 files changed, 100 insertions(+), 72 deletions(-)
>
> +
> + /* ARM sigframe */
> + _Static_assert(SIGFRAME_FDPIC_OFS <= 0xfff);
> + __put_user(0xe59d9000 | SIGFRAME_FDPIC_OFS, &tramp[i++]);
> + __put_user(0xe8998200, &tramp[i++]);
Erm is this based on your c11 series?
> +
> + /* Thumb sigframe */
> + _Static_assert(SIGFRAME_FDPIC_OFS <= 0xff << 2);
> + _Static_assert((SIGFRAME_FDPIC_OFS & 3) == 0);
> + __put_user(0x9a00e9dd | (SIGFRAME_FDPIC_OFS << 14), &tramp[i++]);
> + __put_user(0x46c04750, &tramp[i++]);
> +
> + /* ARM rt_sigframe */
> + _Static_assert(RT_SIGFRAME_FDPIC_OFS <= 0xfff);
> + __put_user(0xe59d9000 | RT_SIGFRAME_FDPIC_OFS, &tramp[i++]);
> + __put_user(0xe8998200, &tramp[i++]);
> +
> + /* Thumb rt_sigframe */
> + _Static_assert(RT_SIGFRAME_FDPIC_OFS <= 0xff << 2);
> + _Static_assert((RT_SIGFRAME_FDPIC_OFS & 3) == 0);
> + __put_user(0x9a00e9dd | (RT_SIGFRAME_FDPIC_OFS << 14), &tramp[i++]);
> + __put_user(0x46c04750, &tramp[i++]);
> +
> + unlock_user(tramp, sigtramp_page, total_size);
> +}
--
Alex Bennée