diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2009-11-05 16:33:09 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2010-10-18 10:49:28 -0400 |
commit | d9a8814f27080cec6126fca3ef0c210d9f56181e (patch) | |
tree | 5db169fb98d537413cea793298557343eaf69df1 /drivers/xen/events.c | |
parent | 3a69e9165a271b026c7149886b96ab0cc2e9a36b (diff) |
xen: Provide a variant of xen_poll_irq with timeout.
The 'xen_poll_irq_timeout' provides a method to pass in
the poll timeout for IRQs if requested. We also export
those two poll functions as Xen PCI fronted uses them.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'drivers/xen/events.c')
-rw-r--r-- | drivers/xen/events.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index bab5ac18fe0e..4e0f868517be 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 | 1142 | EXPORT_SYMBOL(xen_clear_irq_pending); | |
1143 | void xen_set_irq_pending(int irq) | 1143 | void 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. */ |
1164 | void xen_poll_irq(int irq) | 1164 | void 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 | } |
1179 | EXPORT_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. */ | ||
1182 | void xen_poll_irq(int irq) | ||
1183 | { | ||
1184 | xen_poll_irq_timeout(irq, 0 /* no timeout */); | ||
1185 | } | ||
1179 | 1186 | ||
1180 | void xen_irq_resume(void) | 1187 | void xen_irq_resume(void) |
1181 | { | 1188 | { |