Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/tc_util.h>
#include <zephyr/ztest.h>
#include <zephyr/kernel.h>
#include <ksched.h>
#include <ipi.h>
#include <zephyr/kernel_structs.h>
Macros | |
#define | STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | NUM_THREADS (CONFIG_MP_MAX_NUM_CPUS - 1) |
#define | DELAY_FOR_IPIS 200 |
Functions | |
static | K_THREAD_STACK_ARRAY_DEFINE (stack,(CONFIG_MP_MAX_NUM_CPUS - 1),(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) |
static | K_THREAD_STACK_DEFINE (alt_stack,(1024+CONFIG_TEST_EXTRA_STACK_SIZE)) |
static | K_SEM_DEFINE (sem, 0, 1) |
static void | clear_ipi_counts (void) |
static void | get_ipi_counts (uint32_t *set, size_t n_elem) |
static void | busy_thread_entry (void *p1, void *p2, void *p3) |
static bool | wait_until_busy_threads_ready (uint32_t id) |
static void | pending_thread_entry (void *p1, void *p2, void *p3) |
static void | alt_thread_create (int priority, const char *desc) |
uint32_t | busy_threads_create (int priority) |
void | busy_threads_priority_set (int priority, int delta) |
ZTEST (ipi, test_arch_sched_broadcast_ipi) | |
Verify that arch_sched_broadcast_ipi() broadcasts IPIs as expected. | |
ZTEST (ipi, test_low_thread_wakes_no_ipis) | |
Verify that waking a thread whose priority is lower than any other currently executing thread does not result in any IPIs being sent. | |
ZTEST (ipi, test_high_thread_wakes_some_ipis) | |
Verify that waking a thread whose priority is higher than all currently executing threads results in the proper IPIs being sent and processed. | |
ZTEST (ipi, test_thread_priority_set_lower) | |
Verify that lowering the priority of an active thread results in an IPI. | |
ZTEST (ipi, test_thread_coop_no_ipis) | |
static void * | ipi_tests_setup (void) |
static void | cleanup_threads (void *fixture) |
ZTEST_SUITE (ipi, NULL, ipi_tests_setup, NULL, cleanup_threads, NULL) | |
Variables | |
static struct k_thread | thread [(CONFIG_MP_MAX_NUM_CPUS - 1)] |
static struct k_thread | alt_thread |
static bool | alt_thread_created |
static uint32_t | ipi_count [CONFIG_MP_MAX_NUM_CPUS] |
static struct k_spinlock | ipilock |
static atomic_t | busy_started |
static volatile bool | alt_thread_done |
#define DELAY_FOR_IPIS 200 |
#define NUM_THREADS (CONFIG_MP_MAX_NUM_CPUS - 1) |
#define STACK_SIZE (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
|
static |
|
static |
uint32_t busy_threads_create | ( | int | priority | ) |
void busy_threads_priority_set | ( | int | priority, |
int | delta | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
ZTEST | ( | ipi | , |
test_arch_sched_broadcast_ipi | |||
) |
Verify that arch_sched_broadcast_ipi() broadcasts IPIs as expected.
ZTEST | ( | ipi | , |
test_high_thread_wakes_some_ipis | |||
) |
Verify that waking a thread whose priority is higher than all currently executing threads results in the proper IPIs being sent and processed.
ZTEST | ( | ipi | , |
test_low_thread_wakes_no_ipis | |||
) |
Verify that waking a thread whose priority is lower than any other currently executing thread does not result in any IPIs being sent.
ZTEST | ( | ipi | , |
test_thread_coop_no_ipis | |||
) |
ZTEST | ( | ipi | , |
test_thread_priority_set_lower | |||
) |
Verify that lowering the priority of an active thread results in an IPI.
If directed IPIs are enabled, then only the CPU executing that active thread ought to receive the IPI. Otherwise if IPIs are broadcast, then all other CPUs save the current CPU ought to receive IPIs.
ZTEST_SUITE | ( | ipi | , |
NULL | , | ||
ipi_tests_setup | , | ||
NULL | , | ||
cleanup_threads | , | ||
NULL | |||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |