diff options
author | Antonios Motakis <a.motakis@virtualopensystems.com> | 2015-03-16 14:08:54 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2015-03-16 14:08:54 -0600 |
commit | 7e992d692750b2938224eb43fee907181d92a602 (patch) | |
tree | cb09975ca0d547f92203e89df3b832daccdcb449 /include/linux/vfio.h | |
parent | 09bbcb8810c4673cb96477e0e83c9bcdfadc7741 (diff) | |
download | talos-op-linux-7e992d692750b2938224eb43fee907181d92a602.tar.gz talos-op-linux-7e992d692750b2938224eb43fee907181d92a602.zip |
vfio: move eventfd support code for VFIO_PCI to a separate file
The virqfd functionality that is used by VFIO_PCI to implement interrupt
masking and unmasking via an eventfd, is generic enough and can be reused
by another driver. Move it to a separate file in order to allow the code
to be shared.
Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Signed-off-by: Baptiste Reynal <b.reynal@virtualopensystems.com>
Reviewed-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'include/linux/vfio.h')
-rw-r--r-- | include/linux/vfio.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/vfio.h b/include/linux/vfio.h index 2d67b8998fd8..683b5146022e 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -14,6 +14,8 @@ #include <linux/iommu.h> #include <linux/mm.h> +#include <linux/workqueue.h> +#include <linux/poll.h> #include <uapi/linux/vfio.h> /** @@ -123,4 +125,29 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, return -ENOTTY; } #endif /* CONFIG_EEH */ + +/* + * IRQfd - generic + */ +struct virqfd { + void *opaque; + struct eventfd_ctx *eventfd; + int (*handler)(void *, void *); + void (*thread)(void *, void *); + void *data; + struct work_struct inject; + wait_queue_t wait; + poll_table pt; + struct work_struct shutdown; + struct virqfd **pvirqfd; +}; + +extern int vfio_virqfd_init(void); +extern void vfio_virqfd_exit(void); +extern int vfio_virqfd_enable(void *opaque, + int (*handler)(void *, void *), + void (*thread)(void *, void *), + void *data, struct virqfd **pvirqfd, int fd); +extern void vfio_virqfd_disable(struct virqfd **pvirqfd); + #endif /* VFIO_H */ |