Message ID | 20210428193408.233706-3-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | linux-user/s390x: some signal fixes | expand |
On 28.04.21 21:33, Richard Henderson wrote: > Using the right type simplifies the frame setup. > > Signed-off-by: Richard Henderson <richard.henderson@linaro.org> > --- > linux-user/s390x/signal.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c > index 707fb603d7..fece8ab97b 100644 > --- a/linux-user/s390x/signal.c > +++ b/linux-user/s390x/signal.c > @@ -25,7 +25,6 @@ > #define __NUM_FPRS 16 > #define __NUM_ACRS 16 > > -#define S390_SYSCALL_SIZE 2 > #define __SIGNAL_FRAMESIZE 160 /* FIXME: 31-bit mode -> 96 */ > > #define _SIGCONTEXT_NSIG 64 > @@ -62,7 +61,7 @@ typedef struct { > target_sigcontext sc; > target_sigregs sregs; > int signo; > - uint8_t retcode[S390_SYSCALL_SIZE]; > + uint16_t retcode; > } sigframe; > > struct target_ucontext { > @@ -75,7 +74,7 @@ struct target_ucontext { > > typedef struct { > uint8_t callee_used_stack[__SIGNAL_FRAMESIZE]; > - uint8_t retcode[S390_SYSCALL_SIZE]; > + uint16_t retcode; > struct target_siginfo info; > struct target_ucontext uc; > } rt_sigframe; > @@ -155,7 +154,7 @@ void setup_frame(int sig, struct target_sigaction *ka, > env->regs[14] = (frame_addr + offsetof(sigframe, retcode)) > | PSW_ADDR_AMODE; > __put_user(S390_SYSCALL_OPCODE | TARGET_NR_sigreturn, > - (uint16_t *)(frame->retcode)); > + &frame->retcode); > } > > /* Set up backchain. */ > @@ -216,7 +215,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, > env->regs[14] = (frame_addr + offsetof(typeof(*frame), retcode)) > | PSW_ADDR_AMODE; > __put_user(S390_SYSCALL_OPCODE | TARGET_NR_rt_sigreturn, > - (uint16_t *)(frame->retcode)); > + &frame->retcode); > } > > /* Set up backchain. */ > Reviewed-by: David Hildenbrand <david@redhat.com> -- Thanks, David / dhildenb
diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index 707fb603d7..fece8ab97b 100644 --- a/linux-user/s390x/signal.c +++ b/linux-user/s390x/signal.c @@ -25,7 +25,6 @@ #define __NUM_FPRS 16 #define __NUM_ACRS 16 -#define S390_SYSCALL_SIZE 2 #define __SIGNAL_FRAMESIZE 160 /* FIXME: 31-bit mode -> 96 */ #define _SIGCONTEXT_NSIG 64 @@ -62,7 +61,7 @@ typedef struct { target_sigcontext sc; target_sigregs sregs; int signo; - uint8_t retcode[S390_SYSCALL_SIZE]; + uint16_t retcode; } sigframe; struct target_ucontext { @@ -75,7 +74,7 @@ struct target_ucontext { typedef struct { uint8_t callee_used_stack[__SIGNAL_FRAMESIZE]; - uint8_t retcode[S390_SYSCALL_SIZE]; + uint16_t retcode; struct target_siginfo info; struct target_ucontext uc; } rt_sigframe; @@ -155,7 +154,7 @@ void setup_frame(int sig, struct target_sigaction *ka, env->regs[14] = (frame_addr + offsetof(sigframe, retcode)) | PSW_ADDR_AMODE; __put_user(S390_SYSCALL_OPCODE | TARGET_NR_sigreturn, - (uint16_t *)(frame->retcode)); + &frame->retcode); } /* Set up backchain. */ @@ -216,7 +215,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka, env->regs[14] = (frame_addr + offsetof(typeof(*frame), retcode)) | PSW_ADDR_AMODE; __put_user(S390_SYSCALL_OPCODE | TARGET_NR_rt_sigreturn, - (uint16_t *)(frame->retcode)); + &frame->retcode); } /* Set up backchain. */
Using the right type simplifies the frame setup. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- linux-user/s390x/signal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) -- 2.25.1