[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Usinger high resolution timers in simulated device
From: |
Weiss, Howard |
Subject: |
RE: Usinger high resolution timers in simulated device |
Date: |
Tue, 9 Feb 2021 22:11:58 +0000 |
PMM
Thanks. Yes I am trying to implement a timer within a QEMU device (the
hardware I am simulating generates an interrupt each 1/120 of a second. Any
suggestions are welcome and appreciated. Please point me to documentation for
the internal timer API
Howard
-----Original Message-----
From: Peter Maydell <peter.maydell@linaro.org>
Sent: Tuesday, February 9, 2021 4:30 PM
To: Weiss, Howard <Howard.Weiss2@hologic.com>
Cc: qemu-discuss@nongnu.org
Subject: Re: Usinger high resolution timers in simulated device
External Mail
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