mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-26 21:10:42 +00:00
da8c70ea82
Signed-off-by: Song Gao <gaosong@loongson.cn> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220624031049.1716097-6-gaosong@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
35 lines
803 B
C
35 lines
803 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* LoongArch specific CPU ABI and functions for linux-user
|
|
*
|
|
* Copyright (c) 2021 Loongson Technology Corporation Limited
|
|
*/
|
|
|
|
#ifndef LOONGARCH_TARGET_CPU_H
|
|
#define LOONGARCH_TARGET_CPU_H
|
|
|
|
static inline void cpu_clone_regs_child(CPULoongArchState *env,
|
|
target_ulong newsp, unsigned flags)
|
|
{
|
|
if (newsp) {
|
|
env->gpr[3] = newsp;
|
|
}
|
|
env->gpr[4] = 0;
|
|
}
|
|
|
|
static inline void cpu_clone_regs_parent(CPULoongArchState *env,
|
|
unsigned flags)
|
|
{
|
|
}
|
|
|
|
static inline void cpu_set_tls(CPULoongArchState *env, target_ulong newtls)
|
|
{
|
|
env->gpr[2] = newtls;
|
|
}
|
|
|
|
static inline abi_ulong get_sp_from_cpustate(CPULoongArchState *state)
|
|
{
|
|
return state->gpr[3];
|
|
}
|
|
#endif
|