mem: quiet base address hint warning if not requested
[dpdk.git] / lib / eal / freebsd / include / rte_os.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2019 Intel Corporation
3  */
4
5 #ifndef _RTE_OS_H_
6 #define _RTE_OS_H_
7
8 /**
9  * This header should contain any definition
10  * which is not supported natively or named differently in FreeBSD.
11  */
12
13 #include <pthread_np.h>
14 #include <sys/queue.h>
15
16 /* These macros are compatible with system's sys/queue.h. */
17 #define RTE_TAILQ_HEAD(name, type) TAILQ_HEAD(name, type)
18 #define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type)
19 #define RTE_TAILQ_FOREACH(var, head, field) TAILQ_FOREACH(var, head, field)
20 #define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head)
21 #define RTE_TAILQ_NEXT(elem, field) TAILQ_NEXT(elem, field)
22 #define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type)
23 #define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type)
24
25 typedef cpuset_t rte_cpuset_t;
26 #define RTE_HAS_CPUSET
27 #define RTE_CPU_AND(dst, src1, src2) do \
28 { \
29         cpuset_t tmp; \
30         CPU_COPY(src1, &tmp); \
31         CPU_AND(&tmp, src2); \
32         CPU_COPY(&tmp, dst); \
33 } while (0)
34 #define RTE_CPU_OR(dst, src1, src2) do \
35 { \
36         cpuset_t tmp; \
37         CPU_COPY(src1, &tmp); \
38         CPU_OR(&tmp, src2); \
39         CPU_COPY(&tmp, dst); \
40 } while (0)
41 #define RTE_CPU_FILL(set) CPU_FILL(set)
42
43 /* In FreeBSD 13 CPU_NAND macro is CPU_ANDNOT */
44 #ifdef CPU_NAND
45 #define RTE_CPU_NOT(dst, src) do \
46 { \
47         cpuset_t tmp; \
48         CPU_FILL(&tmp); \
49         CPU_NAND(&tmp, src); \
50         CPU_COPY(&tmp, dst); \
51 } while (0)
52 #else
53 #define RTE_CPU_NOT(dst, src) do \
54 { \
55         cpuset_t tmp; \
56         CPU_FILL(&tmp); \
57         CPU_ANDNOT(&tmp, src); \
58         CPU_COPY(&tmp, dst); \
59 } while (0)
60 #endif
61
62 #endif /* _RTE_OS_H_ */