Patchwork [2/2] ppc64-linux-user: Fix syscall return type.

login
register
mail settings
Submitter Richard Henderson
Date Oct. 26, 2011, 4:59 p.m.
Message ID <1319648358-18812-3-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/121948/
State New
Headers show

Comments

Richard Henderson - Oct. 26, 2011, 4:59 p.m.
Use target_ulong instead of hard-coded uint32_t.
Remove the disabled printf's that are redundant with -strace.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/main.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)
Alexander Graf - Oct. 30, 2011, 4:47 p.m.
On 26.10.2011, at 18:59, Richard Henderson wrote:

> Use target_ulong instead of hard-coded uint32_t.
> Remove the disabled printf's that are redundant with -strace.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>

Acked-by: Alexander Graf <agraf@suse.de>

Riku, do you want to take these in or should I?


Alex

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index e7dad54..dd55648 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -1332,7 +1332,7 @@  void cpu_loop(CPUPPCState *env)
 {
     target_siginfo_t info;
     int trapnr;
-    uint32_t ret;
+    target_ulong ret;
 
     for(;;) {
         cpu_exec_start(env);
@@ -1695,27 +1695,20 @@  void cpu_loop(CPUPPCState *env)
              * PPC ABI uses overflow flag in cr0 to signal an error
              * in syscalls.
              */
-#if 0
-            printf("syscall %d 0x%08x 0x%08x 0x%08x 0x%08x\n", env->gpr[0],
-                   env->gpr[3], env->gpr[4], env->gpr[5], env->gpr[6]);
-#endif
             env->crf[0] &= ~0x1;
             ret = do_syscall(env, env->gpr[0], env->gpr[3], env->gpr[4],
                              env->gpr[5], env->gpr[6], env->gpr[7],
                              env->gpr[8], 0, 0);
-            if (ret == (uint32_t)(-TARGET_QEMU_ESIGRETURN)) {
+            if (ret == (target_ulong)(-TARGET_QEMU_ESIGRETURN)) {
                 /* Returning from a successful sigreturn syscall.
                    Avoid corrupting register state.  */
                 break;
             }
-            if (ret > (uint32_t)(-515)) {
+            if (ret > (target_ulong)(-515)) {
                 env->crf[0] |= 0x1;
                 ret = -ret;
             }
             env->gpr[3] = ret;
-#if 0
-            printf("syscall returned 0x%08x (%d)\n", ret, ret);
-#endif
             break;
         case POWERPC_EXCP_STCX:
             if (do_store_exclusive(env)) {