diff options
| author | Antonios Motakis <a.motakis@virtualopensystems.com> | 2015-03-16 16:08:54 -0400 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2015-03-16 16:08:54 -0400 |
| commit | 7e992d692750b2938224eb43fee907181d92a602 (patch) | |
| tree | cb09975ca0d547f92203e89df3b832daccdcb449 /include | |
| parent | 09bbcb8810c4673cb96477e0e83c9bcdfadc7741 (diff) | |
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')
| -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 @@ | |||
| 14 | 14 | ||
| 15 | #include <linux/iommu.h> | 15 | #include <linux/iommu.h> |
| 16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
| 17 | #include <linux/workqueue.h> | ||
| 18 | #include <linux/poll.h> | ||
| 17 | #include <uapi/linux/vfio.h> | 19 | #include <uapi/linux/vfio.h> |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
| @@ -123,4 +125,29 @@ static inline long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, | |||
| 123 | return -ENOTTY; | 125 | return -ENOTTY; |
| 124 | } | 126 | } |
| 125 | #endif /* CONFIG_EEH */ | 127 | #endif /* CONFIG_EEH */ |
| 128 | |||
| 129 | /* | ||
| 130 | * IRQfd - generic | ||
| 131 | */ | ||
| 132 | struct virqfd { | ||
| 133 | void *opaque; | ||
| 134 | struct eventfd_ctx *eventfd; | ||
| 135 | int (*handler)(void *, void *); | ||
| 136 | void (*thread)(void *, void *); | ||
| 137 | void *data; | ||
| 138 | struct work_struct inject; | ||
| 139 | wait_queue_t wait; | ||
| 140 | poll_table pt; | ||
| 141 | struct work_struct shutdown; | ||
| 142 | struct virqfd **pvirqfd; | ||
| 143 | }; | ||
| 144 | |||
| 145 | extern int vfio_virqfd_init(void); | ||
| 146 | extern void vfio_virqfd_exit(void); | ||
| 147 | extern int vfio_virqfd_enable(void *opaque, | ||
| 148 | int (*handler)(void *, void *), | ||
| 149 | void (*thread)(void *, void *), | ||
| 150 | void *data, struct virqfd **pvirqfd, int fd); | ||
| 151 | extern void vfio_virqfd_disable(struct virqfd **pvirqfd); | ||
| 152 | |||
| 126 | #endif /* VFIO_H */ | 153 | #endif /* VFIO_H */ |
