1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
5 #include <rte_config.h>
6 #include <rte_eal_memconfig.h>
8 #include "eal_memcfg.h"
11 eal_mcfg_wait_complete(void)
13 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
15 /* wait until shared mem_config finish initialising */
16 while (mcfg->magic != RTE_MAGIC)
21 rte_mcfg_mem_read_lock(void)
23 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
24 rte_rwlock_read_lock(&mcfg->memory_hotplug_lock);
28 rte_mcfg_mem_read_unlock(void)
30 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
31 rte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);
35 rte_mcfg_mem_write_lock(void)
37 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
38 rte_rwlock_write_lock(&mcfg->memory_hotplug_lock);
42 rte_mcfg_mem_write_unlock(void)
44 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
45 rte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);
49 rte_mcfg_tailq_read_lock(void)
51 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
52 rte_rwlock_read_lock(&mcfg->qlock);
56 rte_mcfg_tailq_read_unlock(void)
58 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
59 rte_rwlock_read_unlock(&mcfg->qlock);
63 rte_mcfg_tailq_write_lock(void)
65 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
66 rte_rwlock_write_lock(&mcfg->qlock);
70 rte_mcfg_tailq_write_unlock(void)
72 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
73 rte_rwlock_write_unlock(&mcfg->qlock);
77 rte_mcfg_mempool_read_lock(void)
79 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
80 rte_rwlock_read_lock(&mcfg->mplock);
84 rte_mcfg_mempool_read_unlock(void)
86 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
87 rte_rwlock_read_unlock(&mcfg->mplock);
91 rte_mcfg_mempool_write_lock(void)
93 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
94 rte_rwlock_write_lock(&mcfg->mplock);
98 rte_mcfg_mempool_write_unlock(void)
100 struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
101 rte_rwlock_write_unlock(&mcfg->mplock);