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

@@ -10,12 +10,12 @@ struct acrn_timer {
int32_t fd;
int32_t clockid;
struct mevent *mevp;
void (*callback)(void *);
void (*callback)(void *, uint64_t);
void *callback_param;
};
int32_t
acrn_timer_init(struct acrn_timer *timer, void (*cb)(void *), void *param);
acrn_timer_init(struct acrn_timer *timer, void (*cb)(void *, uint64_t), void *param);
void
acrn_timer_deinit(struct acrn_timer *timer);
int32_t