FreeBSD xen subsystem code
xen_intr.h
1/******************************************************************************
2 * xen_intr.h
3 *
4 * APIs for managing Xen event channel, virtual IRQ, and physical IRQ
5 * notifications.
6 *
7 * Copyright (c) 2004, K A Fraser
8 * Copyright (c) 2012, Spectra Logic Corporation
9 *
10 * This file may be distributed separately from the Linux kernel, or
11 * incorporated into other software packages, subject to the following license:
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this source file (the "Software"), to deal in the Software without
15 * restriction, including without limitation the rights to use, copy, modify,
16 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
17 * and to permit persons to whom the Software is furnished to do so, subject to
18 * the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29 * IN THE SOFTWARE.
30 *
31 * $FreeBSD$
32 */
33#ifndef _XEN_INTR_H_
34#define _XEN_INTR_H_
35
36#include <contrib/xen/event_channel.h>
37
39typedef void * xen_intr_handle_t;
40
41void xen_intr_handle_upcall(struct trapframe *trap_frame);
42
61int xen_intr_bind_local_port(device_t dev, evtchn_port_t local_port,
62 driver_filter_t filter, driver_intr_t handler, void *arg,
63 enum intr_type irqflags, xen_intr_handle_t *handlep);
64
85int xen_intr_alloc_and_bind_local_port(device_t dev,
86 u_int remote_domain, driver_filter_t filter, driver_intr_t handler,
87 void *arg, enum intr_type irqflags, xen_intr_handle_t *handlep);
88
109int xen_intr_bind_remote_port(device_t dev, u_int remote_domain,
110 evtchn_port_t remote_port, driver_filter_t filter,
111 driver_intr_t handler, void *arg, enum intr_type irqflags,
112 xen_intr_handle_t *handlep);
113
134int xen_intr_bind_virq(device_t dev, u_int virq, u_int cpu,
135 driver_filter_t filter, driver_intr_t handler,
136 void *arg, enum intr_type irqflags, xen_intr_handle_t *handlep);
137
151int xen_intr_alloc_and_bind_ipi(u_int cpu,
152 driver_filter_t filter, enum intr_type irqflags,
153 xen_intr_handle_t *handlep);
154
169void xen_intr_unbind(xen_intr_handle_t *handle);
170
182int
183xen_intr_describe(xen_intr_handle_t port_handle, const char *fmt, ...)
184 __attribute__((format(printf, 2, 3)));
185
196void xen_intr_signal(xen_intr_handle_t handle);
197
207evtchn_port_t xen_intr_port(xen_intr_handle_t handle);
208
224int xen_intr_add_handler(const char *name, driver_filter_t filter,
225 driver_intr_t handler, void *arg, enum intr_type flags,
226 xen_intr_handle_t handle);
227
237int xen_intr_get_evtchn_from_port(evtchn_port_t port,
238 xen_intr_handle_t *handlep);
239
240#endif /* _XEN_INTR_H_ */