diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2012-08-06 16:33:14 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2012-08-06 18:11:25 +0100 |
commit | 9bac3520c11d771f8f577eb2f9d71a25b465313e (patch) | |
tree | b4b795251f02303b938eca2219c0afa9c1fc42ed | |
parent | eb24dba75d8bce2b111ff370208889c545a8db62 (diff) |
hw/kvm/arm_gic.c: Use kvm_set_irq where possibleq-l-pic-cleanup
Use kvm_set_irq where possible (we still need to do
a direct ioctl when we're doing the per-CPU internal interrupt
injection, though).
-rw-r--r-- | hw/kvm/arm_gic.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/kvm/arm_gic.c b/hw/kvm/arm_gic.c index ee5e0dae53..4535f9088d 100644 --- a/hw/kvm/arm_gic.c +++ b/hw/kvm/arm_gic.c @@ -45,21 +45,20 @@ static void kvm_arm_gic_set_irq(void *opaque, int irq, int level) * ... */ gic_state *s = (gic_state *)opaque; - struct kvm_irq_level irq_level; - irq_level.level = level ? 1 : 0; if (irq < (s->num_irq - GIC_INTERNAL)) { /* External interrupt number 'irq' */ - irq_level.irq = irq + GIC_INTERNAL; - kvm_vm_ioctl(kvm_state, KVM_IRQ_LINE, &irq_level); + kvm_set_irq(kvm_state, irq + GIC_INTERNAL, !!level); } else { + struct kvm_irq_level irq_level; int cpu; irq -= (s->num_irq - GIC_INTERNAL); cpu = irq / GIC_INTERNAL; irq %= GIC_INTERNAL; /* Internal interrupt 'irq' for CPU 'cpu' */ irq_level.irq = irq; + irq_level.level = !!level; kvm_vcpu_ioctl(qemu_get_cpu(cpu), KVM_IRQ_LINE, &irq_level); } } |