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 0A02811A4 for ; Sat, 30 Mar 2019 23:25:48 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D8C0562EF; Sat, 30 Mar 2019 18:25:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 30 Mar 2019 18:25:47 -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=HF1f/n1oz3UqOV30/bmwqjvNPMJ78CIbNplWyUk5oAE=; b=YeqCkNbertqW OgTPNSlNZp/BKfLtWWOb/FOZhDQSppyS58V/zrt0oe3moUcl6E2gb/eQQ6eczCqv /GKlV1W+Uiik05tLDxmGpGc6Y7J/I6EgiO+gITCNGGcJFxbTjQZXbY0alp+G+O2e C5Y6juuSqCItSlbIlOfrJSz5x50BciA= 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=HF1f/n1oz3UqOV30/bmwqjvNPMJ78CIbNplWyUk5o AE=; b=sYd1y1QbCg7BhymnEhQbOLudZ03WXrXv2CCjftjp6gluNzPaPiNT0bMLR pfgqklP3R9oc+hvEu1dEz7wpmVIJBFIVFFw8/kOe1dBn+F1i7DmWdy4D+J4jexRp J83u4XpEDOPGn8/xvMNpfd/WowPRGTZwdMZz1IOCDv8EXPFtQ+YrNhhu8d29lGo9 OqHQeXYxGO3HQ5o+KBwSWPqNEQ1ecyg7nAkogJNE8sVoxQXuvRdtYJdP2qsKAf++ Ans9OS53kSOQIS38zOqjd81Ve2vq8IGfLlQMW4/RTieL53/NSHl6fJMtbtCDAqPu +yywzi631zQGz/4NoPTRU7EuLZjjA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeelgdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgepud 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 3C1B3E442F; Sat, 30 Mar 2019 18:25:45 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Natanael Copa , gaetan.rivet@6wind.com, ferruh.yigit@intel.com Date: Sat, 30 Mar 2019 23:25:44 +0100 Message-ID: <2391415.SPZlMYUle4@xps> In-Reply-To: <20190313170657.16688-5-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-5-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 04/15] bus/pci: factor out various ifdefs in pci_uio_ioport_{read, write} 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:25:48 -0000 13/03/2019 18:06, Natanael Copa: > define the macros so we can remove various #if defined(RTE_ARCH_X86) > > Ref: https://bugs.dpdk.org/show_bug.cgi?id=35#c6 > > Signed-off-by: Natanael Copa > --- > drivers/bus/pci/linux/pci_uio.c | 54 +++++++++++++++------------------ > 1 file changed, 24 insertions(+), 30 deletions(-) > > diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c > index e1dd8c875..b0470358d 100644 > --- a/drivers/bus/pci/linux/pci_uio.c > +++ b/drivers/bus/pci/linux/pci_uio.c > @@ -14,11 +14,18 @@ > > #if defined(RTE_ARCH_X86) > #include > + > +#define pci_uio_inl(reg) inl(reg) > +#define pci_uio_inw(reg) inw(reg) > +#define pci_uio_inb(reg) inb(reg) > + > #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 > + > +#else /* defined(__GLIBC__) */ > static inline void > pci_uio_outl_p(unsigned int value, unsigned short int port) > { > @@ -39,8 +46,19 @@ 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 > +#endif /* defined(__GLIBC__) */ > + > +#else /* RTE_ARCH_X86 */ > + > +#define pci_uio_inl(reg) (*(volatile uint32_t *)(reg)) > +#define pci_uio_inw(reg) (*(volatile uint16_t *)(reg)) > +#define pci_uio_inb(reg) (*(volatile uint8_t *)(reg)) > + > +#define pci_uio_outl_p(value, reg) (*(volatile uint32_t *)(reg) = (value)) > +#define pci_uio_outw_p(value, reg) (*(volatile uint16_t *)(reg) = (value)) > +#define pci_uio_outb_p(value, reg) (*(volatile uint8_t *)(reg) = (value)) > + > +#endif /* RTE_ARCH_X86 */ I think I would prefer having the #ifdef inside the macros, instead of redefining the macros. 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 D293BA05D3 for ; Sat, 30 Mar 2019 23:25:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4550D1DB8; Sat, 30 Mar 2019 23:25:49 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by dpdk.org (Postfix) with ESMTP id 0A02811A4 for ; Sat, 30 Mar 2019 23:25:48 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D8C0562EF; Sat, 30 Mar 2019 18:25:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 30 Mar 2019 18:25:47 -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=HF1f/n1oz3UqOV30/bmwqjvNPMJ78CIbNplWyUk5oAE=; b=YeqCkNbertqW OgTPNSlNZp/BKfLtWWOb/FOZhDQSppyS58V/zrt0oe3moUcl6E2gb/eQQ6eczCqv /GKlV1W+Uiik05tLDxmGpGc6Y7J/I6EgiO+gITCNGGcJFxbTjQZXbY0alp+G+O2e C5Y6juuSqCItSlbIlOfrJSz5x50BciA= 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=HF1f/n1oz3UqOV30/bmwqjvNPMJ78CIbNplWyUk5o AE=; b=sYd1y1QbCg7BhymnEhQbOLudZ03WXrXv2CCjftjp6gluNzPaPiNT0bMLR pfgqklP3R9oc+hvEu1dEz7wpmVIJBFIVFFw8/kOe1dBn+F1i7DmWdy4D+J4jexRp J83u4XpEDOPGn8/xvMNpfd/WowPRGTZwdMZz1IOCDv8EXPFtQ+YrNhhu8d29lGo9 OqHQeXYxGO3HQ5o+KBwSWPqNEQ1ecyg7nAkogJNE8sVoxQXuvRdtYJdP2qsKAf++ Ans9OS53kSOQIS38zOqjd81Ve2vq8IGfLlQMW4/RTieL53/NSHl6fJMtbtCDAqPu +yywzi631zQGz/4NoPTRU7EuLZjjA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrkeelgdduiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuff homhgrihhnpeguphgukhdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeegnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtne cuvehluhhsthgvrhfuihiivgepud 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 3C1B3E442F; Sat, 30 Mar 2019 18:25:45 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Natanael Copa , gaetan.rivet@6wind.com, ferruh.yigit@intel.com Date: Sat, 30 Mar 2019 23:25:44 +0100 Message-ID: <2391415.SPZlMYUle4@xps> In-Reply-To: <20190313170657.16688-5-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> <20190313170657.16688-5-ncopa@alpinelinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3 04/15] bus/pci: factor out various ifdefs in pci_uio_ioport_{read, write} 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: <20190330222544.e-PktVDhPwDZVLNQCWF4BS1VSPTnDPSs0FIJCYcbBus@z> 13/03/2019 18:06, Natanael Copa: > define the macros so we can remove various #if defined(RTE_ARCH_X86) > > Ref: https://bugs.dpdk.org/show_bug.cgi?id=35#c6 > > Signed-off-by: Natanael Copa > --- > drivers/bus/pci/linux/pci_uio.c | 54 +++++++++++++++------------------ > 1 file changed, 24 insertions(+), 30 deletions(-) > > diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c > index e1dd8c875..b0470358d 100644 > --- a/drivers/bus/pci/linux/pci_uio.c > +++ b/drivers/bus/pci/linux/pci_uio.c > @@ -14,11 +14,18 @@ > > #if defined(RTE_ARCH_X86) > #include > + > +#define pci_uio_inl(reg) inl(reg) > +#define pci_uio_inw(reg) inw(reg) > +#define pci_uio_inb(reg) inb(reg) > + > #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 > + > +#else /* defined(__GLIBC__) */ > static inline void > pci_uio_outl_p(unsigned int value, unsigned short int port) > { > @@ -39,8 +46,19 @@ 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 > +#endif /* defined(__GLIBC__) */ > + > +#else /* RTE_ARCH_X86 */ > + > +#define pci_uio_inl(reg) (*(volatile uint32_t *)(reg)) > +#define pci_uio_inw(reg) (*(volatile uint16_t *)(reg)) > +#define pci_uio_inb(reg) (*(volatile uint8_t *)(reg)) > + > +#define pci_uio_outl_p(value, reg) (*(volatile uint32_t *)(reg) = (value)) > +#define pci_uio_outw_p(value, reg) (*(volatile uint16_t *)(reg) = (value)) > +#define pci_uio_outb_p(value, reg) (*(volatile uint8_t *)(reg) = (value)) > + > +#endif /* RTE_ARCH_X86 */ I think I would prefer having the #ifdef inside the macros, instead of redefining the macros.