From ffbc3949462e67d44ae96ed1d25a5a061557bb00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Thu, 20 Jun 2024 16:22:14 +0100 Subject: sysemu: generalise qtest_warp_clock as qemu_clock_advance_virtual_time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Alex Bennée Message-Id: <20240620152220.2192768-7-alex.bennee@linaro.org> --- include/qemu/timer.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/qemu/timer.h') 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 -- cgit v1.1