Blame view
include/xen/events.h
4.7 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
e46cdb66c xen: event channels |
2 3 |
#ifndef _XEN_EVENTS_H #define _XEN_EVENTS_H |
f87e4cac4 xen: SMP guest su... |
4 |
#include <linux/interrupt.h> |
bce5963bc xen/events: fix b... |
5 |
#include <linux/irq.h> |
4892c9b4a xen: add support ... |
6 7 8 |
#ifdef CONFIG_PCI_MSI #include <linux/msi.h> #endif |
f87e4cac4 xen: SMP guest su... |
9 10 11 |
#include <xen/interface/event_channel.h> #include <asm/xen/hypercall.h> |
e849c3e9e Xen: make events.... |
12 |
#include <asm/xen/events.h> |
e46cdb66c xen: event channels |
13 |
|
0dc0064ad xen/evtchn: suppo... |
14 |
unsigned xen_evtchn_nr_channels(void); |
0102e4efd xen: Use evtchn_t... |
15 |
int bind_evtchn_to_irq(evtchn_port_t evtchn); |
54c9de898 xen/events: add a... |
16 |
int bind_evtchn_to_irq_lateeoi(evtchn_port_t evtchn); |
0102e4efd xen: Use evtchn_t... |
17 |
int bind_evtchn_to_irqhandler(evtchn_port_t evtchn, |
f87e4cac4 xen: SMP guest su... |
18 |
irq_handler_t handler, |
e46cdb66c xen: event channels |
19 20 |
unsigned long irqflags, const char *devname, void *dev_id); |
54c9de898 xen/events: add a... |
21 22 23 24 |
int bind_evtchn_to_irqhandler_lateeoi(evtchn_port_t evtchn, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); |
77bb3dfdc xen/events: don't... |
25 |
int bind_virq_to_irq(unsigned int virq, unsigned int cpu, bool percpu); |
e46cdb66c xen: event channels |
26 |
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, |
f87e4cac4 xen: SMP guest su... |
27 28 29 30 31 32 33 34 35 |
irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); int bind_ipi_to_irqhandler(enum ipi_vector ipi, unsigned int cpu, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); |
54c9de898 xen/events: add a... |
36 37 |
int bind_interdomain_evtchn_to_irq_lateeoi(unsigned int remote_domain, evtchn_port_t remote_port); |
54c9de898 xen/events: add a... |
38 39 40 41 42 43 |
int bind_interdomain_evtchn_to_irqhandler_lateeoi(unsigned int remote_domain, evtchn_port_t remote_port, irq_handler_t handler, unsigned long irqflags, const char *devname, void *dev_id); |
e46cdb66c xen: event channels |
44 45 46 47 48 49 50 |
/* * Common unbind function for all event sources. Takes IRQ to unbind from. * Automatically closes the underlying event channel (even for bindings * made with bind_evtchn_to_irqhandler()). */ void unbind_from_irqhandler(unsigned int irq, void *dev_id); |
54c9de898 xen/events: add a... |
51 52 53 54 55 56 57 |
/* * Send late EOI for an IRQ bound to an event channel via one of the *_lateeoi * functions above. */ void xen_irq_lateeoi(unsigned int irq, unsigned int eoi_flags); /* Signal an event was spurious, i.e. there was no action resulting from it. */ #define XEN_EOI_FLAG_SPURIOUS 0x00000001 |
6ccecb0fb xen/events: allow... |
58 59 60 61 |
#define XEN_IRQ_PRIORITY_MAX EVTCHN_FIFO_PRIORITY_MAX #define XEN_IRQ_PRIORITY_DEFAULT EVTCHN_FIFO_PRIORITY_DEFAULT #define XEN_IRQ_PRIORITY_MIN EVTCHN_FIFO_PRIORITY_MIN int xen_set_irq_priority(unsigned irq, unsigned priority); |
420eb554d xen/event: Add re... |
62 63 64 |
/* * Allow extra references to event channels exposed to userspace by evtchn */ |
0102e4efd xen: Use evtchn_t... |
65 66 67 |
int evtchn_make_refcounted(evtchn_port_t evtchn); int evtchn_get(evtchn_port_t evtchn); void evtchn_put(evtchn_port_t evtchn); |
420eb554d xen/event: Add re... |
68 |
|
f87e4cac4 xen: SMP guest su... |
69 |
void xen_send_IPI_one(unsigned int cpu, enum ipi_vector vector); |
0102e4efd xen: Use evtchn_t... |
70 |
void rebind_evtchn_irq(evtchn_port_t evtchn, int irq); |
bce5963bc xen/events: fix b... |
71 |
int xen_set_affinity_evtchn(struct irq_desc *desc, unsigned int tcpu); |
f87e4cac4 xen: SMP guest su... |
72 |
|
0102e4efd xen: Use evtchn_t... |
73 |
static inline void notify_remote_via_evtchn(evtchn_port_t port) |
e46cdb66c xen: event channels |
74 75 76 77 |
{ struct evtchn_send send = { .port = port }; (void)HYPERVISOR_event_channel_op(EVTCHNOP_send, &send); } |
76465b2da xen: events: remo... |
78 |
void notify_remote_via_irq(int irq); |
0e91398f2 xen: implement sa... |
79 |
|
76465b2da xen: events: remo... |
80 |
void xen_irq_resume(void); |
0e91398f2 xen: implement sa... |
81 |
|
2d9e1e2f5 xen: implement Xe... |
82 83 |
/* Clear an irq's pending state, in preparation for polling on it */ void xen_clear_irq_pending(int irq); |
168d2f464 xen: save previou... |
84 85 |
void xen_set_irq_pending(int irq); bool xen_test_irq_pending(int irq); |
2d9e1e2f5 xen: implement Xe... |
86 87 88 89 |
/* Poll waiting for an irq to become pending. In the usual case, the irq will be disabled so it won't deliver an interrupt. */ void xen_poll_irq(int irq); |
d9a8814f2 xen: Provide a va... |
90 91 92 |
/* Poll waiting for an irq to become pending with a timeout. In the usual case, * the irq will be disabled so it won't deliver an interrupt. */ void xen_poll_irq_timeout(int irq, u64 timeout); |
d4c045364 xen: add irq_from... |
93 |
/* Determine the IRQ which is bound to an event channel */ |
0102e4efd xen: Use evtchn_t... |
94 |
unsigned int irq_from_evtchn(evtchn_port_t evtchn); |
9a489f45a xen/events: move ... |
95 |
int irq_from_virq(unsigned int cpu, unsigned int virq); |
0102e4efd xen: Use evtchn_t... |
96 |
evtchn_port_t evtchn_from_irq(unsigned irq); |
d4c045364 xen: add irq_from... |
97 |
|
38e20b07e x86/xen: event ch... |
98 99 100 |
int xen_set_callback_via(uint64_t via); void xen_evtchn_do_upcall(struct pt_regs *regs); void xen_hvm_evtchn_do_upcall(void); |
f4d0635bf xen: events: refa... |
101 102 103 |
/* Bind a pirq for a physical interrupt to an irq. */ int xen_bind_pirq_gsi_to_irq(unsigned gsi, unsigned pirq, int shareable, char *name); |
f731e3ef0 xen: remap MSIs i... |
104 105 |
#ifdef CONFIG_PCI_MSI |
f4d0635bf xen: events: refa... |
106 |
/* Allocate a pirq for a MSI style physical interrupt. */ |
bf480d952 xen: events: sepa... |
107 |
int xen_allocate_pirq_msi(struct pci_dev *dev, struct msi_desc *msidesc); |
f4d0635bf xen: events: refa... |
108 |
/* Bind an PSI pirq to an irq. */ |
bf480d952 xen: events: sepa... |
109 |
int xen_bind_pirq_msi_to_irq(struct pci_dev *dev, struct msi_desc *msidesc, |
4892c9b4a xen: add support ... |
110 |
int pirq, int nvec, const char *name, domid_t domid); |
f731e3ef0 xen: remap MSIs i... |
111 |
#endif |
d46a78b05 xen: implement pi... |
112 |
|
b5401a96b xen/x86/PCI: Add ... |
113 114 |
/* De-allocates the above mentioned physical interrupt. */ int xen_destroy_irq(int irq); |
af42b8d12 xen: fix MSI setu... |
115 116 |
/* Return irq from pirq */ int xen_irq_from_pirq(unsigned pirq); |
e6197acc7 xen/irq: Export '... |
117 118 |
/* Return the pirq allocated to the irq. */ int xen_pirq_from_irq(unsigned irq); |
68c2c39a7 xen: do not map t... |
119 120 |
/* Return the irq allocated to the gsi */ int xen_irq_from_gsi(unsigned gsi); |
c7c2c3a28 xen/irq: Add supp... |
121 122 |
/* Determine whether to ignore this IRQ if it is passed to a guest. */ int xen_test_irq_shared(int irq); |
0ec53ecf3 xen/arm: receive ... |
123 124 |
/* initialize Xen IRQ subsystem */ void xen_init_IRQ(void); |
e46cdb66c xen: event channels |
125 |
#endif /* _XEN_EVENTS_H */ |