Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#include <zephyr/ztest.h>
#include <zephyr/kernel.h>

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACK_SIZE)
 
#define MAIL_LEN   64
 
#define HIGH_PRIO   1
 
#define LOW_PRIO   8
 

Enumerations

enum  mmsg_type { PUT_GET_NULL = 0 , TARGET_SOURCE }
 

Functions

static K_THREAD_STACK_DEFINE (tstack,(512+CONFIG_TEST_EXTRA_STACK_SIZE))
 
static K_THREAD_STACK_DEFINE (high_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE))
 
static K_THREAD_STACK_DEFINE (low_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE))
 
static void msg_sender (struct k_mbox *pmbox, k_timeout_t timeout)
 
static void msg_receiver (struct k_mbox *pmbox, k_tid_t thd_id, k_timeout_t timeout)
 
static void test_mbox_init (void)
 
static void test_send (void *p1, void *p2, void *p3)
 
 ZTEST (mbox_usage, test_msg_receiver)
 
static void test_send_un (void *p1, void *p2, void *p3)
 
 ZTEST (mbox_usage, test_msg_receiver_unlimited)
 
static void thread_low_prio (void *p1, void *p2, void *p3)
 
static void thread_high_prio (void *p1, void *p2, void *p3)
 
 ZTEST (mbox_usage_1cpu, test_multi_thread_send_get)
 
void * setup_mbox_usage (void)
 
 ZTEST_SUITE (mbox_usage, NULL, setup_mbox_usage, NULL, NULL, NULL)
 
 ZTEST_SUITE (mbox_usage_1cpu, NULL, setup_mbox_usage, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL)
 

Variables

static struct k_thread tdata high_tdata low_tdata
 
static struct k_mbox mbox multi_tmbox
 
static struct k_sem sync_sema
 
static k_tid_t tid1
 
static k_tid_t receiver_tid
 
static char msg_data [2][64]
 
static enum mmsg_type info_type
 

Macro Definition Documentation

◆ HIGH_PRIO

#define HIGH_PRIO   1

◆ LOW_PRIO

#define LOW_PRIO   8

◆ MAIL_LEN

#define MAIL_LEN   64

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACK_SIZE)

Enumeration Type Documentation

◆ mmsg_type

enum mmsg_type
Enumerator
PUT_GET_NULL 
TARGET_SOURCE 

Function Documentation

◆ K_THREAD_STACK_DEFINE() [1/3]

static K_THREAD_STACK_DEFINE ( high_stack  ,
(512+CONFIG_TEST_EXTRA_STACK_SIZE)   
)
static

◆ K_THREAD_STACK_DEFINE() [2/3]

static K_THREAD_STACK_DEFINE ( low_stack  ,
(512+CONFIG_TEST_EXTRA_STACK_SIZE)   
)
static

◆ K_THREAD_STACK_DEFINE() [3/3]

static K_THREAD_STACK_DEFINE ( tstack  ,
(512+CONFIG_TEST_EXTRA_STACK_SIZE)   
)
static

◆ msg_receiver()

static void msg_receiver ( struct k_mbox pmbox,
k_tid_t  thd_id,
k_timeout_t  timeout 
)
static

◆ msg_sender()

static void msg_sender ( struct k_mbox pmbox,
k_timeout_t  timeout 
)
static

◆ setup_mbox_usage()

void * setup_mbox_usage ( void  )

◆ test_mbox_init()

static void test_mbox_init ( void  )
static

◆ test_send()

static void test_send ( void *  p1,
void *  p2,
void *  p3 
)
static

◆ test_send_un()

static void test_send_un ( void *  p1,
void *  p2,
void *  p3 
)
static

◆ thread_high_prio()

static void thread_high_prio ( void *  p1,
void *  p2,
void *  p3 
)
static

◆ thread_low_prio()

static void thread_low_prio ( void *  p1,
void *  p2,
void *  p3 
)
static

◆ ZTEST() [1/3]

ZTEST ( mbox_usage  ,
test_msg_receiver   
)

◆ ZTEST() [2/3]

ZTEST ( mbox_usage  ,
test_msg_receiver_unlimited   
)

◆ ZTEST() [3/3]

ZTEST ( mbox_usage_1cpu  ,
test_multi_thread_send_get   
)

◆ ZTEST_SUITE() [1/2]

ZTEST_SUITE ( mbox_usage  ,
NULL  ,
setup_mbox_usage  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [2/2]

ZTEST_SUITE ( mbox_usage_1cpu  ,
NULL  ,
setup_mbox_usage  ,
ztest_simple_1cpu_before  ,
ztest_simple_1cpu_after  ,
NULL   
)

Variable Documentation

◆ info_type

enum mmsg_type info_type
static

◆ low_tdata

struct k_thread tdata high_tdata low_tdata
static

◆ msg_data

char msg_data[2][64]
static
Initial value:
= {
"send to high prio",
"send to low prio"}

◆ multi_tmbox

struct k_mbox mbox multi_tmbox
static

◆ receiver_tid

k_tid_t receiver_tid
static

◆ sync_sema

struct k_sem sync_sema
static

◆ tid1

k_tid_t tid1
static