|
From: | Richard Henderson |
Subject: | Re: [PATCH 23/24] bsd-user/arm/target_arch_signal.h: arm get_ucontext_sigreturn |
Date: | Thu, 28 Oct 2021 10:59:54 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 10/19/21 9:44 AM, Warner Losh wrote:
+/* Compare to arm/arm/machdep.c sys_sigreturn() */ +static inline abi_long get_ucontext_sigreturn(CPUARMState *regs, + abi_ulong target_sf, abi_ulong *target_uc) +{ + uint32_t cpsr = cpsr_read(regs); + + *target_uc = 0; + + if ((cpsr & CPSR_M) != ARM_CPU_MODE_USR || + (cpsr & (CPSR_I | CPSR_F)) != 0) { + return -TARGET_EINVAL; + } + + *target_uc = target_sf; + + return 0; +}
Since you've not yet filled in signal.c, I can't opine too much, but I'll note that the kernel has this check in set_mcontext, and sys_sigreturn defers to that for the validation.
So I think this can just be the final assignment. r~
[Prev in Thread] | Current Thread | [Next in Thread] |