Home
last modified time | relevance | path

Searched refs:slab (Results 1 – 25 of 44) sorted by relevance

12

/Zephyr-Core-3.7.0/kernel/
Dmem_slab.c30 struct k_mem_slab *slab; in k_mem_slab_stats_raw() local
33 slab = CONTAINER_OF(obj_core, struct k_mem_slab, obj_core); in k_mem_slab_stats_raw()
34 key = k_spin_lock(&slab->lock); in k_mem_slab_stats_raw()
35 memcpy(stats, &slab->info, sizeof(slab->info)); in k_mem_slab_stats_raw()
36 k_spin_unlock(&slab->lock, key); in k_mem_slab_stats_raw()
45 struct k_mem_slab *slab; in k_mem_slab_stats_query() local
49 slab = CONTAINER_OF(obj_core, struct k_mem_slab, obj_core); in k_mem_slab_stats_query()
50 key = k_spin_lock(&slab->lock); in k_mem_slab_stats_query()
51 ptr->free_bytes = (slab->info.num_blocks - slab->info.num_used) * in k_mem_slab_stats_query()
52 slab->info.block_size; in k_mem_slab_stats_query()
[all …]
/Zephyr-Core-3.7.0/tests/bluetooth/audio/mocks/src/
Dmem_slab.c10 int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, k_timeout_t timeout) in k_mem_slab_alloc() argument
12 if (slab->info.num_used >= slab->info.num_blocks) { in k_mem_slab_alloc()
17 *mem = malloc(slab->info.block_size); in k_mem_slab_alloc()
20 slab->info.num_used++; in k_mem_slab_alloc()
24 void k_mem_slab_free(struct k_mem_slab *slab, void *mem) in k_mem_slab_free() argument
27 slab->info.num_used--; in k_mem_slab_free()
/Zephyr-Core-3.7.0/subsys/demand_paging/backing_store/
Dram.c70 static uintptr_t slab_to_location(void *slab) in slab_to_location() argument
72 char *pos = slab; in slab_to_location()
77 "bad slab pointer %p", slab); in slab_to_location()
80 "unaligned slab pointer %p", slab); in slab_to_location()
90 void *slab; in k_mem_paging_backing_store_location_get() local
96 ret = k_mem_slab_alloc(&backing_slabs, &slab, K_NO_WAIT); in k_mem_paging_backing_store_location_get()
101 *location = slab_to_location(slab); in k_mem_paging_backing_store_location_get()
109 void *slab = location_to_slab(location); in k_mem_paging_backing_store_location_free() local
111 k_mem_slab_free(&backing_slabs, slab); in k_mem_paging_backing_store_location_free()
/Zephyr-Core-3.7.0/subsys/net/lib/shell/
Dmem.c23 struct k_mem_slab *slab, in slab_pool_found_already() argument
29 if (slab) { in slab_pool_found_already()
30 if (info->tx_slabs[i] == slab) { in slab_pool_found_already()
50 struct k_mem_slab *slab; in context_info() local
58 slab = context->tx_slab(); in context_info()
60 if (slab_pool_found_already(info, slab, NULL)) { in context_info()
66 slab, slab->info.num_blocks, k_mem_slab_num_free_get(slab)); in context_info()
68 PR("%p\t%d\tETX\n", slab, slab->info.num_blocks); in context_info()
71 info->tx_slabs[info->pos] = slab; in context_info()
Dpkt.c13 static bool is_pkt_part_of_slab(const struct k_mem_slab *slab, const char *ptr) in is_pkt_part_of_slab() argument
15 size_t last_offset = (slab->info.num_blocks - 1) * slab->info.block_size; in is_pkt_part_of_slab()
19 if ((ptr < slab->buffer) || (ptr > slab->buffer + last_offset)) { in is_pkt_part_of_slab()
24 ptr_offset = ptr - slab->buffer; in is_pkt_part_of_slab()
25 if (ptr_offset % slab->info.block_size != 0) { in is_pkt_part_of_slab()
46 struct k_mem_slab *slab = context->tx_slab(); in check_context_pool() local
48 if (is_pkt_part_of_slab(slab, info->ptr)) { in check_context_pool()
Dallocs.c45 net_pkt_slab2str(pkt->slab), in allocs_cb()
49 pkt, str, net_pkt_slab2str(pkt->slab), in allocs_cb()
/Zephyr-Core-3.7.0/doc/kernel/memory_management/
Dslabs.rst6 A :dfn:`memory slab` is a kernel object that allows memory blocks
8 All memory blocks in a memory slab have a single fixed size,
20 memory slab is referenced by its memory address.
22 A memory slab has the following key properties:
30 * A **buffer** that provides the memory for the memory slab's blocks.
33 The memory slab's buffer must be aligned to an N-byte boundary, where
38 A memory slab must be initialized before it can be used. This marks all of
42 slab. When the thread finishes with a memory block,
43 it must release the block back to the memory slab so the block can be reused.
47 Any number of threads may wait on an empty memory slab simultaneously;
[all …]
/Zephyr-Core-3.7.0/drivers/usb/udc/
DKconfig.kinetis13 int "Number or blocks in event slab"
18 Number of blocks in slab for internal endpoint events.
/Zephyr-Core-3.7.0/tests/kernel/mem_slab/mslab_threadsafe/src/
Dtest_mslab_threadsafe.c44 struct k_mem_slab *slab = slabs[id % SLAB_NUM]; in tmslab_api() local
51 ret = k_mem_slab_alloc(slab, &block[i], TIMEOUT); in tmslab_api()
56 k_mem_slab_free(slab, block[i]); in tmslab_api()
/Zephyr-Core-3.7.0/include/zephyr/tracing/
Dtracking.h91 #define sys_port_track_k_mem_slab_init(slab, rc) \ argument
92 sys_track_k_mem_slab_init(slab)
102 void sys_track_k_mem_slab_init(struct k_mem_slab *slab);
145 #define sys_port_track_k_mem_slab_init(slab, rc) argument
Dtracing.h1793 #define sys_port_trace_k_mem_slab_init(slab, rc) argument
1800 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) argument
1807 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument
1815 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) argument
1821 #define sys_port_trace_k_mem_slab_free_enter(slab) argument
1827 #define sys_port_trace_k_mem_slab_free_exit(slab) argument
/Zephyr-Core-3.7.0/subsys/tracing/test/
Dtracing_string_format_test.c471 void sys_trace_k_mem_slab_alloc_enter(struct k_mem_slab *slab, void **mem, k_timeout_t timeout) in sys_trace_k_mem_slab_alloc_enter() argument
473 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_enter()
476 void sys_trace_k_mem_slab_alloc_blocking(struct k_mem_slab *slab, void **mem, k_timeout_t timeout) in sys_trace_k_mem_slab_alloc_blocking() argument
478 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_blocking()
481 void sys_trace_k_mem_slab_alloc_exit(struct k_mem_slab *slab, void **mem, k_timeout_t timeout, in sys_trace_k_mem_slab_alloc_exit() argument
484 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_exit()
487 void sys_trace_k_mem_slab_free_enter(struct k_mem_slab *slab, void *mem) in sys_trace_k_mem_slab_free_enter() argument
489 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_free_enter()
492 void sys_trace_k_mem_slab_free_exit(struct k_mem_slab *slab, void *mem) in sys_trace_k_mem_slab_free_exit() argument
494 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_free_exit()
Dtracing_test.h407 #define sys_port_trace_k_mem_slab_init(slab, rc) \ argument
408 sys_trace_k_mem_slab_init(slab, buffer, block_size, num_blocks, rc)
409 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) \ argument
410 sys_trace_k_mem_slab_alloc_enter(slab, mem, timeout)
411 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) \ argument
412 sys_trace_k_mem_slab_alloc_blocking(slab, mem, timeout)
413 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) \ argument
414 sys_trace_k_mem_slab_alloc_exit(slab, mem, timeout, ret)
415 #define sys_port_trace_k_mem_slab_free_enter(slab) argument
416 #define sys_port_trace_k_mem_slab_free_exit(slab) sys_trace_k_mem_slab_free_exit(slab, mem) argument
[all …]
/Zephyr-Core-3.7.0/subsys/net/ip/
Dnet_pkt.c268 const char *net_pkt_slab2str(struct k_mem_slab *slab) in net_pkt_slab2str() argument
270 if (slab == &rx_pkts) { in net_pkt_slab2str()
272 } else if (slab == &tx_pkts) { in net_pkt_slab2str()
354 static inline const char *slab2str(struct k_mem_slab *slab) in slab2str() argument
356 return net_pkt_slab2str(slab); in slab2str()
440 if (pkt->slab == &rx_pkts) { in net_pkt_get_frag_debug()
549 slab2str(pkt->slab), k_mem_slab_num_free_get(pkt->slab),
605 k_mem_slab_free(pkt->slab, (void *)pkt);
630 slab2str(pkt->slab), k_mem_slab_num_free_get(pkt->slab),
1176 pool = pkt->slab == &tx_pkts ? &tx_bufs : &rx_bufs;
[all …]
/Zephyr-Core-3.7.0/tests/kernel/obj_tracking/src/
Dmain.c33 struct k_mem_slab slab; in ZTEST() local
56 k_mem_slab_init(&slab, slab_buffer, 8, 4); in ZTEST()
60 if (list == &slab || list == &slab_s) { in ZTEST()
/Zephyr-Core-3.7.0/subsys/tracing/
Dtracing_tracking.c68 void sys_track_k_mem_slab_init(struct k_mem_slab *slab) in sys_track_k_mem_slab_init() argument
71 SYS_TRACK_LIST_PREPEND(_track_list_k_mem_slab, slab)); in sys_track_k_mem_slab_init()
/Zephyr-Core-3.7.0/subsys/bluetooth/mesh/
Dadv.c138 struct k_mem_slab *slab = &local_adv_pool; in bt_mesh_adv_unref() local
142 slab = &relay_adv_pool; in bt_mesh_adv_unref()
148 slab = &friend_adv_pool; in bt_mesh_adv_unref()
152 k_mem_slab_free(slab, (void *)adv); in bt_mesh_adv_unref()
/Zephyr-Core-3.7.0/subsys/tracing/user/
Dtracing_user.h309 #define sys_port_trace_k_mem_slab_init(slab, rc) argument
310 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) argument
311 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument
312 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) argument
313 #define sys_port_trace_k_mem_slab_free_enter(slab) argument
314 #define sys_port_trace_k_mem_slab_free_exit(slab) argument
/Zephyr-Core-3.7.0/subsys/tracing/sysview/
Dtracing_sysview.h588 #define sys_port_trace_k_mem_slab_init(slab, rc) \ argument
589 SEGGER_SYSVIEW_RecordU32(TID_MSLAB_INIT, (uint32_t)(uintptr_t)slab)
591 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) \ argument
592 SEGGER_SYSVIEW_RecordU32x2(TID_MSLAB_ALLOC, (uint32_t)(uintptr_t)slab, \
595 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument
596 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) \ argument
599 #define sys_port_trace_k_mem_slab_free_enter(slab) \ argument
600 SEGGER_SYSVIEW_RecordU32(TID_MSLAB_FREE, (uint32_t)(uintptr_t)slab)
602 #define sys_port_trace_k_mem_slab_free_exit(slab) SEGGER_SYSVIEW_RecordEndCall(TID_MSLAB_ALLOC) argument
DSYSVIEW_Zephyr.txt88 84 k_mem_slab_init slab=%I, buffer=%p, bock_size=%u, num_blocks=%u | Returns ErrCodePos…
89 85 k_mem_slab_alloc slab=%I, mem=%p, Timeout=%TimeOut | Returns %ErrCodePosix
90 86 k_mem_slab_free slab=%I, mem=%p
/Zephyr-Core-3.7.0/tests/drivers/i2s/i2s_api/src/
Dcommon.c109 struct k_mem_slab *slab) in tx_block_write_slab() argument
131 struct k_mem_slab *slab) in rx_block_read_slab() argument
/Zephyr-Core-3.7.0/include/zephyr/
Dkernel.h5272 int k_mem_slab_init(struct k_mem_slab *slab, void *buffer,
5297 int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem,
5309 void k_mem_slab_free(struct k_mem_slab *slab, void *mem);
5321 static inline uint32_t k_mem_slab_num_used_get(struct k_mem_slab *slab) in k_mem_slab_num_used_get() argument
5323 return slab->info.num_used; in k_mem_slab_num_used_get()
5336 static inline uint32_t k_mem_slab_max_used_get(struct k_mem_slab *slab) in k_mem_slab_max_used_get() argument
5339 return slab->info.max_used; in k_mem_slab_max_used_get()
5341 ARG_UNUSED(slab); in k_mem_slab_max_used_get()
5356 static inline uint32_t k_mem_slab_num_free_get(struct k_mem_slab *slab) in k_mem_slab_num_free_get() argument
5358 return slab->info.num_blocks - slab->info.num_used; in k_mem_slab_num_free_get()
[all …]
/Zephyr-Core-3.7.0/drivers/audio/
DKconfig.dmic_mcux20 reserve for the DMA engine. The memory slab used with the DMIC
/Zephyr-Core-3.7.0/subsys/tracing/ctf/
Dtracing_ctf.h319 #define sys_port_trace_k_mem_slab_init(slab, rc) argument
320 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) argument
321 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument
322 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) argument
323 #define sys_port_trace_k_mem_slab_free_enter(slab) argument
324 #define sys_port_trace_k_mem_slab_free_exit(slab) argument
/Zephyr-Core-3.7.0/subsys/portability/cmsis_rtos_v2/
DKconfig73 int "Maximum mem slab count in CMSIS RTOS V2 application"
80 int "Maximum dynamic mem slab/pool size in CMSIS RTOS V2 application"

12