From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1bPU-0008Hb-4O for qemu-devel@nongnu.org; Mon, 30 Jun 2014 09:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1bPI-0007YF-J9 for qemu-devel@nongnu.org; Mon, 30 Jun 2014 09:14:16 -0400 From: Tom Musta Date: Mon, 30 Jun 2014 08:13:40 -0500 Message-Id: <1404134022-17946-6-git-send-email-tommusta@gmail.com> In-Reply-To: <1404134022-17946-1-git-send-email-tommusta@gmail.com> References: <1404134022-17946-1-git-send-email-tommusta@gmail.com> Subject: [Qemu-devel] [PATCH 5/7] linux-user: Implement do_setcontext for PPC64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: Tom Musta , riku.voipio@linaro.org, agraf@suse.de 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 --- 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