|
Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
Macros | |
| #define | SEM_INIT_VAL (0U) |
| #define | SEM_MAX_VAL (10U) |
| #define | SEM_TIMEOUT (K_MSEC(100)) |
| #define | STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define | TOTAL_THREADS_WAITING (3) |
Functions | |
| ZTEST_DMEM | SYS_SEM_DEFINE (multiple_thread_sem,(0U),(10U)) |
| K_THREAD_STACK_DEFINE (stack_1,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
| K_THREAD_STACK_DEFINE (stack_2,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
| K_THREAD_STACK_DEFINE (stack_3,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
| K_THREAD_STACK_ARRAY_DEFINE (multiple_stack,(3),(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
| static void | isr_sem_give (const void *semaphore) |
| static void | isr_sem_take (const void *semaphore) |
| static void | sem_give_from_isr (void *semaphore) |
| static void | sem_take_from_isr (void *semaphore) |
| static void | sem_give_task (void *p1, void *p2, void *p3) |
| static void | sem_take_timeout_forever_helper (void *p1, void *p2, void *p3) |
| static void | sem_take_timeout_isr_helper (void *p1, void *p2, void *p3) |
| static void | sem_take_multiple_low_prio_helper (void *p1, void *p2, void *p3) |
| static void | sem_take_multiple_mid_prio_helper (void *p1, void *p2, void *p3) |
| static void | sem_take_multiple_high_prio_helper (void *p1, void *p2, void *p3) |
| static void | sem_multiple_threads_wait_helper (void *p1, void *p2, void *p3) |
| void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf) |
| Fatal error policy handler. | |
| void * | sys_sem_setup (void) |
| ZTEST_SUITE (sys_sem, NULL, sys_sem_setup, NULL, NULL, NULL) | |
| ZTEST_SUITE (sys_sem_1cpu, NULL, sys_sem_setup, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL) | |
| ZTEST (sys_sem, test_basic_sem_test) | |
| ZTEST (sys_sem, test_simple_sem_from_isr) | |
| Test semaphore count when given by an ISR. | |
| ZTEST_USER (sys_sem, test_simple_sem_from_task) | |
| Test semaphore count when given by thread. | |
| ZTEST_USER (sys_sem, test_sem_take_no_wait) | |
| Test if sys_sem_take() decreases semaphore count. | |
| ZTEST_USER (sys_sem, test_sem_take_no_wait_fails) | |
| Test sys_sem_take() when there is no semaphore to take. | |
| ZTEST_USER (sys_sem_1cpu, test_sem_take_timeout_fails) | |
| Test sys_sem_take() with timeout expiry. | |
| ZTEST_USER (sys_sem, test_sem_take_timeout) | |
| Test sys_sem_take() with timeout. | |
| ZTEST_USER (sys_sem_1cpu, test_sem_take_timeout_forever) | |
| Test sys_sem_take() with forever timeout. | |
| ZTEST (sys_sem_1cpu, test_sem_take_timeout_isr) | |
| Test sys_sem_take() with timeout in ISR context. | |
| ZTEST_USER (sys_sem_1cpu, test_sem_take_multiple) | |
| Test multiple semaphore take. | |
| ZTEST (sys_sem, test_sem_give_take_from_isr) | |
| Test semaphore give and take and its count from ISR. | |
| ZTEST_USER (sys_sem, test_sem_give_limit) | |
| Test semaphore give limit count. | |
| ZTEST_USER (sys_sem_1cpu, test_sem_multiple_threads_wait) | |
| Test multiple semaphore take and give with wait. | |
Variables | |
| ZTEST_BMEM struct sys_sem | simple_sem |
| ZTEST_BMEM struct sys_sem | low_prio_sem |
| ZTEST_BMEM struct sys_sem | mid_prio_sem |
| ZTEST_DMEM struct sys_sem | high_prio_sem |
| struct k_thread sem_tid sem_tid_1 | sem_tid_2 |
| struct k_thread | multiple_tid [(3)] |
| #define SEM_INIT_VAL (0U) |
| #define SEM_MAX_VAL (10U) |
| #define SEM_TIMEOUT (K_MSEC(100)) |
| #define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
| #define TOTAL_THREADS_WAITING (3) |
|
static |
|
static |
| K_THREAD_STACK_ARRAY_DEFINE | ( | multiple_stack | , |
| (3) | , | ||
| (512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
| ) |
| K_THREAD_STACK_DEFINE | ( | stack_1 | , |
| (512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
| ) |
| K_THREAD_STACK_DEFINE | ( | stack_2 | , |
| (512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
| ) |
| K_THREAD_STACK_DEFINE | ( | stack_3 | , |
| (512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| ZTEST_DMEM SYS_SEM_DEFINE | ( | multiple_thread_sem | , |
| (0U) | , | ||
| (10U) | |||
| ) |
| void * sys_sem_setup | ( | void | ) |
| ZTEST | ( | sys_sem | , |
| test_basic_sem_test | |||
| ) |
| ZTEST | ( | sys_sem | , |
| test_sem_give_take_from_isr | |||
| ) |
Test semaphore give and take and its count from ISR.
| ZTEST | ( | sys_sem | , |
| test_simple_sem_from_isr | |||
| ) |
Test semaphore count when given by an ISR.
| ZTEST | ( | sys_sem_1cpu | , |
| test_sem_take_timeout_isr | |||
| ) |
Test sys_sem_take() with timeout in ISR context.
| ZTEST_SUITE | ( | sys_sem | , |
| NULL | , | ||
| sys_sem_setup | , | ||
| NULL | , | ||
| NULL | , | ||
| NULL | |||
| ) |
| ZTEST_SUITE | ( | sys_sem_1cpu | , |
| NULL | , | ||
| sys_sem_setup | , | ||
| ztest_simple_1cpu_before | , | ||
| ztest_simple_1cpu_after | , | ||
| NULL | |||
| ) |
| ZTEST_USER | ( | sys_sem | , |
| test_sem_give_limit | |||
| ) |
Test semaphore give limit count.
| ZTEST_USER | ( | sys_sem | , |
| test_sem_take_no_wait | |||
| ) |
Test if sys_sem_take() decreases semaphore count.
| ZTEST_USER | ( | sys_sem | , |
| test_sem_take_no_wait_fails | |||
| ) |
Test sys_sem_take() when there is no semaphore to take.
| ZTEST_USER | ( | sys_sem | , |
| test_sem_take_timeout | |||
| ) |
Test sys_sem_take() with timeout.
| ZTEST_USER | ( | sys_sem | , |
| test_simple_sem_from_task | |||
| ) |
Test semaphore count when given by thread.
| ZTEST_USER | ( | sys_sem_1cpu | , |
| test_sem_multiple_threads_wait | |||
| ) |
Test multiple semaphore take and give with wait.
| ZTEST_USER | ( | sys_sem_1cpu | , |
| test_sem_take_multiple | |||
| ) |
Test multiple semaphore take.
| ZTEST_USER | ( | sys_sem_1cpu | , |
| test_sem_take_timeout_fails | |||
| ) |
Test sys_sem_take() with timeout expiry.
| ZTEST_USER | ( | sys_sem_1cpu | , |
| test_sem_take_timeout_forever | |||
| ) |
Test sys_sem_take() with forever timeout.
| ZTEST_DMEM struct sys_sem high_prio_sem |
| ZTEST_BMEM struct sys_sem low_prio_sem |
| ZTEST_BMEM struct sys_sem mid_prio_sem |
| struct k_thread multiple_tid[(3)] |
| struct k_thread sem_tid sem_tid_1 sem_tid_2 |
| ZTEST_BMEM struct sys_sem simple_sem |