diff options
-rw-r--r-- | drivers/xen/events.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 74681478100a..1ae775742325 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -387,23 +387,6 @@ static int get_nr_hw_irqs(void) | |||
387 | return ret; | 387 | return ret; |
388 | } | 388 | } |
389 | 389 | ||
390 | static int find_unbound_pirq(int type) | ||
391 | { | ||
392 | int rc, i; | ||
393 | struct physdev_get_free_pirq op_get_free_pirq; | ||
394 | op_get_free_pirq.type = type; | ||
395 | |||
396 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq); | ||
397 | if (!rc) | ||
398 | return op_get_free_pirq.pirq; | ||
399 | |||
400 | for (i = 0; i < nr_irqs; i++) { | ||
401 | if (pirq_to_irq[i] < 0) | ||
402 | return i; | ||
403 | } | ||
404 | return -1; | ||
405 | } | ||
406 | |||
407 | static int find_unbound_irq(void) | 390 | static int find_unbound_irq(void) |
408 | { | 391 | { |
409 | struct irq_data *data; | 392 | struct irq_data *data; |
@@ -677,6 +660,23 @@ out: | |||
677 | #include <linux/msi.h> | 660 | #include <linux/msi.h> |
678 | #include "../pci/msi.h" | 661 | #include "../pci/msi.h" |
679 | 662 | ||
663 | static int find_unbound_pirq(int type) | ||
664 | { | ||
665 | int rc, i; | ||
666 | struct physdev_get_free_pirq op_get_free_pirq; | ||
667 | op_get_free_pirq.type = type; | ||
668 | |||
669 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq); | ||
670 | if (!rc) | ||
671 | return op_get_free_pirq.pirq; | ||
672 | |||
673 | for (i = 0; i < nr_irqs; i++) { | ||
674 | if (pirq_to_irq[i] < 0) | ||
675 | return i; | ||
676 | } | ||
677 | return -1; | ||
678 | } | ||
679 | |||
680 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc) | 680 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc) |
681 | { | 681 | { |
682 | spin_lock(&irq_mapping_update_lock); | 682 | spin_lock(&irq_mapping_update_lock); |