qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usinger high resolution timers in simulated device


From: Peter Maydell
Subject: Re: Usinger high resolution timers in simulated device
Date: Tue, 9 Feb 2021 21:29:32 +0000

On Tue, 9 Feb 2021 at 21:23, Weiss, Howard <Howard.Weiss2@hologic.com> wrote:
>
> I am created a simulated device to test a Windows device driver.  The 
> simulated device runs under Linux. I use QEMU to create a Windows 10 virtual 
> machine in which I run the device driver
>
>
>
> In the simulated device, I need a timer which interrupts my device driver 
> every 8.3 ms.  I have patterned my timer on the high resolution timer
>
> to be found at 
> https://www.softprayog.in/tutorials/alarm-sleep-and-high-resolution-timers.

Are you trying to implement a timer inside a QEMU device model?
You need to use QEMU's internal timer APIs for this kind of thing:
trying to create new threads and use signals within QEMU itself is
not going to work well with QEMU's existing use of those facilities.

You probably want the QEMUTimer APIs from include/qemu/timer.h.

PS: don't expect that you'll necessarily get accurate every-8.3-ms
timings. QEMU's emulation is best-effort, not real-time.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]