aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-02-06 17:09:43 -0500
committerIngo Molnar <mingo@elte.hu>2009-02-09 06:17:30 -0500
commit792dc4f6cdacf50d3f2b93756d282fc04ee34bd5 (patch)
treec65e8bc1324e5ba62b268bcd1fbe1b4b90342ecd /drivers/xen
parenteca217b36e5d7d4377493d5cedd89105e66a5a72 (diff)
xen: use our own eventchannel->irq path
Rather than overloading vectors for event channels, take full responsibility for mapping an event channel to irq directly. With this patch Xen has its own irq allocator. When the kernel gets an event channel upcall, it maps the event channel number to an irq and injects it into the normal interrupt path. Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/events.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 7c3705479ea1..2c8d710713f5 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/ptrace.h> 31#include <asm/ptrace.h>
32#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/idle.h>
33#include <asm/sync_bitops.h> 34#include <asm/sync_bitops.h>
34#include <asm/xen/hypercall.h> 35#include <asm/xen/hypercall.h>
35#include <asm/xen/hypervisor.h> 36#include <asm/xen/hypervisor.h>
@@ -517,6 +518,24 @@ irqreturn_t xen_debug_interrupt(int irq, void *dev_id)
517} 518}
518 519
519 520
521static void xen_do_irq(unsigned irq, struct pt_regs *regs)
522{
523 struct pt_regs *old_regs = set_irq_regs(regs);
524
525 if (WARN_ON(irq == -1))
526 return;
527
528 exit_idle();
529 irq_enter();
530
531 //printk("cpu %d handling irq %d\n", smp_processor_id(), info->irq);
532 handle_irq(irq, regs);
533
534 irq_exit();
535
536 set_irq_regs(old_regs);
537}
538
520/* 539/*
521 * Search the CPUs pending events bitmasks. For each one found, map 540 * Search the CPUs pending events bitmasks. For each one found, map
522 * the event number to an irq, and feed it into do_IRQ() for 541 * the event number to an irq, and feed it into do_IRQ() for
@@ -557,8 +576,7 @@ void xen_evtchn_do_upcall(struct pt_regs *regs)
557 int port = (word_idx * BITS_PER_LONG) + bit_idx; 576 int port = (word_idx * BITS_PER_LONG) + bit_idx;
558 int irq = evtchn_to_irq[port]; 577 int irq = evtchn_to_irq[port];
559 578
560 if (irq != -1) 579 xen_do_irq(irq, regs);
561 xen_do_IRQ(irq, regs);
562 } 580 }
563 } 581 }
564 582