mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
target/loongarch: Add timer related instructions support.
This includes: -RDTIME{L/H}.W -RDTIME.D Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220606124333.2060567-30-yangxiaojuan@loongson.cn> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
d2cba6f7ce
commit
f9bf50745f
6 changed files with 56 additions and 0 deletions
|
@ -84,6 +84,19 @@ target_ulong helper_cpucfg(CPULoongArchState *env, target_ulong rj)
|
|||
return rj > 21 ? 0 : env->cpucfg[rj];
|
||||
}
|
||||
|
||||
uint64_t helper_rdtime_d(CPULoongArchState *env)
|
||||
{
|
||||
uint64_t plv;
|
||||
LoongArchCPU *cpu = env_archcpu(env);
|
||||
|
||||
plv = FIELD_EX64(env->CSR_CRMD, CSR_CRMD, PLV);
|
||||
if (extract64(env->CSR_MISC, R_CSR_MISC_DRDTL_SHIFT + plv, 1)) {
|
||||
do_raise_exception(env, EXCCODE_IPE, GETPC());
|
||||
}
|
||||
|
||||
return cpu_loongarch_get_constant_timer_counter(cpu);
|
||||
}
|
||||
|
||||
void helper_ertn(CPULoongArchState *env)
|
||||
{
|
||||
uint64_t csr_pplv, csr_pie;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue