xref: /freebsd/sys/contrib/dpdk_rte_lpm/rte_shim.h (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1 #ifndef	_RTE_SHIM_H_
2 #define	_RTE_SHIM_H_
3 
4 #define	rte_malloc(_type, _size, _align)	malloc(_size, M_TEMP, M_NOWAIT)
5 #define	rte_free(_ptr)				free(_ptr, M_TEMP)
6 #define	rte_zmalloc(_type, _size, _align)	malloc(_size, M_TEMP, M_NOWAIT | M_ZERO)
7 #define	rte_zmalloc_socket(_type, _size, _align, _s)	malloc(_size, M_TEMP, M_NOWAIT | M_ZERO)
8 
9 #define	rte_mcfg_tailq_write_unlock()
10 #define	rte_mcfg_tailq_write_lock()
11 
12 #define	RTE_CACHE_LINE_SIZE	CACHE_LINE_SIZE
13 #define strtoull		strtoul
14 #define	assert(_s)		KASSERT((_s), ("DPDK: assert failed"))
15 #define	rte_memcpy		memcpy
16 #define	rte_strerror(_err)	"strerror_not_implemented"
17 #define	RTE_LOG(_sev, _sub, _fmt, ...)	printf("DPDK::" #_sev "::" #_sub " %s: " _fmt, __func__ , ## __VA_ARGS__)
18 
19 #include "sys/endian.h"
20 #define	RTE_BYTE_ORDER	BYTE_ORDER
21 #define	RTE_LITTLE_ENDIAN	LITTLE_ENDIAN
22 #define	RTE_BIG_ENDIAN		BIG_ENDIAN
23 
24 #include "sys/limits.h" // CHAR_BIT
25 #define	rte_le_to_cpu_32	le32toh
26 
27 #include "rte_jhash.h"
28 #include "rte_common.h"
29 
30 
31 #endif
32