On 30/07/20 18:33, Claudio Fontana wrote:
> One problem I noticed is that qemu_clock_get_ns is util/qemu-timer.c,
> which is tools _and_ softmmu, while I tried to extract the
> softmmu-only timer code in softmmu/cpu-timers.c,

Not all of it, only the VIRTUAL clock which is

        if (use_icount) {
            return cpu_get_icount();
        } else {
            return cpu_get_clock();
        }

and would be changed to something like

        return cpu_get_virtual_clock();

In turn cpu_get_virtual_clock() is

        return (accel_ops->cpu_get_virtual clock ?: cpu_get_clock)();

in the emulators, plus a stub that replaces stubs/cpu-get-icount.c and
is just

        return get_clock_realtime();

as in stubs/cpu-get-clock.c.

Paolo


Reply via email to