/Zephyr-latest/kernel/ |
D | mem_slab.c | 30 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-latest/tests/bluetooth/audio/mocks/src/ |
D | mem_slab.c | 10 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-latest/subsys/demand_paging/backing_store/ |
D | ram.c | 70 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-latest/subsys/net/lib/shell/ |
D | mem.c | 23 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() 163 PR("%p\tOK \t%u\t%llu\t\t%llu\n", stats->slab, stats->ok.count, in cmd_net_mem() [all …]
|
D | pkt.c | 13 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()
|
D | allocs.c | 45 net_pkt_slab2str(pkt->slab), in allocs_cb() 49 pkt, str, net_pkt_slab2str(pkt->slab), in allocs_cb()
|
/Zephyr-latest/doc/kernel/memory_management/ |
D | slabs.rst | 6 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-latest/drivers/usb/udc/ |
D | Kconfig.kinetis | 13 int "Number or blocks in event slab" 18 Number of blocks in slab for internal endpoint events.
|
D | Kconfig.mcux | 25 int "Number or blocks in event slab" 30 Number of blocks in slab for internal controller events.
|
/Zephyr-latest/tests/kernel/mem_slab/mslab_threadsafe/src/ |
D | test_mslab_threadsafe.c | 44 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-latest/include/zephyr/tracing/ |
D | tracking.h | 91 #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
|
D | tracing.h | 1830 #define sys_port_trace_k_mem_slab_init(slab, rc) argument 1837 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) argument 1844 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument 1852 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) argument 1858 #define sys_port_trace_k_mem_slab_free_enter(slab) argument 1864 #define sys_port_trace_k_mem_slab_free_exit(slab) argument
|
/Zephyr-latest/subsys/tracing/test/ |
D | tracing_string_format_test.c | 482 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 484 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_enter() 487 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 489 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_blocking() 492 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 495 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_alloc_exit() 498 void sys_trace_k_mem_slab_free_enter(struct k_mem_slab *slab, void *mem) in sys_trace_k_mem_slab_free_enter() argument 500 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_free_enter() 503 void sys_trace_k_mem_slab_free_exit(struct k_mem_slab *slab, void *mem) in sys_trace_k_mem_slab_free_exit() argument 505 TRACING_STRING("%s: %p\n", __func__, slab); in sys_trace_k_mem_slab_free_exit()
|
D | tracing_test.h | 414 #define sys_port_trace_k_mem_slab_init(slab, rc) \ argument 415 sys_trace_k_mem_slab_init(slab, buffer, block_size, num_blocks, rc) 416 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) \ argument 417 sys_trace_k_mem_slab_alloc_enter(slab, mem, timeout) 418 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) \ argument 419 sys_trace_k_mem_slab_alloc_blocking(slab, mem, timeout) 420 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) \ argument 421 sys_trace_k_mem_slab_alloc_exit(slab, mem, timeout, ret) 422 #define sys_port_trace_k_mem_slab_free_enter(slab) argument 423 #define sys_port_trace_k_mem_slab_free_exit(slab) sys_trace_k_mem_slab_free_exit(slab, mem) argument [all …]
|
/Zephyr-latest/subsys/net/ip/ |
D | net_pkt.c | 279 const char *net_pkt_slab2str(struct k_mem_slab *slab) in net_pkt_slab2str() argument 281 if (slab == &rx_pkts) { in net_pkt_slab2str() 283 } else if (slab == &tx_pkts) { in net_pkt_slab2str() 365 static inline const char *slab2str(struct k_mem_slab *slab) in slab2str() argument 367 return net_pkt_slab2str(slab); in slab2str() 451 if (pkt->slab == &rx_pkts) { in net_pkt_get_frag_debug() 560 slab2str(pkt->slab), k_mem_slab_num_free_get(pkt->slab), 616 k_mem_slab_free(pkt->slab, (void *)pkt); 641 slab2str(pkt->slab), k_mem_slab_num_free_get(pkt->slab), 870 static struct net_pkt_alloc_stats_slab *find_alloc_stats(struct k_mem_slab *slab) argument [all …]
|
/Zephyr-latest/tests/kernel/obj_tracking/src/ |
D | main.c | 33 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-latest/subsys/tracing/ |
D | tracing_tracking.c | 68 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-latest/subsys/bluetooth/mesh/ |
D | adv.c | 138 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-latest/tests/drivers/i2s/i2s_api/src/ |
D | common.c | 109 struct k_mem_slab *slab) in tx_block_write_slab() argument 131 struct k_mem_slab *slab) in rx_block_read_slab() argument
|
/Zephyr-latest/subsys/tracing/sysview/ |
D | tracing_sysview.h | 606 #define sys_port_trace_k_mem_slab_init(slab, rc) \ argument 607 SEGGER_SYSVIEW_RecordU32(TID_MSLAB_INIT, (uint32_t)(uintptr_t)slab) 609 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) \ argument 610 SEGGER_SYSVIEW_RecordU32x2(TID_MSLAB_ALLOC, (uint32_t)(uintptr_t)slab, \ 613 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument 614 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) \ argument 617 #define sys_port_trace_k_mem_slab_free_enter(slab) \ argument 618 SEGGER_SYSVIEW_RecordU32(TID_MSLAB_FREE, (uint32_t)(uintptr_t)slab) 620 #define sys_port_trace_k_mem_slab_free_exit(slab) SEGGER_SYSVIEW_RecordEndCall(TID_MSLAB_ALLOC) argument
|
D | SYSVIEW_Zephyr.txt | 89 84 k_mem_slab_init slab=%I, buffer=%p, bock_size=%u, num_blocks=%u | Returns ErrCodePos… 90 85 k_mem_slab_alloc slab=%I, mem=%p, Timeout=%TimeOut | Returns %ErrCodePosix 91 86 k_mem_slab_free slab=%I, mem=%p
|
/Zephyr-latest/drivers/audio/ |
D | Kconfig.dmic_mcux | 21 reserve for the DMA engine. The memory slab used with the DMIC
|
/Zephyr-latest/include/zephyr/ |
D | kernel.h | 5320 int k_mem_slab_init(struct k_mem_slab *slab, void *buffer, 5345 int k_mem_slab_alloc(struct k_mem_slab *slab, void **mem, 5357 void k_mem_slab_free(struct k_mem_slab *slab, void *mem); 5369 static inline uint32_t k_mem_slab_num_used_get(struct k_mem_slab *slab) in k_mem_slab_num_used_get() argument 5371 return slab->info.num_used; in k_mem_slab_num_used_get() 5384 static inline uint32_t k_mem_slab_max_used_get(struct k_mem_slab *slab) in k_mem_slab_max_used_get() argument 5387 return slab->info.max_used; in k_mem_slab_max_used_get() 5389 ARG_UNUSED(slab); in k_mem_slab_max_used_get() 5404 static inline uint32_t k_mem_slab_num_free_get(struct k_mem_slab *slab) in k_mem_slab_num_free_get() argument 5406 return slab->info.num_blocks - slab->info.num_used; in k_mem_slab_num_free_get() [all …]
|
/Zephyr-latest/subsys/tracing/user/ |
D | tracing_user.h | 363 #define sys_port_trace_k_mem_slab_init(slab, rc) argument 364 #define sys_port_trace_k_mem_slab_alloc_enter(slab, timeout) argument 365 #define sys_port_trace_k_mem_slab_alloc_blocking(slab, timeout) argument 366 #define sys_port_trace_k_mem_slab_alloc_exit(slab, timeout, ret) argument 367 #define sys_port_trace_k_mem_slab_free_enter(slab) argument 368 #define sys_port_trace_k_mem_slab_free_exit(slab) argument
|
/Zephyr-latest/subsys/portability/cmsis_rtos_v2/ |
D | Kconfig | 73 int "Maximum mem slab count in CMSIS RTOS V2 application" 80 int "Maximum dynamic mem slab/pool size in CMSIS RTOS V2 application"
|