eal: move common header files
[dpdk.git] / lib / librte_eal / linux / eal / 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 is header should contain any function/macro definition
10  * which are not supported natively or named differently in the
11  * linux OS. Functions will be added in future releases.
12  */
13
14 #include <sched.h>
15
16 typedef cpu_set_t rte_cpuset_t;
17 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
18 #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
19 #define RTE_CPU_FILL(set) do \
20 { \
21         unsigned int i; \
22         CPU_ZERO(set); \
23         for (i = 0; i < CPU_SETSIZE; i++) \
24                 CPU_SET(i, set); \
25 } while (0)
26 #define RTE_CPU_NOT(dst, src) do \
27 { \
28         cpu_set_t tmp; \
29         RTE_CPU_FILL(&tmp); \
30         CPU_XOR(dst, &tmp, src); \
31 } while (0)
32
33 #endif /* _RTE_OS_H_ */