summaryrefslogtreecommitdiffstats
path: root/linux-user/sparc/signal.c
diff options
context:
space:
mode:
authorRichard Henderson2021-04-26 04:53:25 +0200
committerLaurent Vivier2021-05-15 21:43:23 +0200
commit44a5f861718caeb6f7b1ac7a6c279d32fc84041a (patch)
treec71c394e5b87419443302354a31643686d639c74 /linux-user/sparc/signal.c
parentlinux-user/sparc: Use target_pt_regs (diff)
downloadqemu-44a5f861718caeb6f7b1ac7a6c279d32fc84041a.tar.gz
qemu-44a5f861718caeb6f7b1ac7a6c279d32fc84041a.tar.xz
qemu-44a5f861718caeb6f7b1ac7a6c279d32fc84041a.zip
linux-user/sparc: Split out save_reg_win
Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210426025334.1168495-17-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/sparc/signal.c')
-rw-r--r--linux-user/sparc/signal.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c
index 0d9305818f..69fee5a76a 100644
--- a/linux-user/sparc/signal.c
+++ b/linux-user/sparc/signal.c
@@ -150,6 +150,18 @@ static void restore_pt_regs(struct target_pt_regs *regs, CPUSPARCState *env)
}
}
+static void save_reg_win(struct target_reg_window *win, CPUSPARCState *env)
+{
+ int i;
+
+ for (i = 0; i < 8; i++) {
+ __put_user(env->regwptr[i + WREG_L0], &win->locals[i]);
+ }
+ for (i = 0; i < 8; i++) {
+ __put_user(env->regwptr[i + WREG_I0], &win->ins[i]);
+ }
+}
+
#define NF_ALIGNEDSZ (((sizeof(struct target_signal_frame) + 7) & (~7)))
void setup_frame(int sig, struct target_sigaction *ka,
@@ -183,12 +195,7 @@ void setup_frame(int sig, struct target_sigaction *ka,
__put_user(set->sig[i + 1], &sf->extramask[i]);
}
- for (i = 0; i < 8; i++) {
- __put_user(env->regwptr[i + WREG_L0], &sf->ss.win.locals[i]);
- }
- for (i = 0; i < 8; i++) {
- __put_user(env->regwptr[i + WREG_I0], &sf->ss.win.ins[i]);
- }
+ save_reg_win(&sf->ss.win, env);
/* 3. signal handler back-trampoline and parameters */
env->regwptr[WREG_SP] = sf_addr;