This is the second of 2 related, but independent, patches. This is for
uio.c, the previous is for uio_pci_generic.c.
The 2 patches were previously one large patch. Changes for this version:
- uio_pci_generic.c just gets extensions so that a single fd can be used
by non-privileged processes for interrupt control and mmaps
- All of the DMA and IOMMU related stuff move to uio.c; no longer a need
to pass ioctls to individual uio drivers. It turns out that the code
is not PCI specific anyways.
- A new ioctl to pin DMA buffers to certain IO virtual addresses for KVM.
- New eventfd based interrupt notifications, including support for PCI
specific MSI and MSI-X interrupts.
- PCI specific code to reset PCI functions before and after use
@@ -122,4 +126,23 @@
#define UIO_PORT_GPIO 2
#define UIO_PORT_OTHER 3
+#endif /* __KERNEL__ */
+
+// Kernel& User level defines for ioctls
+
+struct uio_dma_map {
+ unsigned long vaddr;
+ unsigned long long dmaaddr;
+ int size;
+ int rdwr;
+};
+
+#define UIO_DMA_MAP_ANYWHERE _IOWR(';', 100, struct uio_dma_map)
+#define UIO_DMA_MAP_IOVA _IOWR(';', 101, struct uio_dma_map)
+#define UIO_DMA_UNMAP _IOW(';', 102, struct uio_dma_map)
+#define UIO_DMA_MASK _IOW(';', 103, unsigned long long)
+#define UIO_EVENTFD_IRQ _IOW(';', 104, int)
+#define UIO_EVENTFD_MSI _IOW(';', 105, int)
+#define UIO_EVENTFDS_MSIX _IOW(';', 106, int)