#include <linux/sizes.h>
#include <linux/vfio_pci_core.h>
#define RESMEM_REGION_INDEX …
#define USEMEM_REGION_INDEX …
#define RESMEM_SIZE …
#define MEMBLK_SIZE …
struct mem_region { … };
struct nvgrace_gpu_pci_core_device { … };
static void nvgrace_gpu_init_fake_bar_emu_regs(struct vfio_device *core_vdev)
{ … }
static struct mem_region *
nvgrace_gpu_memregion(int index,
struct nvgrace_gpu_pci_core_device *nvdev)
{ … }
static int nvgrace_gpu_open_device(struct vfio_device *core_vdev)
{ … }
static void nvgrace_gpu_close_device(struct vfio_device *core_vdev)
{ … }
static int nvgrace_gpu_mmap(struct vfio_device *core_vdev,
struct vm_area_struct *vma)
{ … }
static long
nvgrace_gpu_ioctl_get_region_info(struct vfio_device *core_vdev,
unsigned long arg)
{ … }
static long nvgrace_gpu_ioctl(struct vfio_device *core_vdev,
unsigned int cmd, unsigned long arg)
{ … }
static __le64
nvgrace_gpu_get_read_value(size_t bar_size, u64 flags, __le64 val64)
{ … }
static ssize_t
nvgrace_gpu_read_config_emu(struct vfio_device *core_vdev,
char __user *buf, size_t count, loff_t *ppos)
{ … }
static ssize_t
nvgrace_gpu_write_config_emu(struct vfio_device *core_vdev,
const char __user *buf, size_t count, loff_t *ppos)
{ … }
static int
nvgrace_gpu_map_device_mem(int index,
struct nvgrace_gpu_pci_core_device *nvdev)
{ … }
static int
nvgrace_gpu_map_and_read(struct nvgrace_gpu_pci_core_device *nvdev,
char __user *buf, size_t mem_count, loff_t *ppos)
{ … }
static ssize_t
nvgrace_gpu_read_mem(struct nvgrace_gpu_pci_core_device *nvdev,
char __user *buf, size_t count, loff_t *ppos)
{ … }
static ssize_t
nvgrace_gpu_read(struct vfio_device *core_vdev,
char __user *buf, size_t count, loff_t *ppos)
{ … }
static int
nvgrace_gpu_map_and_write(struct nvgrace_gpu_pci_core_device *nvdev,
const char __user *buf, size_t mem_count,
loff_t *ppos)
{ … }
static ssize_t
nvgrace_gpu_write_mem(struct nvgrace_gpu_pci_core_device *nvdev,
size_t count, loff_t *ppos, const char __user *buf)
{ … }
static ssize_t
nvgrace_gpu_write(struct vfio_device *core_vdev,
const char __user *buf, size_t count, loff_t *ppos)
{ … }
static const struct vfio_device_ops nvgrace_gpu_pci_ops = …;
static const struct vfio_device_ops nvgrace_gpu_pci_core_ops = …;
static int
nvgrace_gpu_fetch_memory_property(struct pci_dev *pdev,
u64 *pmemphys, u64 *pmemlength)
{ … }
static int
nvgrace_gpu_init_nvdev_struct(struct pci_dev *pdev,
struct nvgrace_gpu_pci_core_device *nvdev,
u64 memphys, u64 memlength)
{ … }
static int nvgrace_gpu_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{ … }
static void nvgrace_gpu_remove(struct pci_dev *pdev)
{ … }
static const struct pci_device_id nvgrace_gpu_vfio_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, nvgrace_gpu_vfio_pci_table);
static struct pci_driver nvgrace_gpu_vfio_pci_driver = …;
module_pci_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;