mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
target-alpha: Add high-resolution access to wall clock and an alarm.
The alarm is a fully general one-shot time comparator, which will be usable under Linux as a hrtimer source. It's much more flexible than the RTC source available on real hardware. The wall clock allows the guest access to the host timekeeping. Much like the KVM wall clock source for other guests. Both are accessed via the PALcode Cserve entry point. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
034ebc2753
commit
c781cf96e2
5 changed files with 68 additions and 5 deletions
|
@ -1228,6 +1228,21 @@ void helper_halt(uint64_t restart)
|
|||
qemu_system_shutdown_request();
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t helper_get_time(void)
|
||||
{
|
||||
return qemu_get_clock_ns(rtc_clock);
|
||||
}
|
||||
|
||||
void helper_set_alarm(uint64_t expire)
|
||||
{
|
||||
if (expire) {
|
||||
env->alarm_expire = expire;
|
||||
qemu_mod_timer(env->alarm_timer, expire);
|
||||
} else {
|
||||
qemu_del_timer(env->alarm_timer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue