Skip to contentSkip to conversation

Modification to remove a h2g() call and calculate properly instead

PATCH Applied Samuel Seay 2 participants 2 messages Jan 5, 2013 – Jan 7, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Modification to remove a h2g() call and calculate properly instead

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

---
 linux-user/signal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/signal.c +1 -1
index c43b8ac..bb08a93 100644
@@ -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;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Samuel Seay

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

Thanks, applied to ppc-next with a modified subject line.

Please take a few minutes and read through patch subjects and patch descriptions of other people's patches (just run git log) to get a hang for what exactly would be useful to have in there and what wouldn't.

Alex

Quoted 21 lines

---
linux-user/signal.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/signal.c +1 -1
index c43b8ac..bb08a93 100644
@@ -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;
Signature · 1 line
1.7.9.5