diff options
author | Roger Pau Monné <royger@FreeBSD.org> | 2016-10-31 13:00:53 +0000 |
---|---|---|
committer | Roger Pau Monné <royger@FreeBSD.org> | 2016-10-31 13:00:53 +0000 |
commit | 0f4d7d9fd78bd396c1c768bdcc2a298991115433 (patch) | |
tree | 86a828b16db62ab74d764c995d51a6eeb531b5e7 /sys/xen/xen_intr.h | |
parent | b2fd6999db269fd54228068dd0a719f86c4e002d (diff) | |
download | src-0f4d7d9fd78bd396c1c768bdcc2a298991115433.tar.gz src-0f4d7d9fd78bd396c1c768bdcc2a298991115433.zip |
xen/intr: add reference counts to event channels
Add a reference count to xenisrc. This is required for implementation of
unmap-notifications in the grant table userspace device (gntdev). We need to
hold a reference to the event channel port, in case the user deallocates the
port before we send the notification.
Submitted by: jaggi
Reviewed by: royger
Differential review: https://reviews.freebsd.org/D7429
Notes
Notes:
svn path=/head/; revision=308127
Diffstat (limited to 'sys/xen/xen_intr.h')
-rw-r--r-- | sys/xen/xen_intr.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/xen/xen_intr.h b/sys/xen/xen_intr.h index 5b2f60804eac..fc419d65ef0e 100644 --- a/sys/xen/xen_intr.h +++ b/sys/xen/xen_intr.h @@ -263,4 +263,16 @@ 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); +/** + * Get a reference to an event channel port + * + * \param port Event channel port to which we get a reference. + * \param handlep Pointer to an opaque handle used to manage this + * registration. + * + * \returns 0 on success, otherwise an errno. + */ +int xen_intr_get_evtchn_from_port(evtchn_port_t port, + xen_intr_handle_t *handlep); + #endif /* _XEN_INTR_H_ */ |