提交 87295185 编写于 作者: D David Vrabel 提交者: Konrad Rzeszutek Wilk

xen/events: refactor retrigger_dynirq() and resend_irq_on_evtchn()

These two function did the same thing with different parameters, put
the common bits in retrigger_evtchn().

This changes the return value of resend_irq_on_evtchn() but the only
caller (in arch/ia64/xen/irq_xen.c) ignored the return value so this
is fine.
Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
上级 b7ef4a6d
...@@ -1558,13 +1558,13 @@ static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest, ...@@ -1558,13 +1558,13 @@ static int set_affinity_irq(struct irq_data *data, const struct cpumask *dest,
return rebind_irq_to_cpu(data->irq, tcpu); return rebind_irq_to_cpu(data->irq, tcpu);
} }
int resend_irq_on_evtchn(unsigned int irq) static int retrigger_evtchn(int evtchn)
{ {
int masked, evtchn = evtchn_from_irq(irq); int masked;
struct shared_info *s = HYPERVISOR_shared_info; struct shared_info *s = HYPERVISOR_shared_info;
if (!VALID_EVTCHN(evtchn)) if (!VALID_EVTCHN(evtchn))
return 1; return 0;
masked = sync_test_and_set_bit(evtchn, BM(s->evtchn_mask)); masked = sync_test_and_set_bit(evtchn, BM(s->evtchn_mask));
sync_set_bit(evtchn, BM(s->evtchn_pending)); sync_set_bit(evtchn, BM(s->evtchn_pending));
...@@ -1574,6 +1574,11 @@ int resend_irq_on_evtchn(unsigned int irq) ...@@ -1574,6 +1574,11 @@ int resend_irq_on_evtchn(unsigned int irq)
return 1; return 1;
} }
int resend_irq_on_evtchn(unsigned int irq)
{
return retrigger_evtchn(evtchn_from_irq(irq));
}
static void enable_dynirq(struct irq_data *data) static void enable_dynirq(struct irq_data *data)
{ {
int evtchn = evtchn_from_irq(data->irq); int evtchn = evtchn_from_irq(data->irq);
...@@ -1608,21 +1613,7 @@ static void mask_ack_dynirq(struct irq_data *data) ...@@ -1608,21 +1613,7 @@ static void mask_ack_dynirq(struct irq_data *data)
static int retrigger_dynirq(struct irq_data *data) static int retrigger_dynirq(struct irq_data *data)
{ {
int evtchn = evtchn_from_irq(data->irq); return retrigger_evtchn(evtchn_from_irq(data->irq));
struct shared_info *sh = HYPERVISOR_shared_info;
int ret = 0;
if (VALID_EVTCHN(evtchn)) {
int masked;
masked = sync_test_and_set_bit(evtchn, BM(sh->evtchn_mask));
sync_set_bit(evtchn, BM(sh->evtchn_pending));
if (!masked)
unmask_evtchn(evtchn);
ret = 1;
}
return ret;
} }
static void restore_pirqs(void) static void restore_pirqs(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册