Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Macros | |
#define | STACKSIZE (1024 + CONFIG_TEST_EXTRA_STACKSIZE) |
#define | NUMBLOCKS 4 |
Functions | |
void | test_slab_get_all_blocks (void **p) |
Get all blocks from the memory slab. More... | |
void | test_slab_free_all_blocks (void **p) |
Free all memory blocks. More... | |
K_SEM_DEFINE (SEM_HELPERDONE, 0, 1) | |
K_SEM_DEFINE (SEM_REGRESSDONE, 0, 1) | |
K_MEM_SLAB_DEFINE (map_lgblks, 1024, 4, 4) | |
void | helper_thread (void) |
Helper task. More... | |
void | test_mslab (void) |
Main task to test memory slab interfaces. More... | |
K_THREAD_DEFINE (HELPER,(1024+CONFIG_TEST_EXTRA_STACKSIZE), helper_thread, NULL, NULL, NULL, 7, 0, 0) | |
void | test_main (void) |
#define NUMBLOCKS 4 |
#define STACKSIZE (1024 + CONFIG_TEST_EXTRA_STACKSIZE) |
Helper task.
This routine gets all blocks from the memory slab. It uses semaphores SEM_REGRESDONE and SEM_HELPERDONE to synchronize between different parts of the test.
K_MEM_SLAB_DEFINE | ( | map_lgblks | , |
1024 | , | ||
4 | , | ||
4 | |||
) |
K_SEM_DEFINE | ( | SEM_HELPERDONE | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | SEM_REGRESSDONE | , |
0 | , | ||
1 | |||
) |
K_THREAD_DEFINE | ( | HELPER | , |
(1024+CONFIG_TEST_EXTRA_STACKSIZE) | , | ||
helper_thread | , | ||
NULL | , | ||
NULL | , | ||
NULL | , | ||
7 | , | ||
0 | , | ||
0 | |||
) |
Free all memory blocks.
This routine frees all memory blocks and also verifies that the number of blocks used are correct.
This routine tests the following:
k_mem_slab_free(&), k_mem_slab_num_used_get(&)
p | pointer to pointer of allocated blocks |
Get all blocks from the memory slab.
Get all blocks from the memory slab. It also tries to get one more block from the map after the map is empty to verify the error return code.
This routine tests the following:
k_mem_slab_alloc(), k_mem_slab_num_used_get()
p | pointer to pointer of allocated blocks |