blob: 497dbaa366d4eb07397e75f27d29f08e249baa2c [file] [log] [blame]
Marcelo Tosattid3c7b772009-02-23 10:57:41 -03001
2struct kvm_timer {
3 struct hrtimer timer;
4 s64 period; /* unit: ns */
Liu, Jinsonga3e06bb2011-09-22 16:55:52 +08005 u32 timer_mode_mask;
6 u64 tscdeadline;
Marcelo Tosattid3c7b772009-02-23 10:57:41 -03007 atomic_t pending; /* accumulated triggered timers */
8 bool reinject;
9 struct kvm_timer_ops *t_ops;
10 struct kvm *kvm;
Gleb Natapov1ed0ce02009-06-09 15:56:27 +030011 struct kvm_vcpu *vcpu;
Marcelo Tosattid3c7b772009-02-23 10:57:41 -030012};
13
14struct kvm_timer_ops {
Andrea Gelmini0fc5c3a2010-02-27 17:51:43 +010015 bool (*is_periodic)(struct kvm_timer *);
Marcelo Tosattid3c7b772009-02-23 10:57:41 -030016};
17
Marcelo Tosattid3c7b772009-02-23 10:57:41 -030018enum hrtimer_restart kvm_timer_fn(struct hrtimer *data);