Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>
Data Structures | |
struct | thread_data |
Macros | |
#define | INIT_COOP_PRIO -2 |
#define | INIT_COOP_STACK_SIZE (500 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | INIT_COOP_P1 ((void *)0xFFFF0000) |
#define | INIT_COOP_P2 ((void *)0xCDEF) |
#define | INIT_COOP_P3_static ((void *)&static_coop_start_sema) |
#define | INIT_COOP_P3 ((void *)&coop_start_sema) |
#define | INIT_COOP_OPTION (K_USER | K_INHERIT_PERMS) |
#define | INIT_COOP_DELAY 2000 |
#define | INIT_PREEMPT_PRIO 1 |
#define | INIT_PREEMPT_STACK_SIZE (499 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | INIT_PREEMPT_P1 ((void *)5) |
#define | INIT_PREEMPT_P2 ((void *)6) |
#define | INIT_PREEMPT_P3_static ((void *)&static_preem_start_sema) |
#define | INIT_PREEMPT_P3 ((void *)&preem_start_sema) |
#define | INIT_PREEMPT_OPTION (K_USER | K_INHERIT_PERMS) |
#define | INIT_PREEMPT_DELAY 0 |
Functions | |
K_SEM_DEFINE (static_preem_start_sema, 0, 1) | |
K_SEM_DEFINE (preem_start_sema, 0, 1) | |
K_SEM_DEFINE (static_coop_start_sema, 0, 1) | |
K_SEM_DEFINE (coop_start_sema, 0, 1) | |
K_SEM_DEFINE (end_sema, 0, 1) | |
static void | thread_entry (void *p1, void *p2, void *p3) |
K_THREAD_DEFINE (T_KDEFINE_COOP_THREAD,(500+CONFIG_TEST_EXTRA_STACK_SIZE), thread_entry,((void *) 0xFFFF0000),((void *) 0xCDEF),((void *)&static_coop_start_sema), -2,(K_USER|K_INHERIT_PERMS), 2000) | |
K_THREAD_DEFINE (T_KDEFINE_PREEMPT_THREAD,(499+CONFIG_TEST_EXTRA_STACK_SIZE), thread_entry,((void *) 5),((void *) 6),((void *)&static_preem_start_sema), 1,(K_USER|K_INHERIT_PERMS), 0) | |
K_THREAD_ACCESS_GRANT (T_KDEFINE_COOP_THREAD, &static_preem_start_sema, &preem_start_sema, &static_coop_start_sema, &coop_start_sema, &end_sema) | |
K_THREAD_ACCESS_GRANT (T_KDEFINE_PREEMPT_THREAD, &static_preem_start_sema, &preem_start_sema, &static_coop_start_sema, &coop_start_sema, &end_sema) | |
static | K_THREAD_STACK_DEFINE (stack_coop,(500+CONFIG_TEST_EXTRA_STACK_SIZE)) |
static | K_THREAD_STACK_DEFINE (stack_preempt,(499+CONFIG_TEST_EXTRA_STACK_SIZE)) |
ZTEST_USER (thread_init, test_kdefine_preempt_thread) | |
test preempt thread initialization via K_THREAD_DEFINE | |
ZTEST_USER (thread_init, test_kdefine_coop_thread) | |
test coop thread initialization via K_THREAD_DEFINE | |
ZTEST_USER (thread_init, test_kinit_preempt_thread) | |
test preempt thread initialization via k_thread_create | |
ZTEST (thread_init, test_kinit_coop_thread) | |
test coop thread initialization via k_thread_create | |
void * | thread_init_setup (void) |
ZTEST_SUITE (thread_init, NULL, thread_init_setup, NULL, NULL, NULL) | |
Variables | |
static struct k_thread | thread_coop |
static struct k_thread | thread_preempt |
static ZTEST_BMEM uint64_t | t_create |
static ZTEST_BMEM struct thread_data | expected |
#define INIT_COOP_DELAY 2000 |
#define INIT_COOP_OPTION (K_USER | K_INHERIT_PERMS) |
#define INIT_COOP_P1 ((void *)0xFFFF0000) |
#define INIT_COOP_P2 ((void *)0xCDEF) |
#define INIT_COOP_P3 ((void *)&coop_start_sema) |
#define INIT_COOP_P3_static ((void *)&static_coop_start_sema) |
#define INIT_COOP_PRIO -2 |
#define INIT_COOP_STACK_SIZE (500 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define INIT_PREEMPT_DELAY 0 |
#define INIT_PREEMPT_OPTION (K_USER | K_INHERIT_PERMS) |
#define INIT_PREEMPT_P1 ((void *)5) |
#define INIT_PREEMPT_P2 ((void *)6) |
#define INIT_PREEMPT_P3 ((void *)&preem_start_sema) |
#define INIT_PREEMPT_P3_static ((void *)&static_preem_start_sema) |
#define INIT_PREEMPT_PRIO 1 |
#define INIT_PREEMPT_STACK_SIZE (499 + CONFIG_TEST_EXTRA_STACK_SIZE) |
K_SEM_DEFINE | ( | coop_start_sema | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | end_sema | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | preem_start_sema | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | static_coop_start_sema | , |
0 | , | ||
1 | |||
) |
K_SEM_DEFINE | ( | static_preem_start_sema | , |
0 | , | ||
1 | |||
) |
K_THREAD_ACCESS_GRANT | ( | T_KDEFINE_COOP_THREAD | , |
& | static_preem_start_sema, | ||
& | preem_start_sema, | ||
& | static_coop_start_sema, | ||
& | coop_start_sema, | ||
& | end_sema | ||
) |
K_THREAD_ACCESS_GRANT | ( | T_KDEFINE_PREEMPT_THREAD | , |
& | static_preem_start_sema, | ||
& | preem_start_sema, | ||
& | static_coop_start_sema, | ||
& | coop_start_sema, | ||
& | end_sema | ||
) |
K_THREAD_DEFINE | ( | T_KDEFINE_COOP_THREAD | , |
(500+CONFIG_TEST_EXTRA_STACK_SIZE) | , | ||
thread_entry | , | ||
((void *) 0xFFFF0000) | , | ||
((void *) 0xCDEF) | , | ||
((void *)&static_coop_start_sema) | , | ||
- | 2, | ||
(K_USER|K_INHERIT_PERMS) | , | ||
2000 | |||
) |
K_THREAD_DEFINE | ( | T_KDEFINE_PREEMPT_THREAD | , |
(499+CONFIG_TEST_EXTRA_STACK_SIZE) | , | ||
thread_entry | , | ||
((void *) 5) | , | ||
((void *) 6) | , | ||
((void *)&static_preem_start_sema) | , | ||
1 | , | ||
(K_USER|K_INHERIT_PERMS) | , | ||
0 | |||
) |
|
static |
|
static |
|
static |
TESTPOINT: check delay start
TESTPOINT: check priority and params
void * thread_init_setup | ( | void | ) |
ZTEST_SUITE | ( | thread_init | , |
NULL | , | ||
thread_init_setup | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
|
static |
|
static |
|
static |
|
static |