From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6881D62E6; Sat, 30 Mar 2019 18:22:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 30 Mar 2019 18:22:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=2olmQWO/dQoy1BuwbBrPvgrr5uLwcoeInNU6/vR4eE8=; b=lyK9rIgYz1Eu +jR1oj6J6AQZIlqSc5J6EgB8ujIEKAYEfGz8RzOpdCkkEtYYN8zhXmhDtmsAsZj3 dG5ZP9g+n2OT7ProDkDfSkgxCHpKSrlG9I9UNElT4i8gKwBzKG4Hpp9GIImYfElO 6sM/ct8w4eQ/vxAlFh9dNUJQplvWR0M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=2olmQWO/dQoy1BuwbBrPvgrr5uLwcoeInNU6/vR4e E8=; b=LiUSTHOj505aToFzF0cIvQYIR1YeLUNnLvEEIosq/DG1vMVhaUjlFffNO liT6xv/eOzmkQqqn1y2WSK/dOX/7il8uddqTwrX0q//5m3nAAdFacwIrPF49H7E1 Kquah8+PHnxDVx6655cQ2P2rv+dwad4FMta6IjE5oUV401BbeFcYJ/tlgTyz1DGl wTpE+c7KDg6HsQcl8ja+dY6KPzo/6XsPCpKOQHvUIfyvj4B/LZWUe4PtHhK+aMu0 diP/flaLeMaiz4DVMO3yQcFpW2+KoXdSXBYS0m5Q+FrcCCCP4UTerEpdm1nJThNr 5wKcx0/JIAIMJgZ4B53ORO1FwSmfQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeelgdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2D24F10311; Sat, 30 Mar 2019 18:22:29 -0400 (EDT) From: Thomas Monjalon To: Natanael Copa Cc: dev@dpdk.org Date: Sat, 30 Mar 2019 23:22:27 +0100 Message-ID: <5813741.aTzT6Pizmj@xps> In-Reply-To: <20190313170657.16688-4-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-4-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 03/15] bus/pci: add fallback for out[lwb]_p for non GNU libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Mar 2019 22:22:31 -0000 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 7BB80A05D3 for ; Sat, 30 Mar 2019 23:22:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 47AF32C5E; Sat, 30 Mar 2019 23:22:33 +0100 (CET) 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 6881D62E6; Sat, 30 Mar 2019 18:22:30 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 30 Mar 2019 18:22:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=2olmQWO/dQoy1BuwbBrPvgrr5uLwcoeInNU6/vR4eE8=; b=lyK9rIgYz1Eu +jR1oj6J6AQZIlqSc5J6EgB8ujIEKAYEfGz8RzOpdCkkEtYYN8zhXmhDtmsAsZj3 dG5ZP9g+n2OT7ProDkDfSkgxCHpKSrlG9I9UNElT4i8gKwBzKG4Hpp9GIImYfElO 6sM/ct8w4eQ/vxAlFh9dNUJQplvWR0M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=2olmQWO/dQoy1BuwbBrPvgrr5uLwcoeInNU6/vR4e E8=; b=LiUSTHOj505aToFzF0cIvQYIR1YeLUNnLvEEIosq/DG1vMVhaUjlFffNO liT6xv/eOzmkQqqn1y2WSK/dOX/7il8uddqTwrX0q//5m3nAAdFacwIrPF49H7E1 Kquah8+PHnxDVx6655cQ2P2rv+dwad4FMta6IjE5oUV401BbeFcYJ/tlgTyz1DGl wTpE+c7KDg6HsQcl8ja+dY6KPzo/6XsPCpKOQHvUIfyvj4B/LZWUe4PtHhK+aMu0 diP/flaLeMaiz4DVMO3yQcFpW2+KoXdSXBYS0m5Q+FrcCCCP4UTerEpdm1nJThNr 5wKcx0/JIAIMJgZ4B53ORO1FwSmfQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeelgdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2D24F10311; Sat, 30 Mar 2019 18:22:29 -0400 (EDT) From: Thomas Monjalon To: Natanael Copa Cc: dev@dpdk.org Date: Sat, 30 Mar 2019 23:22:27 +0100 Message-ID: <5813741.aTzT6Pizmj@xps> In-Reply-To: <20190313170657.16688-4-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-4-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 03/15] bus/pci: add fallback for out[lwb]_p for non GNU libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190330222227.ijBcxZQE88U4mU_gLEZW8a-Y5c7zLW9g_agS2uWpyVg@z> 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