aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c27
-rw-r--r--drivers/xen/manage.c6
2 files changed, 31 insertions, 2 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 */
738void 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. */
748void 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
737void xen_irq_resume(void) 764void xen_irq_resume(void)
738{ 765{
739 unsigned int cpu, irq, evtchn; 766 unsigned int cpu, irq, evtchn;
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 5b546e365f00..2bb268e4ac56 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -68,6 +68,7 @@ static int xen_suspend(void *data)
68 if (!*cancelled) { 68 if (!*cancelled) {
69 xen_irq_resume(); 69 xen_irq_resume();
70 xen_console_resume(); 70 xen_console_resume();
71 xen_timer_resume();
71 } 72 }
72 73
73 return 0; 74 return 0;
@@ -107,9 +108,10 @@ static void do_suspend(void)
107 goto out; 108 goto out;
108 } 109 }
109 110
110 if (!cancelled) 111 if (!cancelled) {
112 xen_arch_resume();
111 xenbus_resume(); 113 xenbus_resume();
112 else 114 } else
113 xenbus_suspend_cancel(); 115 xenbus_suspend_cancel();
114 116
115 device_resume(); 117 device_resume();