Patchwork [31/31] PPC: linux-user: Calculate context pointer explicitly

login
register
mail settings
Submitter Alexander Graf
Date Jan. 7, 2013, 3:39 p.m.
Message ID <1357573140-8877-32-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/209985/
State New
Headers show

Comments

Alexander Graf - Jan. 7, 2013, 3:39 p.m.
From: Samuel Seay <lightningth@gmail.com>

Peter Maydell recommended the change to be more proper. The result was tested
and shows coming up with the same proper value.

Signed-off-by: Samuel Seay <LightningTH@GMail.com>
[agraf: change subject]
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 linux-user/signal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/linux-user/signal.c b/linux-user/signal.c
index c43b8ac..bb08a93 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -4614,7 +4614,7 @@  static void setup_frame(int sig, struct target_sigaction *ka,
     /* Set up registers for signal handler.  */
     env->gpr[1] = newsp;
     env->gpr[3] = signal;
-    env->gpr[4] = (target_ulong) h2g(sc);
+    env->gpr[4] = frame_addr + offsetof(struct target_sigframe, sctx);
     env->nip = (target_ulong) ka->_sa_handler;
     /* Signal handlers are entered in big-endian mode.  */
     env->msr &= ~MSR_LE;