From mboxrd@z Thu Jan 1 00:00:00 1970 From: Santosh Shukla Subject: [PATCH v5 10/11] virtio: pci: add dummy func definition for in/outb for non-x86 arch Date: Tue, 19 Jan 2016 17:16:11 +0530 Message-ID: <1453203972-24855-11-git-send-email-sshukla@mvista.com> References: <1453203972-24855-1-git-send-email-sshukla@mvista.com> To: dev@dpdk.org Return-path: Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) by dpdk.org (Postfix) with ESMTP id B1BED8E8F for ; Tue, 19 Jan 2016 12:47:07 +0100 (CET) Received: by mail-pf0-f179.google.com with SMTP id e65so174780935pfe.0 for ; Tue, 19 Jan 2016 03:47:07 -0800 (PST) In-Reply-To: <1453203972-24855-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) Note: Applicable for virtio spec 0.95 Signed-off-by: Santosh Shukla --- drivers/net/virtio/virtio_pci.h | 46 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index f550d22..b88f9ec 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -46,6 +46,7 @@ #endif #include +#include "virtio_logs.h" struct virtqueue; @@ -320,6 +321,51 @@ 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 + static inline int vtpci_with_feature(struct virtio_hw *hw, uint64_t bit) { -- 1.7.9.5