Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99555
b: refs/heads/master
c: eb1e305
h: refs/heads/master
i:
  99553: fe0fdbd
  99551: d6ee163
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Thomas Gleixner committed May 27, 2008
1 parent 4a3762e commit 867a140
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5edbc1f75420935b1ec7e65df10c8f81cea82de
refs/heads/master: eb1e305f4ef201e549ffd475b7dcbcd4ec36d7dc
27 changes: 27 additions & 0 deletions trunk/drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,33 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
put_cpu();
}

/* Rebind a new event channel to an existing irq. */
void rebind_evtchn_irq(int evtchn, int irq)
{
/* Make sure the irq is masked, since the new event channel
will also be masked. */
disable_irq(irq);

spin_lock(&irq_mapping_update_lock);

/* After resume the irq<->evtchn mappings are all cleared out */
BUG_ON(evtchn_to_irq[evtchn] != -1);
/* Expect irq to have been bound before,
so the bindcount should be non-0 */
BUG_ON(irq_bindcount[irq] == 0);

evtchn_to_irq[evtchn] = irq;
irq_info[irq] = mk_irq_info(IRQT_EVTCHN, 0, evtchn);

spin_unlock(&irq_mapping_update_lock);

/* new event channels are always bound to cpu 0 */
irq_set_affinity(irq, cpumask_of_cpu(0));

/* Unmask the event channel. */
enable_irq(irq);
}

/* Rebind an evtchn so that it gets delivered to a specific cpu */
static void rebind_irq_to_cpu(unsigned irq, unsigned tcpu)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/xen/events.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void unbind_from_irqhandler(unsigned int irq, void *dev_id);

void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector);
int resend_irq_on_evtchn(unsigned int irq);
void rebind_evtchn_irq(int evtchn, int irq);

static inline void notify_remote_via_evtchn(int port)
{
Expand Down

0 comments on commit 867a140

Please sign in to comment.