qemu-e2k/linux-user/loongarch64/target_cpu.h
Song Gao da8c70ea82 linux-user: Add LoongArch cpu_loop support
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>
2022-07-04 11:08:57 +05:30

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