diff --git a/fs/procfs/fs_procfs.c b/fs/procfs/fs_procfs.c index 41ecc05a04..76be822222 100644 --- a/fs/procfs/fs_procfs.c +++ b/fs/procfs/fs_procfs.c @@ -114,7 +114,7 @@ static const struct procfs_entry_s g_procfs_entries[] = # endif #endif -#if defined(CONFIG_MM_MEMPOOL) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) +#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL { "mempool", &mempool_operations, PROCFS_FILE_TYPE }, #endif diff --git a/include/nuttx/mm/mempool.h b/include/nuttx/mm/mempool.h index e06db286ad..e42610a597 100644 --- a/include/nuttx/mm/mempool.h +++ b/include/nuttx/mm/mempool.h @@ -42,7 +42,7 @@ typedef CODE void *(*mempool_alloc_t)(FAR struct mempool_s *pool, typedef CODE void (*mempool_free_t)(FAR struct mempool_s *pool, FAR void *addr); -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) struct mempool_procfs_entry_s { FAR const char *name; @@ -70,7 +70,7 @@ struct mempool_s size_t nused; /* The number of used block in mempool */ spinlock_t lock; /* The protect lock to mempool */ sem_t waitsem; /* The semaphore of waiter get free block */ -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) struct mempool_procfs_entry_s procfs; /* The entry of procfs */ #endif }; @@ -195,7 +195,7 @@ int mempool_deinit(FAR struct mempool_s *pool); * ****************************************************************************/ -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) void mempool_procfs_register(FAR struct mempool_procfs_entry_s *entry, FAR const char *name); #endif @@ -211,7 +211,7 @@ void mempool_procfs_register(FAR struct mempool_procfs_entry_s *entry, * ****************************************************************************/ -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) void mempool_procfs_unregister(FAR struct mempool_procfs_entry_s *entry); #endif diff --git a/mm/Kconfig b/mm/Kconfig index 2c3281016e..414018532a 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -165,13 +165,6 @@ config MM_SHM Build in support for the shared memory interfaces shmget(), shmat(), shmctl(), and shmdt(). -config MM_MEMPOOL - bool "Enable memory buffer pool" - default n - ---help--- - Memory buffer pool support. Such pools are mostly used - for guaranteed, deadlock-free memory allocations. - config FS_PROCFS_EXCLUDE_MEMPOOL bool "Exclude mempool" default DEFAULT_SMALL diff --git a/mm/mempool/Make.defs b/mm/mempool/Make.defs index 7dd172b7d2..565b4b1cd0 100644 --- a/mm/mempool/Make.defs +++ b/mm/mempool/Make.defs @@ -20,22 +20,15 @@ # Memory buffer pool management -ifeq ($(CONFIG_MM_MEMPOOL),y) - CSRCS += mempool.c mempool_multiple.c ifeq ($(CONFIG_FS_PROCFS),y) - ifneq ($(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL),y) - CSRCS += mempool_procfs.c - endif - endif # Add the memory buffer pool directory to the build DEPPATH += --dep-path mempool VPATH += :mempool -endif diff --git a/mm/mempool/mempool.c b/mm/mempool/mempool.c index 5df30fae14..6d359e3ff6 100644 --- a/mm/mempool/mempool.c +++ b/mm/mempool/mempool.c @@ -125,7 +125,7 @@ int mempool_init(FAR struct mempool_s *pool, FAR const char *name) nxsem_init(&pool->waitsem, 0, 0); } -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) mempool_procfs_register(&pool->procfs, name); #endif @@ -323,7 +323,7 @@ int mempool_deinit(FAR struct mempool_s *pool) return -EBUSY; } -#ifndef CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL +#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MEMPOOL) mempool_procfs_unregister(&pool->procfs); #endif