summaryrefslogtreecommitdiffstats
path: root/sys/xen
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-10-22 16:51:52 +0000
committerroyger <royger@FreeBSD.org>2014-10-22 16:51:52 +0000
commitbca209134926c87ca1b88036757b0670f60d16ca (patch)
tree2326ae041f3d82fefca758419158d370607b934c /sys/xen
parent040f3ac494c1f69b7ae5430cc2b1452d0fbafdf0 (diff)
downloadFreeBSD-src-bca209134926c87ca1b88036757b0670f60d16ca.zip
FreeBSD-src-bca209134926c87ca1b88036757b0670f60d16ca.tar.gz
xen: allow to register event channels without handlers
This is needed by the event channel user-space device, that requires registering event channels without unmasking them. intr_add_handler will unconditionally unmask the event channel, so we avoid calling it if no filter/handler is provided, and then the user will be in charge of calling it when ready. In order to do this, we need to change the opaque type xen_intr_handle_t to contain the event channel port instead of the opaque cookie returned by intr_add_handler, since now registration of event channels without handlers are allowed. The cookie will now be stored inside of the private xenisrc struct. Also, introduce a new function called xen_intr_add_handler that allows adding a filter/handler after the event channel has been registered. Sponsored by: Citrix Systems R&D x86/xen/xen_intr.c: - Leave the event channel without a handler if no filter/handler is provided to xen_intr_bind_isrc. - Don't perform an evtchn_mask_port, intr_add_handler will already do it. - Change the opaque type xen_intr_handle_t to contain a pointer to the event channel port number, and make the necessary changes to related functions. - Introduce a new function called xen_intr_add_handler that can be used to add filter/handlers to an event channel after registration. xen/xen_intr.h: - Add prototype of xen_intr_add_handler.
Diffstat (limited to 'sys/xen')
-rw-r--r--sys/xen/xen_intr.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/xen/xen_intr.h b/sys/xen/xen_intr.h
index a29414d..d2d6470 100644
--- a/sys/xen/xen_intr.h
+++ b/sys/xen/xen_intr.h
@@ -246,4 +246,23 @@ int xen_register_msi(device_t dev, int vector, int count);
*/
int xen_release_msi(int vector);
+/**
+ * Bind an event channel port with a handler
+ *
+ * \param dev The device making this bind request.
+ * \param filter An interrupt filter handler. Specify NULL
+ * to always dispatch to the ithread handler.
+ * \param handler An interrupt ithread handler. Optional (can
+ * specify NULL) if all necessary event actions
+ * are performed by filter.
+ * \param arg Argument to present to both filter and handler.
+ * \param irqflags Interrupt handler flags. See sys/bus.h.
+ * \param handle Opaque handle used to manage this registration.
+ *
+ * \returns 0 on success, otherwise an errno.
+ */
+int xen_intr_add_handler(device_t dev, driver_filter_t filter,
+ driver_intr_t handler, void *arg, enum intr_type flags,
+ xen_intr_handle_t handle);
+
#endif /* _XEN_INTR_H_ */
OpenPOWER on IntegriCloud