985d36cc2712cc03a1420e585a1fa8bd56413868
[dpdk.git] / lib / librte_eal / common / eal_common_mcfg.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4
5 #include <rte_config.h>
6 #include <rte_eal_memconfig.h>
7
8 void
9 rte_mcfg_mem_read_lock(void)
10 {
11         struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
12         rte_rwlock_read_lock(&mcfg->memory_hotplug_lock);
13 }
14
15 void
16 rte_mcfg_mem_read_unlock(void)
17 {
18         struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
19         rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
20 }
21
22 void
23 rte_mcfg_mem_write_lock(void)
24 {
25         struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
26         rte_rwlock_write_lock(&mcfg->memory_hotplug_lock);
27 }
28
29 void
30 rte_mcfg_mem_write_unlock(void)
31 {
32         struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
33         rte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);
34 }