eal/linux: only call iopl on x86
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_uio.c
index db22d31..b833244 100644 (file)
@@ -39,7 +39,7 @@
 #include <sys/mman.h>
 #include <linux/pci_regs.h>
 
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
+#if defined(RTE_ARCH_X86)
 #include <sys/io.h>
 #endif
 
@@ -161,14 +161,14 @@ pci_get_uio_dev(struct rte_pci_device *dev, char *dstbuf,
         * or uio:uioX */
 
        snprintf(dirname, sizeof(dirname),
-                       SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/uio",
+                       "%s/" PCI_PRI_FMT "/uio", pci_get_sysfs_path(),
                        loc->domain, loc->bus, loc->devid, loc->function);
 
        dir = opendir(dirname);
        if (dir == NULL) {
                /* retry with the parent directory */
                snprintf(dirname, sizeof(dirname),
-                               SYSFS_PCI_DEVICES "/" PCI_PRI_FMT,
+                               "%s/" PCI_PRI_FMT, pci_get_sysfs_path(),
                                loc->domain, loc->bus, loc->devid, loc->function);
                dir = opendir(dirname);
 
@@ -319,7 +319,8 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,
 
        /* update devname for mmap  */
        snprintf(devname, sizeof(devname),
-                       SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/resource%d",
+                       "%s/" PCI_PRI_FMT "/resource%d",
+                       pci_get_sysfs_path(),
                        loc->domain, loc->bus, loc->devid,
                        loc->function, res_idx);
 
@@ -372,7 +373,7 @@ int
 pci_uio_ioport_map(struct rte_pci_device *dev, int bar,
                   struct rte_pci_ioport *p)
 {
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
+#if defined(RTE_ARCH_X86)
        char dirname[PATH_MAX];
        char filename[PATH_MAX];
        int uio_num;
@@ -424,7 +425,7 @@ void
 pci_uio_ioport_read(struct rte_pci_ioport *p,
                    void *data, size_t len, off_t offset)
 {
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
+#if defined(RTE_ARCH_X86)
        uint8_t *d;
        int size;
        unsigned short reg = p->base + offset;
@@ -453,7 +454,7 @@ void
 pci_uio_ioport_write(struct rte_pci_ioport *p,
                     const void *data, size_t len, off_t offset)
 {
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
+#if defined(RTE_ARCH_X86)
        const uint8_t *s;
        int size;
        unsigned short reg = p->base + offset;
@@ -482,7 +483,7 @@ int
 pci_uio_ioport_unmap(struct rte_pci_ioport *p)
 {
        RTE_SET_USED(p);
-#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)
+#if defined(RTE_ARCH_X86)
        /* FIXME close intr fd ? */
        return 0;
 #else