aboutsummaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2024-06-20 16:22:12 +0100
committerAlex Bennée <alex.bennee@linaro.org>2024-06-24 10:14:34 +0100
commit113ac1d2127e4255129963c5061578b3fd85cc8f (patch)
tree404784a82d4fe85838b5513dd2193df6c284672c /system
parentad59d5caee26178b6719a2f38e931c89840b7350 (diff)
sysemu: add set_virtual_time to accel ops
We are about to remove direct calls to individual accelerators for this information and will need a central point for plugins to hook into time changes. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240530220610.1245424-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240620152220.2192768-5-alex.bennee@linaro.org>
Diffstat (limited to 'system')
-rw-r--r--system/cpus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/system/cpus.c b/system/cpus.c
index f8fa78f33d..d3640c9503 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -230,6 +230,17 @@ int64_t cpus_get_virtual_clock(void)
}
/*
+ * Signal the new virtual time to the accelerator. This is only needed
+ * by accelerators that need to track the changes as we warp time.
+ */
+void cpus_set_virtual_clock(int64_t new_time)
+{
+ if (cpus_accel && cpus_accel->set_virtual_clock) {
+ cpus_accel->set_virtual_clock(new_time);
+ }
+}
+
+/*
* return the time elapsed in VM between vm_start and vm_stop. Unless
* icount is active, cpus_get_elapsed_ticks() uses units of the host CPU cycle
* counter.