Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/irq_offload.h>
#include <zephyr/kernel_structs.h>
Macros | |
#define | NUM_THREADS ARRAY_SIZE(worker_priorities) |
#define | STACK_SIZE (640 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | PRI(n) (worker_priorities[n]) |
Enumerations | |
enum | { METAIRQ , COOP , PREEMPTIBLE } |
Functions | |
K_THREAD_STACK_DEFINE (manager_stack,(640+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_ARRAY_DEFINE (worker_stacks, ARRAY_SIZE(worker_priorities),(640+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_SEM_DEFINE (main_sem, 0, 1) | |
void | wakeup_src_thread (int id) |
void | manager (void *p1, void *p2, void *p3) |
void | irq_waker (const void *p) |
void | validate_wakeup (int src, int target, k_tid_t last_thread) |
void | worker (void *p1, void *p2, void *p3) |
ZTEST (suite_preempt, test_preempt) | |
Test preemption. | |
ZTEST_SUITE (suite_preempt, NULL, NULL, NULL, NULL, NULL) | |
Variables | |
enum { ... } | worker_priorities [] |
k_tid_t | last_wakeup_thread |
struct k_thread | manager_thread |
struct k_thread | worker_threads [ARRAY_SIZE(worker_priorities)] |
struct k_sem | worker_sems [ARRAY_SIZE(worker_priorities)] |
int | wakeup_target |
volatile int | do_lock |
volatile int | do_irq |
volatile int | do_sleep |
volatile int | do_yield |
#define NUM_THREADS ARRAY_SIZE(worker_priorities) |
#define PRI | ( | n | ) | (worker_priorities[n]) |
#define STACK_SIZE (640 + CONFIG_TEST_EXTRA_STACK_SIZE) |
void irq_waker | ( | const void * | p | ) |
K_SEM_DEFINE | ( | main_sem | , |
0 | , | ||
1 | |||
) |
K_THREAD_STACK_ARRAY_DEFINE | ( | worker_stacks | , |
ARRAY_SIZE(worker_priorities) | , | ||
(640+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | manager_stack | , |
(640+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
void manager | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void validate_wakeup | ( | int | src, |
int | target, | ||
k_tid_t | last_thread | ||
) |
void wakeup_src_thread | ( | int | id | ) |
void worker | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
ZTEST_SUITE | ( | suite_preempt | , |
NULL | , | ||
NULL | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
volatile int do_irq |
volatile int do_lock |
volatile int do_sleep |
volatile int do_yield |
k_tid_t last_wakeup_thread |
struct k_thread manager_thread |
int wakeup_target |
enum { ... } worker_priorities[] |
struct k_sem worker_sems[ARRAY_SIZE(worker_priorities)] |
struct k_thread worker_threads[ARRAY_SIZE(worker_priorities)] |