|
Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
Tests for spinlock. More...
Functions | |
| void | test_spinlock_basic (void) |
| Test basic spinlock. | |
| void | test_spinlock_bounce (void) |
| Test spinlock with bounce. | |
| void | test_spinlock_mutual_exclusion (void) |
| Test basic mutual exclusion using interrupt masking. | |
| void | test_trylock (void) |
| Test k_spin_trylock() | |
| void | test_spinlock_no_recursive (void) |
| Test spinlock cannot be recursive. | |
| void | test_spinlock_unlock_error (void) |
| Test unlocking incorrect spinlock. | |
| void | test_spinlock_release_error (void) |
| Test unlocking incorrect spinlock. | |
| void | test_spinlock_lock_time_limit (void) |
| Test unlocking spinlock held over the time limit. | |
| void | test_spinlock_fairness (void) |
| Test spinlock acquisition fairness. | |
Tests for spinlock.
| void test_spinlock_basic | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/main.c>
Test basic spinlock.
| void test_spinlock_bounce | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/main.c>
Test spinlock with bounce.
| void test_spinlock_fairness | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/spinlock_fairness.c>
Test spinlock acquisition fairness.
This test verifies a spinlock acquisition fairness in relation to the cores contending for the spinlock. Memory access latency may vary between the CPU cores, so that some CPUs reach the spinlock faster than the others and depending on spinlock implementation may get higher chance to win the contention for the spinlock than the other cores, making them to starve. This effect may become critical for some real-life platforms (e.g. NUMA) resulting in performance loss or even a live-lock, when a single CPU is continuously winning the contention. This test ensures that the probability to win the contention for a spinlock is evenly distributed between all of the contending cores.
| void test_spinlock_lock_time_limit | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking spinlock held over the time limit.
Validate unlocking spinlock held past the time limit will trigger assertion.
| void test_spinlock_mutual_exclusion | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/main.c>
Test basic mutual exclusion using interrupt masking.
| void test_spinlock_no_recursive | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/spinlock_error_case.c>
Test spinlock cannot be recursive.
Validate using spinlock recursive will trigger assertion.
| void test_spinlock_release_error | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking incorrect spinlock.
Validate unlocking incorrect spinlock will trigger assertion.
| void test_spinlock_unlock_error | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/spinlock_error_case.c>
Test unlocking incorrect spinlock.
Validate unlocking incorrect spinlock will trigger assertion.
| void test_trylock | ( | void | ) |
#include </home/runner/work/safety-doc/zephyr/tests/kernel/spinlock/src/main.c>
Test k_spin_trylock()