diff options
author | Avi Kivity <avi@qumranet.com> | 2008-07-26 16:00:59 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 04:15:16 -0400 |
commit | 564f15378f04921d5749f27ec53d5e68a6d1d446 (patch) | |
tree | 5ba58d06003010de40989a99b920602a1e76fdf9 /arch/x86/kvm/irq.c | |
parent | 49dd2c492895828a90ecdf889e7fe9cfb40a82a7 (diff) |
KVM: Add irq ack notifier list
This can be used by kvm subsystems that are interested in when
interrupts are acked, for example time drift compensation.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/irq.c')
-rw-r--r-- | arch/x86/kvm/irq.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kvm/irq.c b/arch/x86/kvm/irq.c index 0d9e55275af1..90911958d853 100644 --- a/arch/x86/kvm/irq.c +++ b/arch/x86/kvm/irq.c | |||
@@ -111,3 +111,25 @@ void kvm_set_irq(struct kvm *kvm, int irq, int level) | |||
111 | kvm_ioapic_set_irq(kvm->arch.vioapic, irq, level); | 111 | kvm_ioapic_set_irq(kvm->arch.vioapic, irq, level); |
112 | kvm_pic_set_irq(pic_irqchip(kvm), irq, level); | 112 | kvm_pic_set_irq(pic_irqchip(kvm), irq, level); |
113 | } | 113 | } |
114 | |||
115 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi) | ||
116 | { | ||
117 | struct kvm_irq_ack_notifier *kian; | ||
118 | struct hlist_node *n; | ||
119 | |||
120 | hlist_for_each_entry(kian, n, &kvm->arch.irq_ack_notifier_list, link) | ||
121 | if (kian->gsi == gsi) | ||
122 | kian->irq_acked(kian); | ||
123 | } | ||
124 | |||
125 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | ||
126 | struct kvm_irq_ack_notifier *kian) | ||
127 | { | ||
128 | hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list); | ||
129 | } | ||
130 | |||
131 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | ||
132 | struct kvm_irq_ack_notifier *kian) | ||
133 | { | ||
134 | hlist_del(&kian->link); | ||
135 | } | ||