aboutsummaryrefslogtreecommitdiff
path: root/linux-user/mips/signal.c
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2018-04-11 21:23:47 +0200
committerLaurent Vivier <laurent@vivier.eu>2018-05-03 18:29:15 +0200
commit465e237bf7cb6a9d8f9f137508125a14efcce1d6 (patch)
tree1eaf5f3576d7f080b2a664466582975ae81ae986 /linux-user/mips/signal.c
parente8fa72957419c11984608062c7dcb204a6003a06 (diff)
linux-user: introduce target_sigsp() and target_save_altstack()
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180411192347.30228-1-laurent@vivier.eu>
Diffstat (limited to 'linux-user/mips/signal.c')
-rw-r--r--linux-user/mips/signal.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/linux-user/mips/signal.c b/linux-user/mips/signal.c
index adeb5a4241..ed9849c7f6 100644
--- a/linux-user/mips/signal.c
+++ b/linux-user/mips/signal.c
@@ -179,20 +179,12 @@ get_sigframe(struct target_sigaction *ka, CPUMIPSState *regs, size_t frame_size)
{
unsigned long sp;
- /* Default to using normal stack */
- sp = regs->active_tc.gpr[29];
-
/*
* FPU emulator may have its own trampoline active just
* above the user stack, 16-bytes before the next lowest
* 16 byte boundary. Try to avoid trashing it.
*/
- sp -= 32;
-
- /* This is the X/Open sanctioned signal stack switching. */
- if ((ka->sa_flags & TARGET_SA_ONSTACK) && (sas_ss_flags (sp) == 0)) {
- sp = target_sigaltstack_used.ss_sp + target_sigaltstack_used.ss_size;
- }
+ sp = target_sigsp(get_sp_from_cpustate(regs) - 32, ka);
return (sp - frame_size) & ~7;
}
@@ -323,10 +315,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,
__put_user(0, &frame->rs_uc.tuc_flags);
__put_user(0, &frame->rs_uc.tuc_link);
- __put_user(target_sigaltstack_used.ss_sp, &frame->rs_uc.tuc_stack.ss_sp);
- __put_user(target_sigaltstack_used.ss_size, &frame->rs_uc.tuc_stack.ss_size);
- __put_user(sas_ss_flags(get_sp_from_cpustate(env)),
- &frame->rs_uc.tuc_stack.ss_flags);
+ target_save_altstack(&frame->rs_uc.tuc_stack, env);
setup_sigcontext(env, &frame->rs_uc.tuc_mcontext);