From: Santosh Shukla Subject: [PATCH v4 10/14] virtio: pci: add dummy func definition for in/outb for non-x86 arch Date: Thu, 14 Jan 2016 18:58:33 +0530 Message-ID: <1452778117-30178-11-git-send-email-sshukla@mvista.com> References: <1452778117-30178-1-git-send-email-sshukla@mvista.com> To: dev@dpdk.org Return-path: Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by dpdk.org (Postfix) with ESMTP id 4486491C1 for ; Thu, 14 Jan 2016 14:29:18 +0100 (CET) Received: by mail-pa0-f49.google.com with SMTP id cy9so377138504pac.0 for ; Thu, 14 Jan 2016 05:29:18 -0800 (PST) In-Reply-To: <1452778117-30178-1-git-send-email-sshukla@mvista.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" For non-x86 arch, Compiler will throw build error for in/out apis. Including dummy api function so to pass build. Note that: For virtio to work for non-x86 arch - RTE_EAL_VFIO is the only supported method. RTE_EAL_IGB_UIO is not supported for non-x86 arch. So, Virtio support for arch and supported interface by that arch: ARCH IGB_UIO VFIO x86 Y Y ARM64 N/A Y PPC_64 N/A Y (Not tested but likely should work, as vfio is arch independent) Signed-off-by: Santosh Shukla --- v4: - dummy inb/outb function useful for non-x86 archs, Intent to get-rid of build error. drivers/net/virtio/virtio_pci.h | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 8526c07..600260a 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -239,6 +239,48 @@ outl_p(unsigned int data, unsigned int port) } #endif +#if !defined(RTE_ARCH_X86_64) && !defined(RTE_ARCH_I686) && \ + defined(RTE_EXEC_ENV_LINUXAPP) +static inline uint8_t inb(unsigned long addr __rte_unused) +{ + PMD_INIT_LOG(ERR, "inb() not supported for this RTE_ARCH\n"); + return 0; +} + +static inline uint16_t inw(unsigned long addr __rte_unused) +{ + PMD_INIT_LOG(ERR, "inw() not supported for this RTE_ARCH\n"); + return 0; +} + +static inline uint32_t inl(unsigned long addr __rte_unused) +{ + PMD_INIT_LOG(ERR, "in() not supported for this RTE_ARCH\n"); + return 0; +} + +static inline void +outb_p(unsigned char data __rte_unused, unsigned int port __rte_unused) +{ + PMD_INIT_LOG(ERR, "outb_p() not supported for this RTE_ARCH\n"); + return; +} + +static inline void +outw_p(unsigned short data __rte_unused, unsigned int port __rte_unused) +{ + PMD_INIT_LOG(ERR, "outw_p() not supported for this RTE_ARCH\n"); + return; +} + +static inline void +outl_p(unsigned int data __rte_unused, unsigned int port __rte_unused) +{ + PMD_INIT_LOG(ERR, "outl_p() not supported for this RTE_ARCH\n"); + return; +} +#endif + #define VIRTIO_PCI_REG_ADDR(hw, reg) \ (unsigned short)((hw)->io_base + (reg)) -- 1.7.9.5