Skip to content

Commit 19b7eaa

Browse files
Flavio Ceolinnashif
Flavio Ceolin
authored andcommitted
misc: mempool: Fix bit mask value
SYS_MEM_POOL_KERNEL and SYS_MEM_POOL_USER are used by k_mem_pool flags and should be defined as a bit mask. It was defined as zero failing in all places checking for this bit. e.g pool_irq_lock and pool_irq_unlock were not working correctly because the check for this flag was always returning false. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 8f7990d commit 19b7eaa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/misc/mempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct sys_mem_pool_block {
5959
.n_max = nmax, \
6060
.n_levels = _MPOOL_LVLS(maxsz, minsz), \
6161
.levels = _mpool_lvls_##name, \
62-
.flags = SYS_MEM_POOL_KERNEL \
62+
.flags = SYS_MEM_POOL_USER \
6363
}, \
6464
.mutex = kmutex, \
6565
}

include/misc/mempool_base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ struct sys_mem_pool_lvl {
2323
sys_dlist_t free_list;
2424
};
2525

26-
#define SYS_MEM_POOL_KERNEL 0
27-
#define SYS_MEM_POOL_USER 1
26+
#define SYS_MEM_POOL_KERNEL BIT(0)
27+
#define SYS_MEM_POOL_USER BIT(1)
2828

2929
struct sys_mem_pool_base {
3030
void *buf;

0 commit comments

Comments
 (0)