mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/alpha: Extract clk_helper.c from sys_helper.c
Except helper_load_pcc(), all helpers from sys_helper.c are system-emulation specific. In preparation of restricting sys_helper.c to system emulation, extract helper_load_pcc() to clk_helper.c. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231207105426.49339-2-philmd@linaro.org>
This commit is contained in:
parent
fe5c4adca9
commit
0180444806
3 changed files with 33 additions and 15 deletions
|
@ -27,21 +27,6 @@
|
|||
#include "qemu/timer.h"
|
||||
|
||||
|
||||
uint64_t helper_load_pcc(CPUAlphaState *env)
|
||||
{
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
/* In system mode we have access to a decent high-resolution clock.
|
||||
In order to make OS-level time accounting work with the RPCC,
|
||||
present it with a well-timed clock fixed at 250MHz. */
|
||||
return (((uint64_t)env->pcc_ofs << 32)
|
||||
| (uint32_t)(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) >> 2));
|
||||
#else
|
||||
/* In user-mode, QEMU_CLOCK_VIRTUAL doesn't exist. Just pass through the host cpu
|
||||
clock ticks. Also, don't bother taking PCC_OFS into account. */
|
||||
return (uint32_t)cpu_get_host_ticks();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* PALcode support special instructions */
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
void helper_tbia(CPUAlphaState *env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue