From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 03/15] bus/pci: add fallback for out[lwb]_p for non GNU libc Date: Sat, 30 Mar 2019 23:22:27 +0100 Message-ID: <5813741.aTzT6Pizmj@xps> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-4-ncopa@alpinelinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Natanael Copa Return-path: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 84CE62965 for ; Sat, 30 Mar 2019 23:22:31 +0100 (CET) In-Reply-To: <20190313170657.16688-4-ncopa@alpinelinux.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 13/03/2019 18:06, Natanael Copa: > Add a fallback for non-GNU libc systems like musl libc for the > non-standard functions outl_p, outw_p and outb_p. > > This ifixes the following buildtime errors when building with musl libc: > pci_uio.c:(.text+0xaa1): undefined reference to `outw_p' > pci_uio.c:(.text+0xac5): undefined reference to `outl_p' > pci_uio.c:(.text+0xadf): undefined reference to `outb_p' > > fixes https://bugs.dpdk.org/show_bug.cgi?id=35 Please use this syntax: Bugzilla ID: 35 [...] > #if defined(RTE_ARCH_X86) > #include > +#if defined(__GLIBC__) > +#define pci_uio_outl_p outl_p > +#define pci_uio_outw_p outw_p > +#define pci_uio_outb_p outb_p > +#else > +static inline void > +pci_uio_outl_p(unsigned int value, unsigned short int port) > +{ > + __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80" : : "a" (value), > + "Nd" (port)); > +} > + > +static inline void > +pci_uio_outw_p(unsigned short int value, unsigned short int port) > +{ > + __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80" : : "a" (value), > + "Nd" (port)); > +} > + > +static inline void > +pci_uio_outb_p(unsigned char value, unsigned short int port) > +{ > + __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value), > + "Nd" (port)); > +} > +#endif > #endif [...] > #if defined(RTE_ARCH_X86) > - outl_p(*(const uint32_t *)s, reg); > + pci_uio_outl_p(*(const uint32_t *)s, reg); > #else > *(volatile uint32_t *)reg = *(const uint32_t *)s; > #endif Could we manage non-x86 case in the macros pci_uio_out? Thanks