diff options
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 332dd63750a0..0e0c28574af8 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -734,6 +734,33 @@ static void restore_cpu_ipis(unsigned int cpu) | |||
734 | } | 734 | } |
735 | } | 735 | } |
736 | 736 | ||
737 | /* Clear an irq's pending state, in preparation for polling on it */ | ||
738 | void xen_clear_irq_pending(int irq) | ||
739 | { | ||
740 | int evtchn = evtchn_from_irq(irq); | ||
741 | |||
742 | if (VALID_EVTCHN(evtchn)) | ||
743 | clear_evtchn(evtchn); | ||
744 | } | ||
745 | |||
746 | /* Poll waiting for an irq to become pending. In the usual case, the | ||
747 | irq will be disabled so it won't deliver an interrupt. */ | ||
748 | void xen_poll_irq(int irq) | ||
749 | { | ||
750 | evtchn_port_t evtchn = evtchn_from_irq(irq); | ||
751 | |||
752 | if (VALID_EVTCHN(evtchn)) { | ||
753 | struct sched_poll poll; | ||
754 | |||
755 | poll.nr_ports = 1; | ||
756 | poll.timeout = 0; | ||
757 | poll.ports = &evtchn; | ||
758 | |||
759 | if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0) | ||
760 | BUG(); | ||
761 | } | ||
762 | } | ||
763 | |||
737 | void xen_irq_resume(void) | 764 | void xen_irq_resume(void) |
738 | { | 765 | { |
739 | unsigned int cpu, irq, evtchn; | 766 | unsigned int cpu, irq, evtchn; |