mirror of https://github.com/xemu-project/xemu.git
linux-user/sparc: Tidy syscall error return
Reduce ifdefs with #define syscall_cc. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230216054516.1267305-4-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
parent
3116f020d4
commit
9cee640a44
|
@ -149,10 +149,13 @@ static void flush_windows(CPUSPARCState *env)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid ifdefs below for the abi32 and abi64 paths. */
|
||||||
#ifdef TARGET_ABI32
|
#ifdef TARGET_ABI32
|
||||||
#define TARGET_TT_SYSCALL (TT_TRAP + 0x10) /* t_linux */
|
#define TARGET_TT_SYSCALL (TT_TRAP + 0x10) /* t_linux */
|
||||||
|
#define syscall_cc psr
|
||||||
#else
|
#else
|
||||||
#define TARGET_TT_SYSCALL (TT_TRAP + 0x6d) /* tl0_linux64 */
|
#define TARGET_TT_SYSCALL (TT_TRAP + 0x6d) /* tl0_linux64 */
|
||||||
|
#define syscall_cc xcc
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void cpu_loop (CPUSPARCState *env)
|
void cpu_loop (CPUSPARCState *env)
|
||||||
|
@ -183,18 +186,10 @@ void cpu_loop (CPUSPARCState *env)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((abi_ulong)ret >= (abi_ulong)(-515)) {
|
if ((abi_ulong)ret >= (abi_ulong)(-515)) {
|
||||||
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
env->syscall_cc |= PSR_CARRY;
|
||||||
env->xcc |= PSR_CARRY;
|
|
||||||
#else
|
|
||||||
env->psr |= PSR_CARRY;
|
|
||||||
#endif
|
|
||||||
ret = -ret;
|
ret = -ret;
|
||||||
} else {
|
} else {
|
||||||
#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
|
env->syscall_cc &= ~PSR_CARRY;
|
||||||
env->xcc &= ~PSR_CARRY;
|
|
||||||
#else
|
|
||||||
env->psr &= ~PSR_CARRY;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
env->regwptr[0] = ret;
|
env->regwptr[0] = ret;
|
||||||
/* next instruction */
|
/* next instruction */
|
||||||
|
|
Loading…
Reference in New Issue