irq.h (f26e8817b235d8764363bffcc9cbfc61867371f2) irq.h (49776faf93f8074bb4990beac04781a9507d3650)
1/*
2 * irq.h: in kernel interrupt controller related definitions
3 * Copyright (c) 2007, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

--- 79 unchanged lines hidden (view full) ---

88 int ret;
89
90 ret = (pic_irqchip(kvm) != NULL);
91 return ret;
92}
93
94static inline int irqchip_split(struct kvm *kvm)
95{
1/*
2 * irq.h: in kernel interrupt controller related definitions
3 * Copyright (c) 2007, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *

--- 79 unchanged lines hidden (view full) ---

88 int ret;
89
90 ret = (pic_irqchip(kvm) != NULL);
91 return ret;
92}
93
94static inline int irqchip_split(struct kvm *kvm)
95{
96 return kvm->arch.irqchip_split;
96 return kvm->arch.irqchip_mode == KVM_IRQCHIP_SPLIT;
97}
98
97}
98
99static inline int irqchip_kernel(struct kvm *kvm)
100{
101 return kvm->arch.irqchip_mode == KVM_IRQCHIP_KERNEL;
102}
103
99static inline int irqchip_in_kernel(struct kvm *kvm)
100{
104static inline int irqchip_in_kernel(struct kvm *kvm)
105{
101 struct kvm_pic *vpic = pic_irqchip(kvm);
102 bool ret;
106 bool ret = kvm->arch.irqchip_mode != KVM_IRQCHIP_NONE;
103
107
104 ret = (vpic != NULL);
105 ret |= irqchip_split(kvm);
106
107 /* Read vpic before kvm->irq_routing. */
108 /* Matches with wmb after initializing kvm->irq_routing. */
108 smp_rmb();
109 return ret;
110}
111
112void kvm_pic_reset(struct kvm_kpic_state *s);
113
114void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
115void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
116void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
117void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu);
118void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu);
119void __kvm_migrate_timers(struct kvm_vcpu *vcpu);
120
121int apic_has_pending_timer(struct kvm_vcpu *vcpu);
122
123int kvm_setup_default_irq_routing(struct kvm *kvm);
124int kvm_setup_empty_irq_routing(struct kvm *kvm);
125
126#endif
109 smp_rmb();
110 return ret;
111}
112
113void kvm_pic_reset(struct kvm_kpic_state *s);
114
115void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
116void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
117void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
118void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu);
119void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu);
120void __kvm_migrate_timers(struct kvm_vcpu *vcpu);
121
122int apic_has_pending_timer(struct kvm_vcpu *vcpu);
123
124int kvm_setup_default_irq_routing(struct kvm *kvm);
125int kvm_setup_empty_irq_routing(struct kvm *kvm);
126
127#endif