99
1010#include <kernel.h>
1111#include <misc/mempool_base.h>
12+ #include <misc/mutex.h>
1213
1314struct sys_mem_pool {
1415 struct sys_mem_pool_base base ;
15- struct k_mutex * mutex ;
16+ struct sys_mutex mutex ;
1617};
1718
1819struct sys_mem_pool_block {
@@ -38,16 +39,15 @@ struct sys_mem_pool_block {
3839 * run sys_mem_pool_init() on it before using any other APIs.
3940 *
4041 * @param name Name of the memory pool.
41- * @param kmutex Pointer to an initialized k_mutex object, used for
42- * synchronization, declared with K_MUTEX_DEFINE().
42+ * @param ignored ignored, any value
4343 * @param minsz Size of the smallest blocks in the pool (in bytes).
4444 * @param maxsz Size of the largest blocks in the pool (in bytes).
4545 * @param nmax Number of maximum sized blocks in the pool.
4646 * @param align Alignment of the pool's buffer (power of 2).
4747 * @param section Destination binary section for pool data
4848 */
49- #define SYS_MEM_POOL_DEFINE (name , kmutex , minsz , maxsz , nmax , align , section ) \
50- char __aligned(align) Z_GENERIC_SECTION(section) \
49+ #define SYS_MEM_POOL_DEFINE (name , ignored , minsz , maxsz , nmax , align , section ) \
50+ char __aligned(align) Z_GENERIC_SECTION(section) \
5151 _mpool_buf_##name[_ALIGN4(maxsz * nmax) \
5252 + _MPOOL_BITS_SIZE(maxsz, minsz, nmax)]; \
5353 struct sys_mem_pool_lvl Z_GENERIC_SECTION(section) \
@@ -60,8 +60,7 @@ struct sys_mem_pool_block {
6060 .n_levels = Z_MPOOL_LVLS(maxsz, minsz), \
6161 .levels = _mpool_lvls_##name, \
6262 .flags = SYS_MEM_POOL_USER \
63- }, \
64- .mutex = kmutex, \
63+ } \
6564 }
6665
6766/**
0 commit comments