pci: merge mapping structures for linux and bsd
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_init.h
index 1070eb8..d9d1878 100644 (file)
 
 #include "eal_vfio.h"
 
-struct pci_map {
-       void *addr;
-       uint64_t offset;
-       uint64_t size;
-       uint64_t phaddr;
-};
-
-/*
- * For multi-process we need to reproduce all PCI mappings in secondary
- * processes, so save them in a tailq.
- */
-struct mapped_pci_resource {
-       TAILQ_ENTRY(mapped_pci_resource) next;
-
-       struct rte_pci_addr pci_addr;
-       char path[PATH_MAX];
-       int nb_maps;
-       struct pci_map maps[PCI_MAX_RESOURCE];
-};
-
-TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
-extern struct mapped_pci_res_list *pci_res_list;
-
 /*
  * Helper function to map PCI resources right after hugepages in virtual memory
  */
@@ -66,11 +43,18 @@ extern void *pci_map_addr;
 void *pci_find_max_end_va(void);
 
 void *pci_map_resource(void *requested_addr, int fd, off_t offset,
-               size_t size);
+              size_t size, int additional_flags);
 
 /* map IGB_UIO resource prototype */
 int pci_uio_map_resource(struct rte_pci_device *dev);
 
+void pci_unmap_resource(void *requested_addr, size_t size);
+
+#ifdef RTE_LIBRTE_EAL_HOTPLUG
+/* unmap IGB_UIO resource prototype */
+void pci_uio_unmap_resource(struct rte_pci_device *dev);
+#endif /* RTE_LIBRTE_EAL_HOTPLUG */
+
 #ifdef VFIO_PRESENT
 
 #define VFIO_MAX_GROUPS 64