xen: add resend_irq_on_evtchn() definition into events.c
[linux-2.6.git] / drivers / xen / events.c
index 2396b44..4f0f22b 100644 (file)
@@ -586,6 +586,22 @@ static void set_affinity_irq(unsigned irq, cpumask_t dest)
        rebind_irq_to_cpu(irq, tcpu);
 }
 
+int resend_irq_on_evtchn(unsigned int irq)
+{
+       int masked, evtchn = evtchn_from_irq(irq);
+       struct shared_info *s = HYPERVISOR_shared_info;
+
+       if (!VALID_EVTCHN(evtchn))
+               return 1;
+
+       masked = sync_test_and_set_bit(evtchn, s->evtchn_mask);
+       sync_set_bit(evtchn, s->evtchn_pending);
+       if (!masked)
+               unmask_evtchn(evtchn);
+
+       return 1;
+}
+
 static void enable_dynirq(unsigned int irq)
 {
        int evtchn = evtchn_from_irq(irq);