aboutsummaryrefslogtreecommitdiff
path: root/target/loongarch/op_helper.c
diff options
context:
space:
mode:
authorSong Gao <gaosong@loongson.cn>2022-06-24 11:10:47 +0800
committerRichard Henderson <richard.henderson@linaro.org>2022-07-04 11:08:58 +0530
commit0093b9a5eeee6304fbd6e4f5be6b47820c4d55e3 (patch)
tree74a5b929aabcaad5f5081f03805ec8a23a95c6b1 /target/loongarch/op_helper.c
parent9bc92b501363a5bad67ca92cf0f7256b20c401e5 (diff)
downloadqemu-0093b9a5eeee6304fbd6e4f5be6b47820c4d55e3.zip
qemu-0093b9a5eeee6304fbd6e4f5be6b47820c4d55e3.tar.gz
qemu-0093b9a5eeee6304fbd6e4f5be6b47820c4d55e3.tar.bz2
target/loongarch: Adjust functions and structure to support user-mode
Some functions and member of the structure are different with softmmu-mode So we need adjust them to support user-mode. 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-12-gaosong@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/loongarch/op_helper.c')
-rw-r--r--target/loongarch/op_helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target/loongarch/op_helper.c b/target/loongarch/op_helper.c
index df049ce..4b429b6 100644
--- a/target/loongarch/op_helper.c
+++ b/target/loongarch/op_helper.c
@@ -86,6 +86,9 @@ target_ulong helper_cpucfg(CPULoongArchState *env, target_ulong rj)
uint64_t helper_rdtime_d(CPULoongArchState *env)
{
+#ifdef CONFIG_USER_ONLY
+ return cpu_get_host_ticks();
+#else
uint64_t plv;
LoongArchCPU *cpu = env_archcpu(env);
@@ -95,8 +98,10 @@ uint64_t helper_rdtime_d(CPULoongArchState *env)
}
return cpu_loongarch_get_constant_timer_counter(cpu);
+#endif
}
+#ifndef CONFIG_USER_ONLY
void helper_ertn(CPULoongArchState *env)
{
uint64_t csr_pplv, csr_pie;
@@ -131,3 +136,4 @@ void helper_idle(CPULoongArchState *env)
cs->halted = 1;
do_raise_exception(env, EXCP_HLT, 0);
}
+#endif