diff options
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r-- | virt/kvm/irq_comm.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index aa5d1e5c497e..5162a411e4d2 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c | |||
@@ -99,3 +99,27 @@ void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id) | |||
99 | clear_bit(irq_source_id, &kvm->arch.irq_states[i]); | 99 | clear_bit(irq_source_id, &kvm->arch.irq_states[i]); |
100 | clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap); | 100 | clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap); |
101 | } | 101 | } |
102 | |||
103 | void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq, | ||
104 | struct kvm_irq_mask_notifier *kimn) | ||
105 | { | ||
106 | kimn->irq = irq; | ||
107 | hlist_add_head(&kimn->link, &kvm->mask_notifier_list); | ||
108 | } | ||
109 | |||
110 | void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | ||
111 | struct kvm_irq_mask_notifier *kimn) | ||
112 | { | ||
113 | hlist_del(&kimn->link); | ||
114 | } | ||
115 | |||
116 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask) | ||
117 | { | ||
118 | struct kvm_irq_mask_notifier *kimn; | ||
119 | struct hlist_node *n; | ||
120 | |||
121 | hlist_for_each_entry(kimn, n, &kvm->mask_notifier_list, link) | ||
122 | if (kimn->irq == irq) | ||
123 | kimn->func(kimn, mask); | ||
124 | } | ||
125 | |||