dm: provide timer callback handlers the number of expirations

It is possible for multiple timeouts to occur in one mevent epoll
iteration. Providing the number of timer expirations to the timer
callback handlers can be useful. E.g., this could improve emulation of
timing-sensitive hardware components.

Tracked-On: #2319
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Peter Fang
2019-01-10 19:03:30 -08:00
committed by wenlingz
parent 0f7535fdbe
commit 3fe4c3f2a8
5 changed files with 24 additions and 14 deletions

View File

@@ -660,7 +660,7 @@ vrtc_time_update(struct vrtc *vrtc, time_t newtime, time_t newbase)
}
static void
vrtc_periodic_timer(void *arg)
vrtc_periodic_timer(void *arg, uint64_t nexp)
{
struct vrtc *vrtc = arg;
@@ -673,13 +673,14 @@ vrtc_periodic_timer(void *arg)
}
static void
vrtc_update_timer(void *arg)
vrtc_update_timer(void *arg, uint64_t nexp)
{
struct vrtc *vrtc = arg;
time_t basetime;
time_t curtime;
pthread_mutex_lock(&vrtc->mtx);
if (aintr_enabled(vrtc) || uintr_enabled(vrtc)) {
curtime = vrtc_curtime(vrtc, &basetime);
vrtc_time_update(vrtc, curtime, basetime);