target-sparc: Fix wrong printf argument
authorStefan Weil <weil@mail.berlios.de>
Wed, 12 May 2010 18:34:39 +0000 (20:34 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Wed, 12 May 2010 19:20:11 +0000 (19:20 +0000)
cpu_get_ccr() returns a target_ulong, so a type cast is needed to avoid
wrong output on big endian hosts. We could also use TARGET_FMT_lx,
but that would print 8 instead of 2 digits.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc/helper.c

index 46421225c47ce38b51c91e650c0c8cffc3fa09e6..582de1082c1e1d73029e59d9055419b661ee7810 100644 (file)
@@ -1490,7 +1490,7 @@ void cpu_dump_state(CPUState *env, FILE *f,
     }
 #ifdef TARGET_SPARC64
     cpu_fprintf(f, "pstate: %08x ccr: %02x (icc: ", env->pstate,
-                cpu_get_ccr(env));
+                (unsigned)cpu_get_ccr(env));
     cpu_print_cc(f, cpu_fprintf, cpu_get_ccr(env) << PSR_CARRY_SHIFT);
     cpu_fprintf(f, " xcc: ");
     cpu_print_cc(f, cpu_fprintf, cpu_get_ccr(env) << (PSR_CARRY_SHIFT - 4));