guest_timer_create()

Create a guest system timer

Synopsis:

#include <qvm/guest.h>
struct guest_timer* guest_timer_create(const struct guest_cpu *gcp,
                                       const vdev_t *vdp,
                                       const void *data,
                                       uint64_t *resolutionp)

Arguments:

gcp
A pointer to a vCPU, if this is a per-CPU timer, NULL otherwise.
vdp
A pointer to the vdev for which this timer is being created.
data
A cookie value to be passed back when the vdev timer is invoked.
resolutionp
A pointer to the location where the timer resolution is to be stored.

Library:

Provided by qvm; no external library is required.

Description:

Call this function during startup to create a timer that can be used by guest_timer_notify().

Returns:

If successful, a pointer to the new timer structure; otherwise return NULL and place an error code in the location referenced by resolutionp.