Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/kernel.h>
#include <zephyr/irq_offload.h>
#include <zephyr/ztest.h>
#include <limits.h>
Macros | |
#define | MSGQ_LEN (2) |
#define | STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | NUM_SERVICES 2 |
#define | TIMEOUT K_MSEC(100) |
Enumerations | |
enum | message_info { QUERRY_SERVICE = 1 , REGISTER_SERVICE1 , REGISTER_SERVICE2 , GET_SERVICE , SERVICE1_RUNNING , SERVICE2_RUNNING , SERVICE_QUIT } |
Functions | |
K_MSGQ_DEFINE (manager_q, sizeof(unsigned long) *2, 4, 4) | |
K_THREAD_STACK_DEFINE (service_manager_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_DEFINE (service1_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_DEFINE (service2_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_DEFINE (client_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_SEM_DEFINE (service_sema, 2, 2) | |
K_SEM_DEFINE (service_started, 0, 2) | |
K_SEM_DEFINE (test_continue, 0, 1) | |
static void | service_manager_entry (void *p1, void *p2, void *p3) |
static void | start_service_manager (void) |
static void | service1_entry (void *p1, void *p2, void *p3) |
static void | service2_entry (void *p1, void *p2, void *p3) |
static void | register_service (void) |
static void | client_entry (void *p1, void *p2, void *p3) |
static void | start_client (void) |
ZTEST (msgq_usage, test_msgq_usage) | |
ZTEST_SUITE (msgq_usage, NULL, NULL, NULL, NULL, NULL) | |
Variables | |
struct k_msgq | service1_msgq |
struct k_msgq | service2_msgq |
struct k_msgq | client_msgq |
struct k_thread | service_manager |
struct k_thread | service1 |
struct k_thread | service2 |
struct k_thread | client_thread |
static ZTEST_DMEM unsigned long | service1_buf [(2)] |
static ZTEST_DMEM unsigned long | service2_buf [(2)] |
static ZTEST_DMEM unsigned long | client_buf [(2) *2] |
static ZTEST_DMEM struct k_msgq * | services [2] |
static ZTEST_DMEM struct k_msgq * | pclient |
static ZTEST_DMEM bool | service1_run |
static ZTEST_DMEM bool | service2_run |
static ZTEST_DMEM k_tid_t | tservice_manager |
static ZTEST_DMEM k_tid_t | tservice1 |
static ZTEST_DMEM k_tid_t | tservice2 |
static ZTEST_DMEM k_tid_t | tclient |
#define MSGQ_LEN (2) |
#define NUM_SERVICES 2 |
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define TIMEOUT K_MSEC(100) |
enum message_info |
|
static |
K_SEM_DEFINE | ( | service_sema | , |
2 | , | ||
2 | |||
) |
K_SEM_DEFINE | ( | service_started | , |
0 | , | ||
2 | |||
) |
K_SEM_DEFINE | ( | test_continue | , |
0 | , | ||
1 | |||
) |
K_THREAD_STACK_DEFINE | ( | client_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | service1_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | service2_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | service_manager_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
ZTEST | ( | msgq_usage | , |
test_msgq_usage | |||
) |
ZTEST_SUITE | ( | msgq_usage | , |
NULL | , | ||
NULL | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
|
static |
struct k_msgq client_msgq |
struct k_thread client_thread |
|
static |
struct k_thread service1 |
|
static |
struct k_msgq service1_msgq |
|
static |
struct k_thread service2 |
|
static |
struct k_msgq service2_msgq |
|
static |
struct k_thread service_manager |
|
static |
|
static |
|
static |
|
static |
|
static |