qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tom Musta <tommusta@gmail.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Tom Musta <tommusta@gmail.com>, riku.voipio@linaro.org, agraf@suse.de
Subject: [Qemu-devel] [PATCH 5/7] linux-user: Implement do_setcontext for PPC64
Date: Mon, 30 Jun 2014 08:13:40 -0500	[thread overview]
Message-ID: <1404134022-17946-6-git-send-email-tommusta@gmail.com> (raw)
In-Reply-To: <1404134022-17946-1-git-send-email-tommusta@gmail.com>

Eliminate the stub for the do_setcontext() function for TARGET_PPC64.  The
implementation re-uses the existing TARGET_PPC32 code with the only change
being the computation of the address of the register save area.

Signed-off-by: Tom Musta <tommusta@gmail.com>
---
 linux-user/signal.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 7bd9a43..9f04a20 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -4866,10 +4866,6 @@ sigsegv:
 /* See arch/powerpc/kernel/signal_32.c.  */
 static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)
 {
-#if defined(TARGET_PPC64)
-    fprintf(stderr, "do_setcontext: not implemented\n");
-    return 0;
-#else
     struct target_mcontext *mcp;
     target_ulong mcp_addr;
     sigset_t blocked;
@@ -4879,7 +4875,12 @@ static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)
                        sizeof (set)))
         return 1;
 
+#if defined(TARGET_PPC64)
+    mcp_addr = h2g(ucp) +
+        offsetof(struct target_ucontext, tuc_sigcontext.mcontext);
+#else
     __get_user(mcp_addr, &ucp->tuc_regs);
+#endif
 
     if (!lock_user_struct(VERIFY_READ, mcp, mcp_addr, 1))
         return 1;
@@ -4890,7 +4891,6 @@ static int do_setcontext(struct target_ucontext *ucp, CPUPPCState *env, int sig)
 
     unlock_user_struct(mcp, mcp_addr, 1);
     return 0;
-#endif
 }
 
 long do_rt_sigreturn(CPUPPCState *env)
-- 
1.7.1

  parent reply	other threads:[~2014-06-30 13:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 13:13 [Qemu-devel] [PATCH 0/7] linux-user: Support for Signal Handlers on PPC64 Tom Musta
2014-06-30 13:13 ` [Qemu-devel] [PATCH 1/7] linux-user: Fix Stack Pointer Bug in PPC setup_rt_frame Tom Musta
2014-06-30 13:13 ` [Qemu-devel] [PATCH 2/7] linux-user: Split PPC Trampoline Encoding from Register Save Tom Musta
2014-06-30 13:13 ` [Qemu-devel] [PATCH 3/7] linux-user: Enable Signal Handlers on PPC64 Tom Musta
2014-06-30 13:13 ` [Qemu-devel] [PATCH 4/7] linux-user: Properly Dereference PPC64 ELFv1 Signal Handler Pointer Tom Musta
2014-06-30 13:13 ` Tom Musta [this message]
2014-06-30 13:13 ` [Qemu-devel] [PATCH 6/7] linux-user: Move get_ppc64_abi Tom Musta
2014-06-30 13:13 ` [Qemu-devel] [PATCH 7/7] linux-user: Handle PPC64 ELFv2 Function Pointers Tom Musta
2014-07-03 12:59 ` [Qemu-devel] [PATCH 0/7] linux-user: Support for Signal Handlers on PPC64 Alexander Graf

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=1404134022-17946-6-git-send-email-tommusta@gmail.com \
    --to=tommusta@gmail.com \
    --cc=agraf@suse.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=riku.voipio@linaro.org \
    /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).