#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/eventfd.h>
#include <linux/msi.h>
#include <linux/pci.h>
#include <linux/file.h>
#include <linux/vfio.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include "vfio_pci_priv.h"
struct vfio_pci_irq_ctx { … };
static bool irq_is(struct vfio_pci_core_device *vdev, int type)
{ … }
static bool is_intx(struct vfio_pci_core_device *vdev)
{ … }
static bool is_irq_none(struct vfio_pci_core_device *vdev)
{ … }
static
struct vfio_pci_irq_ctx *vfio_irq_ctx_get(struct vfio_pci_core_device *vdev,
unsigned long index)
{ … }
static void vfio_irq_ctx_free(struct vfio_pci_core_device *vdev,
struct vfio_pci_irq_ctx *ctx, unsigned long index)
{ … }
static struct vfio_pci_irq_ctx *
vfio_irq_ctx_alloc(struct vfio_pci_core_device *vdev, unsigned long index)
{ … }
static void vfio_send_intx_eventfd(void *opaque, void *data)
{ … }
static bool __vfio_pci_intx_mask(struct vfio_pci_core_device *vdev)
{ … }
bool vfio_pci_intx_mask(struct vfio_pci_core_device *vdev)
{ … }
static int vfio_pci_intx_unmask_handler(void *opaque, void *data)
{ … }
static void __vfio_pci_intx_unmask(struct vfio_pci_core_device *vdev)
{ … }
void vfio_pci_intx_unmask(struct vfio_pci_core_device *vdev)
{ … }
static irqreturn_t vfio_intx_handler(int irq, void *dev_id)
{ … }
static int vfio_intx_enable(struct vfio_pci_core_device *vdev,
struct eventfd_ctx *trigger)
{ … }
static int vfio_intx_set_signal(struct vfio_pci_core_device *vdev,
struct eventfd_ctx *trigger)
{ … }
static void vfio_intx_disable(struct vfio_pci_core_device *vdev)
{ … }
static irqreturn_t vfio_msihandler(int irq, void *arg)
{ … }
static int vfio_msi_enable(struct vfio_pci_core_device *vdev, int nvec, bool msix)
{ … }
static int vfio_msi_alloc_irq(struct vfio_pci_core_device *vdev,
unsigned int vector, bool msix)
{ … }
static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev,
unsigned int vector, int fd, bool msix)
{ … }
static int vfio_msi_set_block(struct vfio_pci_core_device *vdev, unsigned start,
unsigned count, int32_t *fds, bool msix)
{ … }
static void vfio_msi_disable(struct vfio_pci_core_device *vdev, bool msix)
{ … }
static int vfio_pci_set_intx_unmask(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
static int vfio_pci_set_intx_mask(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
static int vfio_pci_set_intx_trigger(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
static int vfio_pci_set_msi_trigger(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
static int vfio_pci_set_ctx_trigger_single(struct eventfd_ctx **ctx,
unsigned int count, uint32_t flags,
void *data)
{ … }
static int vfio_pci_set_err_trigger(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
static int vfio_pci_set_req_trigger(struct vfio_pci_core_device *vdev,
unsigned index, unsigned start,
unsigned count, uint32_t flags, void *data)
{ … }
int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, uint32_t flags,
unsigned index, unsigned start, unsigned count,
void *data)
{ … }