diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-04-25 19:53:29 -0700 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2021-05-15 21:43:23 +0200 |
commit | 757d260143488d1d0b4016020969ab28259b854b (patch) | |
tree | ebb8e4864fbf8f0355ce3dcf2b7b5687af170143 /linux-user | |
parent | 819f6df1ef83385e59e182dc6223d1ad533d393c (diff) | |
download | qemu-757d260143488d1d0b4016020969ab28259b854b.zip qemu-757d260143488d1d0b4016020969ab28259b854b.tar.gz qemu-757d260143488d1d0b4016020969ab28259b854b.tar.bz2 |
linux-user/sparc: Clean up setup_frame
Clean up a goto label with a single use. Remove #if 0.
Remove useless parentheses. Fold constants into __put_user.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210426025334.1168495-21-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/sparc/signal.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 4a0578e..f0f614a 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -192,14 +192,13 @@ void setup_frame(int sig, struct target_sigaction *ka, size_t sf_size = sizeof(*sf) + sizeof(struct target_siginfo_fpu); int i; - /* 1. Make sure everything is clean */ - sf_addr = get_sigframe(ka, env, sf_size); trace_user_setup_frame(env, sf_addr); sf = lock_user(VERIFY_WRITE, sf_addr, sf_size, 0); if (!sf) { - goto sigsegv; + force_sigsegv(sig); + return; } /* 2. Save the current process state */ @@ -228,33 +227,21 @@ void setup_frame(int sig, struct target_sigaction *ka, /* 4. signal handler */ env->pc = ka->_sa_handler; - env->npc = (env->pc + 4); + env->npc = env->pc + 4; + /* 5. return to kernel instructions */ if (ka->ka_restorer) { env->regwptr[WREG_O7] = ka->ka_restorer; } else { - uint32_t val32; - env->regwptr[WREG_O7] = sf_addr + offsetof(struct target_signal_frame, insns) - 2 * 4; /* mov __NR_sigreturn, %g1 */ - val32 = 0x821020d8; - __put_user(val32, &sf->insns[0]); - + __put_user(0x821020d8u, &sf->insns[0]); /* t 0x10 */ - val32 = 0x91d02010; - __put_user(val32, &sf->insns[1]); + __put_user(0x91d02010u, &sf->insns[1]); } unlock_user(sf, sf_addr, sf_size); - return; -#if 0 -sigill_and_return: - force_sig(TARGET_SIGILL); -#endif -sigsegv: - unlock_user(sf, sf_addr, sizeof(struct target_signal_frame)); - force_sigsegv(sig); } void setup_rt_frame(int sig, struct target_sigaction *ka, |