2 * Xen Event Channels (internal header)
4 * Copyright (C) 2013 Citrix Systems R&D Ltd.
6 * This source code is licensed under the GNU General Public License,
7 * Version 2 or later. See the file COPYING for more details.
9 #ifndef __EVENTS_INTERNAL_H__
10 #define __EVENTS_INTERNAL_H__
12 /* Interrupt types. */
22 * Packed IRQ information:
23 * type - enum xen_irq_type
24 * event channel - irq->event channel mapping
25 * cpu - cpu this event channel is bound to
26 * index - type-specific information:
27 * PIRQ - vector, with MSB being "needs EIO", or physical IRQ of the HVM
28 * guest, or GSI (real passthrough IRQ) of the device.
34 struct list_head list;
36 enum xen_irq_type type; /* type */
38 unsigned short evtchn; /* event channel */
39 unsigned short cpu; /* cpu bound */
54 #define PIRQ_NEEDS_EOI (1 << 0)
55 #define PIRQ_SHAREABLE (1 << 1)
57 extern int *evtchn_to_irq;
59 struct irq_info *info_for_irq(unsigned irq);
60 unsigned cpu_from_irq(unsigned irq);
61 unsigned cpu_from_evtchn(unsigned int evtchn);
63 void xen_evtchn_port_bind_to_cpu(struct irq_info *info, int cpu);
65 void clear_evtchn(int port);
66 void set_evtchn(int port);
67 int test_evtchn(int port);
68 int test_and_set_mask(int port);
69 void mask_evtchn(int port);
70 void unmask_evtchn(int port);
72 void xen_evtchn_handle_events(int cpu);
74 #endif /* #ifndef __EVENTS_INTERNAL_H__ */