patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl
@ 2021-05-28  9:21 Thomas Monjalon
  2021-05-31 11:32 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2021-05-28  9:21 UTC (permalink / raw)
  To: stable; +Cc: xuemingl, Natanael Copa, Andrew Rybchenko, David Marchand

[ upstream commit 204a7f44bc457b2c75c9eeb56468214664c830f0 ]

Add a fallback for non-GNU libc systems like musl libc for the
non-standard functions outl_p, outw_p and outb_p.

It solves the following errors when building with musl libc:
	pci_uio.c: undefined reference to 'outw_p'
	pci_uio.c: undefined reference to 'outl_p'
	pci_uio.c: undefined reference to 'outb_p'

Bugzilla ID: 35
Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")
Cc: stable@dpdk.org

Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/pci/linux/pci_uio.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c
index f3305a2f28..624b2e2ecf 100644
--- a/drivers/bus/pci/linux/pci_uio.c
+++ b/drivers/bus/pci/linux/pci_uio.c
@@ -535,21 +535,33 @@ pci_uio_ioport_write(struct rte_pci_ioport *p,
 		if (len >= 4) {
 			size = 4;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outl_p(*(const uint32_t *)s, reg);
+#else
+			outl(*(const uint32_t *)s, reg);
+#endif
 #else
 			*(volatile uint32_t *)reg = *(const uint32_t *)s;
 #endif
 		} else if (len >= 2) {
 			size = 2;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outw_p(*(const uint16_t *)s, reg);
+#else
+			outw(*(const uint16_t *)s, reg);
+#endif
 #else
 			*(volatile uint16_t *)reg = *(const uint16_t *)s;
 #endif
 		} else {
 			size = 1;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outb_p(*s, reg);
+#else
+			outb(*s, reg);
+#endif
 #else
 			*(volatile uint8_t *)reg = *s;
 #endif
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-31 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  9:21 [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl Thomas Monjalon
2021-05-31 11:32 ` Xueming(Steven) Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).