eal: make OS shims internal
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Sat, 10 Apr 2021 22:47:30 +0000 (01:47 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 14 Apr 2021 23:56:20 +0000 (01:56 +0200)
commit45d62067c23746f9fd4eafc26099d8df859f318a
tree78c9a8993b3914abfd9e4971ccdbd4b83f9c10c2
parent9ec521006db0f6e99e483657c06db15cd7bc0ad4
eal: make OS shims internal

DPDK code often relies on functions and macros that are not standard C,
but are found on all platforms, even if by slightly different names.
Windows <rte_os.h> provided macros or inline definitions for such symbols.
However, when placed in public header, these symbols were unnecessarily
exposed, breaking consumer POSIX compatibility code.

Move most of the shims to <rte_os_shim.h>, a header to be used instead
of <rte_os.h> by internal code. Include it in libraries and PMDs that
previously imported shims from <rte_os.h>. Directly replace shims that
were only used inside EAL:
* index -> strchr, rindex -> strrchr
* sleep -> rte_delay_us_sleep
* strerror_r -> strerror_s

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
23 files changed:
drivers/bus/pci/private.h
drivers/bus/vdev/vdev_private.h
drivers/common/mlx5/mlx5_common.h
drivers/net/i40e/i40e_ethdev.c
lib/librte_cmdline/cmdline.c
lib/librte_cmdline/cmdline_os_windows.c
lib/librte_cmdline/cmdline_private.h
lib/librte_cmdline/cmdline_socket.c
lib/librte_eal/common/eal_common_config.c
lib/librte_eal/common/eal_common_errno.c
lib/librte_eal/common/eal_common_log.c
lib/librte_eal/common/eal_common_options.c
lib/librte_eal/common/eal_common_timer.c
lib/librte_eal/common/eal_internal_cfg.h
lib/librte_eal/freebsd/include/rte_os_shim.h [new file with mode: 0644]
lib/librte_eal/linux/include/rte_os_shim.h [new file with mode: 0644]
lib/librte_eal/windows/eal_hugepages.c
lib/librte_eal/windows/eal_lcore.c
lib/librte_eal/windows/eal_memalloc.c
lib/librte_eal/windows/include/rte_os.h
lib/librte_eal/windows/include/rte_os_shim.h [new file with mode: 0644]
lib/librte_ethdev/ethdev_private.h
lib/librte_kvargs/rte_kvargs.c