@@ -95,6 +95,11 @@ typedef struct privcmd_mmap_resource {
__u64 addr;
} privcmd_mmap_resource_t;
+typedef struct privcmd_pcidev_get_gsi {
+ __u32 sbdf;
+ __u32 gsi;
+} privcmd_pcidev_get_gsi_t;
+
/*
* @cmd: IOCTL_PRIVCMD_HYPERCALL
* @arg: &privcmd_hypercall_t
@@ -114,6 +119,8 @@ typedef struct privcmd_mmap_resource {
_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
#define IOCTL_PRIVCMD_MMAP_RESOURCE \
_IOC(_IOC_NONE, 'P', 7, sizeof(privcmd_mmap_resource_t))
+#define IOCTL_PRIVCMD_PCIDEV_GET_GSI \
+ _IOC(_IOC_NONE, 'P', 10, sizeof(privcmd_pcidev_get_gsi_t))
#define IOCTL_PRIVCMD_UNIMPLEMENTED \
_IOC(_IOC_NONE, 'P', 0xFF, 0)
@@ -1642,6 +1642,8 @@ int xc_physdev_unmap_pirq(xc_interface *xch,
uint32_t domid,
int pirq);
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf);
+
/*
* LOGGING AND ERROR REPORTING
*/
@@ -60,6 +60,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
return ptr;
}
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
/*
* Local variables:
* mode: C
@@ -66,6 +66,26 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
return ptr;
}
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+ int ret;
+ privcmd_pcidev_get_gsi_t dev_gsi = {
+ .sbdf = sbdf,
+ .gsi = 0,
+ };
+
+ ret = ioctl(xencall_fd(xch->xcall),
+ IOCTL_PRIVCMD_PCIDEV_GET_GSI, &dev_gsi);
+
+ if (ret < 0) {
+ PERROR("Failed to get gsi from dev");
+ } else {
+ ret = dev_gsi.gsi;
+ }
+
+ return ret;
+}
+
/*
* Local variables:
* mode: C
@@ -47,6 +47,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
return memalign(alignment, size);
}
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
/*
* Local variables:
* mode: C
@@ -63,6 +63,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
return valloc(size);
}
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
/*
* Local variables:
* mode: C
@@ -32,6 +32,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
return memalign(alignment, size);
}
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+ errno = ENOSYS;
+ return -1;
+}
+
/*
* Local variables:
* mode: C