aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/xen/events.c17
-rw-r--r--include/xen/events.h4
2 files changed, 16 insertions, 5 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index bab5ac18fe0..4e0f868517b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -1139,7 +1139,7 @@ void xen_clear_irq_pending(int irq)
1139 if (VALID_EVTCHN(evtchn)) 1139 if (VALID_EVTCHN(evtchn))
1140 clear_evtchn(evtchn); 1140 clear_evtchn(evtchn);
1141} 1141}
1142 1142EXPORT_SYMBOL(xen_clear_irq_pending);
1143void xen_set_irq_pending(int irq) 1143void xen_set_irq_pending(int irq)
1144{ 1144{
1145 int evtchn = evtchn_from_irq(irq); 1145 int evtchn = evtchn_from_irq(irq);
@@ -1159,9 +1159,9 @@ bool xen_test_irq_pending(int irq)
1159 return ret; 1159 return ret;
1160} 1160}
1161 1161
1162/* Poll waiting for an irq to become pending. In the usual case, the 1162/* Poll waiting for an irq to become pending with timeout. In the usual case,
1163 irq will be disabled so it won't deliver an interrupt. */ 1163 * the irq will be disabled so it won't deliver an interrupt. */
1164void xen_poll_irq(int irq) 1164void xen_poll_irq_timeout(int irq, u64 timeout)
1165{ 1165{
1166 evtchn_port_t evtchn = evtchn_from_irq(irq); 1166 evtchn_port_t evtchn = evtchn_from_irq(irq);
1167 1167
@@ -1169,13 +1169,20 @@ void xen_poll_irq(int irq)
1169 struct sched_poll poll; 1169 struct sched_poll poll;
1170 1170
1171 poll.nr_ports = 1; 1171 poll.nr_ports = 1;
1172 poll.timeout = 0; 1172 poll.timeout = timeout;
1173 set_xen_guest_handle(poll.ports, &evtchn); 1173 set_xen_guest_handle(poll.ports, &evtchn);
1174 1174
1175 if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0) 1175 if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0)
1176 BUG(); 1176 BUG();
1177 } 1177 }
1178} 1178}
1179EXPORT_SYMBOL(xen_poll_irq_timeout);
1180/* Poll waiting for an irq to become pending. In the usual case, the
1181 * irq will be disabled so it won't deliver an interrupt. */
1182void xen_poll_irq(int irq)
1183{
1184 xen_poll_irq_timeout(irq, 0 /* no timeout */);
1185}
1179 1186
1180void xen_irq_resume(void) 1187void xen_irq_resume(void)
1181{ 1188{
diff --git a/include/xen/events.h b/include/xen/events.h
index 8227da8f716..2532f8bd240 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -53,6 +53,10 @@ bool xen_test_irq_pending(int irq);
53 irq will be disabled so it won't deliver an interrupt. */ 53 irq will be disabled so it won't deliver an interrupt. */
54void xen_poll_irq(int irq); 54void xen_poll_irq(int irq);
55 55
56/* Poll waiting for an irq to become pending with a timeout. In the usual case,
57 * the irq will be disabled so it won't deliver an interrupt. */
58void xen_poll_irq_timeout(int irq, u64 timeout);
59
56/* Determine the IRQ which is bound to an event channel */ 60/* Determine the IRQ which is bound to an event channel */
57unsigned irq_from_evtchn(unsigned int evtchn); 61unsigned irq_from_evtchn(unsigned int evtchn);
58 62