3838#define vfio_iowrite8 iowrite8
3939
4040#define VFIO_IOWRITE (size ) \
41- static int vfio_pci_iowrite ##size(struct vfio_pci_core_device *vdev, \
41+ int vfio_pci_core_iowrite ##size(struct vfio_pci_core_device *vdev, \
4242 bool test_mem, u##size val, void __iomem *io) \
4343{ \
4444 if (test_mem) { \
@@ -55,7 +55,8 @@ static int vfio_pci_iowrite##size(struct vfio_pci_core_device *vdev, \
5555 up_read(&vdev->memory_lock); \
5656 \
5757 return 0; \
58- }
58+ } \
59+ EXPORT_SYMBOL_GPL(vfio_pci_core_iowrite##size);
5960
6061VFIO_IOWRITE (8 )
6162VFIO_IOWRITE (16 )
@@ -65,7 +66,7 @@ VFIO_IOWRITE(64)
6566#endif
6667
6768#define VFIO_IOREAD (size ) \
68- static int vfio_pci_ioread ##size(struct vfio_pci_core_device *vdev, \
69+ int vfio_pci_core_ioread ##size(struct vfio_pci_core_device *vdev, \
6970 bool test_mem, u##size *val, void __iomem *io) \
7071{ \
7172 if (test_mem) { \
@@ -82,7 +83,8 @@ static int vfio_pci_ioread##size(struct vfio_pci_core_device *vdev, \
8283 up_read(&vdev->memory_lock); \
8384 \
8485 return 0; \
85- }
86+ } \
87+ EXPORT_SYMBOL_GPL(vfio_pci_core_ioread##size);
8688
8789VFIO_IOREAD (8 )
8890VFIO_IOREAD (16 )
@@ -119,13 +121,13 @@ static ssize_t do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
119121 if (copy_from_user (& val , buf , 4 ))
120122 return - EFAULT ;
121123
122- ret = vfio_pci_iowrite32 (vdev , test_mem ,
123- val , io + off );
124+ ret = vfio_pci_core_iowrite32 (vdev , test_mem ,
125+ val , io + off );
124126 if (ret )
125127 return ret ;
126128 } else {
127- ret = vfio_pci_ioread32 (vdev , test_mem ,
128- & val , io + off );
129+ ret = vfio_pci_core_ioread32 (vdev , test_mem ,
130+ & val , io + off );
129131 if (ret )
130132 return ret ;
131133
@@ -141,13 +143,13 @@ static ssize_t do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
141143 if (copy_from_user (& val , buf , 2 ))
142144 return - EFAULT ;
143145
144- ret = vfio_pci_iowrite16 (vdev , test_mem ,
145- val , io + off );
146+ ret = vfio_pci_core_iowrite16 (vdev , test_mem ,
147+ val , io + off );
146148 if (ret )
147149 return ret ;
148150 } else {
149- ret = vfio_pci_ioread16 (vdev , test_mem ,
150- & val , io + off );
151+ ret = vfio_pci_core_ioread16 (vdev , test_mem ,
152+ & val , io + off );
151153 if (ret )
152154 return ret ;
153155
@@ -163,13 +165,13 @@ static ssize_t do_io_rw(struct vfio_pci_core_device *vdev, bool test_mem,
163165 if (copy_from_user (& val , buf , 1 ))
164166 return - EFAULT ;
165167
166- ret = vfio_pci_iowrite8 (vdev , test_mem ,
167- val , io + off );
168+ ret = vfio_pci_core_iowrite8 (vdev , test_mem ,
169+ val , io + off );
168170 if (ret )
169171 return ret ;
170172 } else {
171- ret = vfio_pci_ioread8 (vdev , test_mem ,
172- & val , io + off );
173+ ret = vfio_pci_core_ioread8 (vdev , test_mem ,
174+ & val , io + off );
173175 if (ret )
174176 return ret ;
175177
@@ -364,21 +366,21 @@ static void vfio_pci_ioeventfd_do_write(struct vfio_pci_ioeventfd *ioeventfd,
364366{
365367 switch (ioeventfd -> count ) {
366368 case 1 :
367- vfio_pci_iowrite8 (ioeventfd -> vdev , test_mem ,
368- ioeventfd -> data , ioeventfd -> addr );
369+ vfio_pci_core_iowrite8 (ioeventfd -> vdev , test_mem ,
370+ ioeventfd -> data , ioeventfd -> addr );
369371 break ;
370372 case 2 :
371- vfio_pci_iowrite16 (ioeventfd -> vdev , test_mem ,
372- ioeventfd -> data , ioeventfd -> addr );
373+ vfio_pci_core_iowrite16 (ioeventfd -> vdev , test_mem ,
374+ ioeventfd -> data , ioeventfd -> addr );
373375 break ;
374376 case 4 :
375- vfio_pci_iowrite32 (ioeventfd -> vdev , test_mem ,
376- ioeventfd -> data , ioeventfd -> addr );
377+ vfio_pci_core_iowrite32 (ioeventfd -> vdev , test_mem ,
378+ ioeventfd -> data , ioeventfd -> addr );
377379 break ;
378380#ifdef iowrite64
379381 case 8 :
380- vfio_pci_iowrite64 (ioeventfd -> vdev , test_mem ,
381- ioeventfd -> data , ioeventfd -> addr );
382+ vfio_pci_core_iowrite64 (ioeventfd -> vdev , test_mem ,
383+ ioeventfd -> data , ioeventfd -> addr );
382384 break ;
383385#endif
384386 }
0 commit comments