mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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>
This commit is contained in:
parent
9bc92b5013
commit
0093b9a5ee
6 changed files with 72 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue