diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2024-06-20 16:22:14 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-06-24 10:14:41 +0100 |
commit | ffbc3949462e67d44ae96ed1d25a5a061557bb00 (patch) | |
tree | 6ba3b7496b8b285e3661847511d7dcbe1c01da93 /include | |
parent | e83e386200deeede6241007db6a27d09350ae060 (diff) | |
download | qemu-ffbc3949462e67d44ae96ed1d25a5a061557bb00.zip qemu-ffbc3949462e67d44ae96ed1d25a5a061557bb00.tar.gz qemu-ffbc3949462e67d44ae96ed1d25a5a061557bb00.tar.bz2 |
sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time
Move the key functionality of moving time forward into the clock
sub-system itself. This will allow us to plumb in time control into
plugins.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240620152220.2192768-7-alex.bennee@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/timer.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 9a366e5..5ce83c7 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -245,6 +245,21 @@ bool qemu_clock_run_timers(QEMUClockType type); */ bool qemu_clock_run_all_timers(void); +/** + * qemu_clock_advance_virtual_time(): advance the virtual time tick + * @target_ns: target time in nanoseconds + * + * This function is used where the control of the flow of time has + * been delegated to outside the clock subsystem (be it qtest, icount + * or some other external source). You can ask the clock system to + * return @early at the first expired timer. + * + * Time can only move forward, attempts to reverse time would lead to + * an error. + * + * Returns: new virtual time. + */ +int64_t qemu_clock_advance_virtual_time(int64_t target_ns); /* * QEMUTimerList |