aboutsummaryrefslogtreecommitdiff
path: root/samples/gpio-pci-idio-16.c
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2020-09-24 11:58:46 -0400
committerThanos Makatos <thanos.makatos@nutanix.com>2020-09-24 12:14:17 -0400
commitd0634899d7d76872efca35bf79a0e3f31dcc8d74 (patch)
tree0effbdb6d918304b6b3a21ea2aefaee2ca0d4b42 /samples/gpio-pci-idio-16.c
parent6d6470ab820212059f108a458ceb9e6e98ab1ef6 (diff)
downloadlibvfio-user-d0634899d7d76872efca35bf79a0e3f31dcc8d74.zip
libvfio-user-d0634899d7d76872efca35bf79a0e3f31dcc8d74.tar.gz
libvfio-user-d0634899d7d76872efca35bf79a0e3f31dcc8d74.tar.bz2
implement VFIO_USER_DMA_MAP
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/gpio-pci-idio-16.c')
-rw-r--r--samples/gpio-pci-idio-16.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c
index 3c87103..06320f3 100644
--- a/samples/gpio-pci-idio-16.c
+++ b/samples/gpio-pci-idio-16.c
@@ -65,6 +65,12 @@ static void _sa_handler(int signum __attribute__((unused)))
{
}
+static int
+unmap_dma(void *pvt __attribute__((unused)),
+ uint64_t iova __attribute__((unused)))
+{
+}
+
int main(int argc, char *argv[])
{
int ret;
@@ -105,6 +111,13 @@ int main(int argc, char *argv[])
.irq_count[LM_DEV_INTX_IRQ_IDX] = 1,
},
.uuid = argv[optind],
+
+ /*
+ * Not strictly necessary since this device doesn't yet do any DMA.
+ * By declaring this dummy callback DMA regions get registered,
+ * otherwise they're ignored.
+ */
+ .unmap_dma = unmap_dma
};
sigemptyset(&act.sa_mask);