From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>, Riku Voipio <riku.voipio@iki.fi>
Subject: [Qemu-devel] [PATCH 1/2] linux-user: define TARGET_ARCH_HAS_KA_RESTORER
Date: Mon, 2 Apr 2018 12:24:52 +0200 [thread overview]
Message-ID: <20180402102453.9883-2-laurent@vivier.eu> (raw)
In-Reply-To: <20180402102453.9883-1-laurent@vivier.eu>
Sparc as an extended sigaction structure containing
the field ka_restorer used in place of sa_restorer.
Define TARGET_ARCH_HAS_KA_RESTORER and use it
with sparc.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/signal.c | 4 ++--
linux-user/syscall.c | 7 +++++--
linux-user/syscall_defs.h | 4 ++++
3 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 2ea3e0321f..2b9752b40b 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2920,8 +2920,8 @@ static void setup_frame(int sig, struct target_sigaction *ka,
env->pc = ka->_sa_handler;
env->npc = (env->pc + 4);
/* 5. return to kernel instructions */
- if (ka->sa_restorer) {
- env->regwptr[UREG_I7] = ka->sa_restorer;
+ if (ka->ka_restorer) {
+ env->regwptr[UREG_I7] = ka->ka_restorer;
} else {
uint32_t val32;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 889abbda1e..b8353d8f13 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8699,6 +8699,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
target_siginitset(&act.sa_mask, old_act->sa_mask);
act.sa_flags = old_act->sa_flags;
act.sa_restorer = old_act->sa_restorer;
+#ifdef TARGET_ARCH_HAS_KA_RESTORER
+ act.ka_restorer = 0;
+#endif
unlock_user_struct(old_act, arg2, 0);
pact = &act;
} else {
@@ -8773,8 +8776,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
if (!lock_user_struct(VERIFY_READ, act, arg2, 1)) {
goto efault;
}
-#ifdef TARGET_SPARC
- act->sa_restorer = restorer;
+#ifdef TARGET_ARCH_HAS_KA_RESTORER
+ act->ka_restorer = restorer;
#endif
} else {
act = NULL;
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 13fe840239..7473be518b 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -435,6 +435,7 @@ int do_sigaction(int sig, const struct target_sigaction *act,
#define TARGET_SA_NODEFER 0x20u
#define TARGET_SA_RESETHAND 4u
#define TARGET_ARCH_HAS_SA_RESTORER 1
+#define TARGET_ARCH_HAS_KA_RESTORER 1
#elif defined(TARGET_MIPS)
#define TARGET_SA_NOCLDSTOP 0x00000001
#define TARGET_SA_NOCLDWAIT 0x00010000
@@ -742,6 +743,9 @@ struct target_sigaction {
abi_ulong sa_restorer;
#endif
target_sigset_t sa_mask;
+#ifdef TARGET_ARCH_HAS_KA_RESTORER
+ abi_ulong ka_restorer;
+#endif
};
#endif
--
2.14.3
next prev parent reply other threads:[~2018-04-02 10:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 10:24 [Qemu-devel] [PATCH 0/2] linux-user: fix sparc32plus emulation Laurent Vivier
2018-04-02 10:24 ` Laurent Vivier [this message]
2018-04-02 10:24 ` [Qemu-devel] [PATCH 2/2] linux-user: fix TARGET___O_TMPFILE for sparc Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180402102453.9883-2-laurent@vivier.eu \
--to=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).