eal: move thread affinity functions to new file
[dpdk.git] / lib / librte_eal / include / rte_thread.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2021 Mellanox Technologies, Ltd
3  */
4
5 #include <rte_os.h>
6
7 #ifndef _RTE_THREAD_H_
8 #define _RTE_THREAD_H_
9
10 /**
11  * @file
12  *
13  * Threading functions
14  *
15  * Simple threads functionality supplied by EAL.
16  */
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 /**
23  * Set core affinity of the current thread.
24  * Support both EAL and non-EAL thread and update TLS.
25  *
26  * @param cpusetp
27  *   Pointer to CPU affinity to set.
28  * @return
29  *   On success, return 0; otherwise return -1;
30  */
31 int rte_thread_set_affinity(rte_cpuset_t *cpusetp);
32
33 /**
34  * Get core affinity of the current thread.
35  *
36  * @param cpusetp
37  *   Pointer to CPU affinity of current thread.
38  *   It presumes input is not NULL, otherwise it causes panic.
39  *
40  */
41 void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif /* _RTE_THREAD_H_ */