Use kernel headers for __le* types to avoid potential conflicts
resulting in redefinition errors for some Linux build environments.
Add check for FreeBSD execution environments.
Without this fix, aarch64 builds can fail with error below:
In file included from ../drivers/net/bnx2x/bnx2x.h:22,
from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
../drivers/net/bnx2x/bnx2x_osal.h:27:17: error:
conflicting types for ‘uint64_t’
#define __le64 uint64_t
^~~~~~~~
In file included from /usr/include/stdint.h:37,
from /usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9,
from ../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16,
from ../drivers/net/bnx2x/bnx2x.h:17,
from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
/usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note:
previous declaration of ‘uint64_t’ was here
typedef __uint64_t uint64_t;
^~~~~~~~
There is also one minor change mixed in this commit:
Some use of __FreeBSD__ are replaced by RTE_EXEC_ENV_FREEBSD.
Fixes: 38dff79ba7 ("net/bnx2x: update HSI")
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: Gavin Hu <gavin.hu@arm.com>