Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
test_msgq_contexts.c File Reference
#include "test_msgq.h"

Functions

 K_MSGQ_DEFINE (kmsgq, 4, 2, 4)
 
 K_MSGQ_DEFINE (kmsgq_test_alloc, 4, 2, 4)
 
 K_THREAD_STACK_DEFINE (tstack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_DEFINE (tstack1,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_DEFINE (tstack2,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void put_msgq (struct k_msgq *pmsgq)
 
static void get_msgq (struct k_msgq *pmsgq)
 
static void purge_msgq (struct k_msgq *pmsgq)
 
static void tisr_entry (const void *p)
 
static void thread_entry (void *p1, void *p2, void *p3)
 
static void msgq_thread (struct k_msgq *pmsgq)
 
static void thread_entry_overflow (void *p1, void *p2, void *p3)
 
static void msgq_thread_overflow (struct k_msgq *pmsgq)
 
static void msgq_isr (struct k_msgq *pmsgq)
 
static void thread_entry_get_data (void *p1, void *p2, void *p3)
 
static void pend_thread_entry (void *p1, void *p2, void *p3)
 
static void msgq_thread_data_passing (struct k_msgq *pmsgq)
 
static void get_empty_entry (void *p1, void *p2, void *p3)
 
static void put_full_entry (void *p1, void *p2, void *p3)
 
void test_msgq_thread (void)
 Test thread to thread data passing via message queue. More...
 
void test_msgq_thread_overflow (void)
 Test thread to thread data passing via message queue. More...
 
void test_msgq_user_thread (void)
 Test user thread to kernel thread data passing via message queue. More...
 
void test_msgq_user_thread_overflow (void)
 Test thread to thread data passing via message queue. More...
 
void test_msgq_isr (void)
 Test thread to isr data passing via message queue. More...
 
void test_msgq_pend_thread (void)
 Test pending writer in msgq. More...
 
void test_msgq_alloc (void)
 Test k_msgq_alloc_init() More...
 
void test_msgq_empty (void)
 Get message from an empty queue. More...
 
void test_msgq_full (void)
 Put message to a full queue. More...
 

Variables

struct k_msgq msgq
 
struct k_msgq msgq1
 
struct k_thread tdata
 
struct k_thread tdata1
 
struct k_thread tdata2
 
static ZTEST_BMEM char tbuffer [4 *2]
 
static ZTEST_DMEM char tbuffer1 [4]
 
static ZTEST_DMEM uint32_t data [2] = { 0xABCD , 0x1234 }
 
struct k_sem end_sema
 

Function Documentation

◆ get_empty_entry()

static void get_empty_entry ( void p1,
void p2,
void p3 
)
static

◆ get_msgq()

static void get_msgq ( struct k_msgq pmsgq)
static

TESTPOINT: Check if msg read is the msg deleted

TESTPOINT: msgq free get

TESTPOINT: msgq used get

◆ K_MSGQ_DEFINE() [1/2]

K_MSGQ_DEFINE ( kmsgq  ,
,
,
 
)

TESTPOINT: init via K_MSGQ_DEFINE

◆ K_MSGQ_DEFINE() [2/2]

K_MSGQ_DEFINE ( kmsgq_test_alloc  ,
,
,
 
)

◆ K_THREAD_STACK_DEFINE() [1/3]

K_THREAD_STACK_DEFINE ( tstack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [2/3]

K_THREAD_STACK_DEFINE ( tstack1  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [3/3]

K_THREAD_STACK_DEFINE ( tstack2  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ msgq_isr()

static void msgq_isr ( struct k_msgq pmsgq)
static

TESTPOINT: thread-isr data passing via message queue

TESTPOINT: msgq purge

◆ msgq_thread()

static void msgq_thread ( struct k_msgq pmsgq)
static

TESTPOINT: thread-thread data passing via message queue

TESTPOINT: msgq purge

◆ msgq_thread_data_passing()

static void msgq_thread_data_passing ( struct k_msgq pmsgq)
static

TESTPOINT: msgq purge

◆ msgq_thread_overflow()

static void msgq_thread_overflow ( struct k_msgq pmsgq)
static

TESTPOINT: thread-thread data passing via message queue

TESTPOINT: msgq purge

◆ pend_thread_entry()

static void pend_thread_entry ( void p1,
void p2,
void p3 
)
static

◆ purge_msgq()

static void purge_msgq ( struct k_msgq pmsgq)
static

◆ put_full_entry()

static void put_full_entry ( void p1,
void p2,
void p3 
)
static

◆ put_msgq()

static void put_msgq ( struct k_msgq pmsgq)
static

TESTPOINT: Check if k_msgq_peek reads msgq in FIFO manner. Everytime msg is enqueued, msg read should always be the first message

TESTPOINT: msgq free get

TESTPOINT: msgq used get

◆ thread_entry()

static void thread_entry ( void p1,
void p2,
void p3 
)
static

◆ thread_entry_get_data()

static void thread_entry_get_data ( void p1,
void p2,
void p3 
)
static

◆ thread_entry_overflow()

static void thread_entry_overflow ( void p1,
void p2,
void p3 
)
static

◆ tisr_entry()

static void tisr_entry ( const void p)
static

Variable Documentation

◆ data

ZTEST_DMEM uint32_t data[2] = { 0xABCD , 0x1234 }
static

◆ end_sema

struct k_sem end_sema

◆ msgq

struct k_msgq msgq

◆ msgq1

struct k_msgq msgq1

◆ tbuffer

ZTEST_BMEM char tbuffer[4 * 2]
static

◆ tbuffer1

ZTEST_DMEM char tbuffer1[4]
static

◆ tdata

struct k_thread tdata

◆ tdata1

struct k_thread tdata1

◆ tdata2

struct k_thread tdata2