Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <ztest.h>
#include <kernel.h>

Macros

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

Enumerations

enum  mmsg_type {
  PUT_GET_NULL = 0 , PUT_GET_BUFFER , ASYNC_PUT_GET_BUFFER , ASYNC_PUT_GET_BLOCK ,
  TARGET_SOURCE_THREAD_BUFFER , MAX_INFO_TYPE , INCORRECT_RECEIVER_TID , INCORRECT_TRANSMIT_TID ,
  TIMED_OUT_MBOX_GET , MSG_TID_MISMATCH , DISPOSE_SIZE_0_MSG , ASYNC_PUT_TO_WAITING_GET ,
  GET_WAITING_PUT_INCORRECT_TID , ASYNC_MULTIPLE_PUT , MULTIPLE_WAITING_GET , PUT_GET_NULL = 0 ,
  TARGET_SOURCE
}
 

Functions

static K_THREAD_STACK_DEFINE (tstack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static K_THREAD_STACK_DEFINE (high_stack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static K_THREAD_STACK_DEFINE (low_stack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
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)
 
void test_send (void *p1, void *p2, void *p3)
 
void test_msg_receiver (void)
 
void test_send_un (void *p1, void *p2, void *p3)
 
void test_msg_receiver_unlimited (void)
 
void thread_low_prio (void *p1, void *p2, void *p3)
 
void thread_high_prio (void *p1, void *p2, void *p3)
 
void test_multi_thread_send_get (void)
 
void test_main (void)
 

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_STACKSIZE)

Enumeration Type Documentation

◆ mmsg_type

enum mmsg_type
Enumerator
PUT_GET_NULL 
PUT_GET_BUFFER 
ASYNC_PUT_GET_BUFFER 
ASYNC_PUT_GET_BLOCK 
TARGET_SOURCE_THREAD_BUFFER 
MAX_INFO_TYPE 
INCORRECT_RECEIVER_TID 
INCORRECT_TRANSMIT_TID 
TIMED_OUT_MBOX_GET 
MSG_TID_MISMATCH 
DISPOSE_SIZE_0_MSG 
ASYNC_PUT_TO_WAITING_GET 
GET_WAITING_PUT_INCORRECT_TID 
ASYNC_MULTIPLE_PUT 
MULTIPLE_WAITING_GET 
PUT_GET_NULL 
TARGET_SOURCE 

Function Documentation

◆ K_THREAD_STACK_DEFINE() [1/3]

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

◆ K_THREAD_STACK_DEFINE() [2/3]

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

◆ K_THREAD_STACK_DEFINE() [3/3]

static K_THREAD_STACK_DEFINE ( tstack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)
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

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_mbox_init()

static void test_mbox_init ( void  )
static

◆ test_msg_receiver()

void test_msg_receiver ( void  )

◆ test_msg_receiver_unlimited()

void test_msg_receiver_unlimited ( void  )

◆ test_multi_thread_send_get()

void test_multi_thread_send_get ( void  )

◆ test_send()

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

◆ test_send_un()

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

◆ thread_high_prio()

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

◆ thread_low_prio()

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

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