Skip to contentSkip to conversation

Modifications to fix PowerPC on 64bit host, bug #1052857

PATCH Superseded Samuel Seay 2 participants 2 messages Jan 2, 2013

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Modifications to fix PowerPC on 64bit host, bug #1052857

Removed h2g() macro around the ka->_sa_handler due to _sa_handler being a guest value
Changed the __put_user macro as it was attempting to put a value to a guest memory location without converting to the guest area

---
 linux-user/signal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/signal.c +2 -2
index 95e2ffa..d0d24fc 100644
@@ -4584,7 +4584,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
     signal = current_exec_domain_sig(sig);
 
-    err |= __put_user(h2g(ka->_sa_handler), &sc->handler);
+    err |= __put_user(ka->_sa_handler, &sc->handler);
     err |= __put_user(set->sig[0], &sc->oldmask);
 #if defined(TARGET_PPC64)
     err |= __put_user(set->sig[0] >> 32, &sc->_unused[3]);
@@ -4606,7 +4606,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
     /* Create a stack frame for the caller of the handler.  */
     newsp = frame_addr - SIGNAL_FRAMESIZE;
-    err |= __put_user(env->gpr[1], (target_ulong *)(uintptr_t) newsp);
+    err |= put_user(env->gpr[1], (target_ulong)(uintptr_t) newsp, target_ulong);
 
     if (err)
         goto sigsegv;
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 22 lines · Samuel Seay

Removed h2g() macro around the ka->_sa_handler due to _sa_handler being a guest value
Changed the __put_user macro as it was attempting to put a value to a guest memory location without converting to the guest area

---
 linux-user/signal.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/signal.c +1 -1
index 95e2ffa..d0d24fc 100644
@@ -4584,7 +4584,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
     signal = current_exec_domain_sig(sig);
 
-    err |= __put_user(h2g(ka->_sa_handler), &sc->handler);
+    err |= __put_user(ka->_sa_handler, &sc->handler);
     err |= __put_user(set->sig[0], &sc->oldmask);
 #if defined(TARGET_PPC64)
     err |= __put_user(set->sig[0] >> 32, &sc->_unused[3]);

linux-user/signal.c static void setup_frame(int sig, struct target_sigaction *ka, · line 4609

Quoted 5 lines
linux-user/signal.c +1 -1
@@ -4606,7 +4606,7 @@ static void setup_frame(int sig, struct target_sigaction *ka,
 
     /* Create a stack frame for the caller of the handler.  */
     newsp = frame_addr - SIGNAL_FRAMESIZE;
-    err |= __put_user(env->gpr[1], (target_ulong *)(uintptr_t) newsp);
+    err |= put_user(env->gpr[1], (target_ulong)(uintptr_t) newsp, target_ulong);

newsp is already a target_ulong, you don't need either of these casts.

-- PMM