[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 12/24] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline

From: Warner Losh
Subject: Re: [PATCH 12/24] bsd-user/arm/target_arch_sigtramp.h: Signal Trampoline for arm
Date: Thu, 28 Oct 2021 13:35:50 -0600

On Thu, Oct 28, 2021 at 9:42 AM Richard Henderson <richard.henderson@linaro.org> wrote:
On 10/19/21 9:44 AM, Warner Losh wrote:
> +    /*
> +     * The code has to load r7 manually rather than using
> +     * "ldr r7, =SYS_return to make sure the size of the
> +     * code is correct.
> +     */

This comment was applicable to the original freebsd asm source; it has no bearing on the
hex instructions below

Yea, the code size will always be correct...
> +    uint32_t sigtramp_code[] = {
> +    /* 1 */ 0xE1A0000D,                  /* mov r0, sp */
> +    /* 2 */ 0xE2800000 + sigf_uc,        /* add r0, r0, #SIGF_UC */

I guess this was a bit of thumb1 source that accidentally became ABI?
Otherwise I can't think why you wouldn't squish the mov into the add.

It's in our ABI. gdb and others know what the sigcode signature looks like for sigreturn
so we can't really change it without a lot of pain... So we're kinda stuck with very
old-school ARM code sequences for our modern armv7 port. There's likely no
reason to have the defensive call to sys_exit either, but like I said, we're kinda
stuck with it w/o replacing it in a number of external sources...  You may see similar
issues with the aarch64 code I'll post next.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]