diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 0c1b580f9..e9b2b0757 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -314,7 +314,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->ir[30] = newsp; /* FIXME: Zero syscall return value. */ } diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 1c51d2df4..5005bf6dd 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -411,7 +411,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->regs[13] = newsp; env->regs[0] = 0; } diff --git a/target-cris/cpu.h b/target-cris/cpu.h index ea86bf902..a4f016f12 100644 --- a/target-cris/cpu.h +++ b/target-cris/cpu.h @@ -221,7 +221,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->regs[14] = newsp; env->regs[10] = 0; } diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 7d4551e76..56cdd9750 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -737,7 +737,7 @@ extern CCTable cc_table[]; #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->regs[R_ESP] = newsp; env->regs[R_EAX] = 0; } diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index 76914525f..cfeafc003 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -229,7 +229,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->aregs[7] = newsp; env->dregs[0] = 0; } diff --git a/target-mips/cpu.h b/target-mips/cpu.h index f9fcafbb1..964a560fa 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -503,7 +503,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->gpr[env->current_tc][29] = newsp; env->gpr[env->current_tc][7] = 0; env->gpr[env->current_tc][2] = 0; diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 06dc08390..d08bbba99 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -826,7 +826,7 @@ static inline int cpu_mmu_index (CPUState *env) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { int i; - if (!newsp) + if (newsp) env->gpr[1] = newsp; for (i = 7; i < 32; i++) env->gpr[i] = 0; diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index 9294b94e3..c349bc886 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -146,7 +146,7 @@ static inline int cpu_mmu_index (CPUState *env) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->gregs[15] = newsp; env->gregs[0] = 0; } diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 54807fb02..ad9aeb867 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -406,7 +406,7 @@ static inline int cpu_fpu_enabled(CPUState *env1) #if defined(CONFIG_USER_ONLY) static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) { - if (!newsp) + if (newsp) env->regwptr[22] = newsp; env->regwptr[0] = 0; /* FIXME: Do we also need to clear CF? */