From d0634899d7d76872efca35bf79a0e3f31dcc8d74 Mon Sep 17 00:00:00 2001 From: Thanos Makatos Date: Thu, 24 Sep 2020 11:58:46 -0400 Subject: implement VFIO_USER_DMA_MAP Signed-off-by: Thanos Makatos --- samples/gpio-pci-idio-16.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'samples/gpio-pci-idio-16.c') 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); -- cgit v1.1