diff options
author | Jeremy Fitzhardinge <jeremy@xensource.com> | 2007-07-17 21:37:05 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-07-18 11:47:42 -0400 |
commit | e46cdb66c8fc1c8d61cfae0f219ff47ac4b9d531 (patch) | |
tree | 7d9cdfef91e69fcfcba762a5a70cd58900308a5b /include | |
parent | 3b827c1b3aadf3adb4c602d19863f2d24e7cbc18 (diff) |
xen: event channels
Xen implements interrupts in terms of event channels. Each guest
domain gets 1024 event channels which can be used for a variety of
purposes, such as Xen timer events, inter-domain events,
inter-processor events (IPI) or for real hardware IRQs.
Within the kernel, we map the event channels to IRQs, and implement
the whole interrupt handling using a Xen irq_chip.
Rather than setting NR_IRQ to 1024 under PARAVIRT in order to
accomodate Xen, we create a dynamic mapping between event channels and
IRQs. Ideally, Linux will eventually move towards dynamically
allocating per-irq structures, and we can use a 1:1 mapping between
event channels and irqs.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/xen/events.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/xen/events.h b/include/xen/events.h new file mode 100644 index 00000000000..77f71c90682 --- /dev/null +++ b/include/xen/events.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef _XEN_EVENTS_H | ||
2 | #define _XEN_EVENTS_H | ||
3 | |||
4 | #include <linux/irq.h> | ||
5 | |||
6 | int bind_evtchn_to_irqhandler(unsigned int evtchn, | ||
7 | irqreturn_t (*handler)(int, void *), | ||
8 | unsigned long irqflags, const char *devname, | ||
9 | void *dev_id); | ||
10 | int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, | ||
11 | irqreturn_t (*handler)(int, void *), | ||
12 | unsigned long irqflags, const char *devname, void *dev_id); | ||
13 | |||
14 | /* | ||
15 | * Common unbind function for all event sources. Takes IRQ to unbind from. | ||
16 | * Automatically closes the underlying event channel (even for bindings | ||
17 | * made with bind_evtchn_to_irqhandler()). | ||
18 | */ | ||
19 | void unbind_from_irqhandler(unsigned int irq, void *dev_id); | ||
20 | |||
21 | static inline void notify_remote_via_evtchn(int port) | ||
22 | { | ||
23 | struct evtchn_send send = { .port = port }; | ||
24 | (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); | ||
25 | } | ||
26 | |||
27 | extern void notify_remote_via_irq(int irq); | ||
28 | #endif /* _XEN_EVENTS_H */ | ||