[go: up one dir, main page]

File: vfio.c

package info (click to toggle)
trinity 1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,252 kB
  • ctags: 2,738
  • sloc: ansic: 24,011; sh: 322; makefile: 141
file content (41 lines) | stat: -rw-r--r-- 924 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "config.h"

#ifdef USE_VFIO
#include <linux/vfio.h>

#include "utils.h"
#include "ioctls.h"

static const struct ioctl vfio_ioctls[] = {
	IOCTL(VFIO_GET_API_VERSION),
	IOCTL(VFIO_CHECK_EXTENSION),
	IOCTL(VFIO_SET_IOMMU),
	IOCTL(VFIO_GROUP_GET_STATUS),
	IOCTL(VFIO_GROUP_SET_CONTAINER),
	IOCTL(VFIO_GROUP_UNSET_CONTAINER),
	IOCTL(VFIO_GROUP_GET_DEVICE_FD),
	IOCTL(VFIO_DEVICE_GET_INFO),
	IOCTL(VFIO_DEVICE_GET_REGION_INFO),
	IOCTL(VFIO_DEVICE_GET_IRQ_INFO),
	IOCTL(VFIO_DEVICE_SET_IRQS),
	IOCTL(VFIO_DEVICE_RESET),
	IOCTL(VFIO_IOMMU_GET_INFO),
	IOCTL(VFIO_IOMMU_MAP_DMA),
	IOCTL(VFIO_IOMMU_UNMAP_DMA),
};

static const char *const vfio_devs[] = {
	"vfio",
};

static const struct ioctl_group vfio_grp = {
	.devtype = DEV_CHAR,
	.devs = vfio_devs,
	.devs_cnt = ARRAY_SIZE(vfio_devs),
	.sanitise = pick_random_ioctl,
	.ioctls = vfio_ioctls,
	.ioctls_cnt = ARRAY_SIZE(vfio_ioctls),
};

REG_IOCTL_GROUP(vfio_grp)
#endif