eal: hide shared memory config
[dpdk.git] / lib / librte_eal / common / eal_common_mcfg.c
index 985d36c..337890a 100644 (file)
@@ -5,6 +5,8 @@
 #include <rte_config.h>
 #include <rte_eal_memconfig.h>
 
+#include "eal_memcfg.h"
+
 void
 rte_mcfg_mem_read_lock(void)
 {
@@ -32,3 +34,59 @@ rte_mcfg_mem_write_unlock(void)
        struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
        rte_rwlock_write_unlock(&mcfg->memory_hotplug_lock);
 }
+
+void
+rte_mcfg_tailq_read_lock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_read_lock(&mcfg->qlock);
+}
+
+void
+rte_mcfg_tailq_read_unlock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_read_unlock(&mcfg->qlock);
+}
+
+void
+rte_mcfg_tailq_write_lock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_write_lock(&mcfg->qlock);
+}
+
+void
+rte_mcfg_tailq_write_unlock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_write_unlock(&mcfg->qlock);
+}
+
+void
+rte_mcfg_mempool_read_lock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_read_lock(&mcfg->mplock);
+}
+
+void
+rte_mcfg_mempool_read_unlock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_read_unlock(&mcfg->mplock);
+}
+
+void
+rte_mcfg_mempool_write_lock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_write_lock(&mcfg->mplock);
+}
+
+void
+rte_mcfg_mempool_write_unlock(void)
+{
+       struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
+       rte_rwlock_write_unlock(&mcfg->mplock);
+}