Patchwork [2/2] linux-user: Fix Sparc64 syscall returns.

login
register
mail settings
Submitter Richard Henderson
Date April 25, 2010, 6:01 p.m.
Message ID <1272218485-12465-2-git-send-email-rth@twiddle.net>
Download mbox | patch
Permalink /patch/50948/
State New
Headers show

Comments

Richard Henderson - April 25, 2010, 6:01 p.m.
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 linux-user/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Blue Swirl - April 25, 2010, 6:08 p.m.
Thanks, applied.

On 4/25/10, Richard Henderson <rth@twiddle.net> wrote:
> Signed-off-by: Richard Henderson <rth@twiddle.net>
>  ---
>   linux-user/main.c |    5 +++--
>   1 files changed, 3 insertions(+), 2 deletions(-)
>
>  diff --git a/linux-user/main.c b/linux-user/main.c
>  index b394c00..71a1b67 100644
>  --- a/linux-user/main.c
>  +++ b/linux-user/main.c
>  @@ -940,7 +940,8 @@ static void flush_windows(CPUSPARCState *env)
>
>   void cpu_loop (CPUSPARCState *env)
>   {
>  -    int trapnr, ret;
>  +    int trapnr;
>  +    abi_long ret;
>      target_siginfo_t info;
>
>      while (1) {
>  @@ -958,7 +959,7 @@ void cpu_loop (CPUSPARCState *env)
>                                env->regwptr[0], env->regwptr[1],
>                                env->regwptr[2], env->regwptr[3],
>                                env->regwptr[4], env->regwptr[5]);
>  -            if ((unsigned int)ret >= (unsigned int)(-515)) {
>  +            if ((abi_ulong)ret >= (abi_ulong)(-515)) {
>   #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
>                  env->xcc |= PSR_CARRY;
>   #else
>
> --
>  1.6.6.1
>
>

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index b394c00..71a1b67 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -940,7 +940,8 @@  static void flush_windows(CPUSPARCState *env)
 
 void cpu_loop (CPUSPARCState *env)
 {
-    int trapnr, ret;
+    int trapnr;
+    abi_long ret;
     target_siginfo_t info;
 
     while (1) {
@@ -958,7 +959,7 @@  void cpu_loop (CPUSPARCState *env)
                               env->regwptr[0], env->regwptr[1],
                               env->regwptr[2], env->regwptr[3],
                               env->regwptr[4], env->regwptr[5]);
-            if ((unsigned int)ret >= (unsigned int)(-515)) {
+            if ((abi_ulong)ret >= (abi_ulong)(-515)) {
 #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
                 env->xcc |= PSR_CARRY;
 #else