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

Macros

#define TSTACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define STACK_LEN   4
 

Functions

 K_STACK_DEFINE (stack1, 4)
 
 K_STACK_DEFINE (stack2, 4)
 
 K_THREAD_STACK_DEFINE (threadstack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_HEAP_DEFINE (test_pool, 128 *3)
 
void test_stack_thread2thread (void)
 Test to verify data passing between threads via stack. More...
 
void test_stack_thread2isr (void)
 Verifies data passing between thread and ISR via stack. More...
 
void test_stack_pop_fail (void)
 Verifies stack pop functionality. More...
 
void test_stack_alloc_thread2thread (void)
 
void test_stack_pop_can_wait (void)
 Test that the stack pop can be waited if no item availablle. More...
 
void test_stack_cleanup_error (void)
 Verifies cleanup a stack that still be needed by another thread. More...
 
void test_stack_push_full (void)
 Verifies push a data in the full stack. More...
 
void test_stack_multithread_competition (void)
 Test multi-threads to get data from stack. More...
 
void test_stack_user_thread2thread (void)
 Verifies data passing between user threads via stack. More...
 
void test_stack_user_pop_fail (void)
 Verifies stack pop from a user thread. More...
 
void test_stack_user_init_null (void)
 Verifies stack alloc and initialize a null pointer. More...
 
void test_stack_user_init_invalid_value (void)
 Verify that alloc and initialize a stack with 0 memory. More...
 
void test_stack_user_push_null (void)
 Verify that push some data into a NULL pointer. More...
 
void test_stack_user_pop_null (void)
 Verifies pop data from a NULL pointer. More...
 
void test_stack_user_pop_permission (void)
 Verifies cleanup a stack that its data still be waited by another thread. More...
 
static void tIsr_entry_push (const void *p)
 
static void tIsr_entry_pop (const void *p)
 
static void thread_entry_fn_single (void *p1, void *p2, void *p3)
 
static void thread_entry_fn_dual (void *p1, void *p2, void *p3)
 
static void thread_entry_fn_isr (void *p1, void *p2, void *p3)
 
static void test_single_stack_play (void)
 Verify data passing between threads using single stack. More...
 
static void test_dual_stack_play (void)
 Verify data passing between threads using dual stack. More...
 
static void test_isr_stack_play (void)
 Verify data passing between thread and ISR. More...
 
void thread_entry_wait (void *p1, void *p2, void *p3)
 
void test_main (void)
 

Variables

struct k_thread thread_data
 
static ZTEST_DMEM stack_data_t data1 [4] = { 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD }
 
static ZTEST_DMEM stack_data_t data2 [4] = { 0x1111, 0x2222, 0x3333, 0x4444 }
 
static ZTEST_DMEM stack_data_t data_isr [4]
 
static struct k_sem end_sema
 
struct k_stack kstack
 
struct k_stack stack
 
struct k_stack threadstack1
 
struct k_thread thread_data1
 
struct k_sem end_sema1
 

Macro Definition Documentation

◆ STACK_LEN

#define STACK_LEN   4

◆ TSTACK_SIZE

#define TSTACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ K_HEAP_DEFINE()

K_HEAP_DEFINE ( test_pool  ,
128 *  3 
)

◆ K_STACK_DEFINE() [1/2]

K_STACK_DEFINE ( stack1  ,
 
)

◆ K_STACK_DEFINE() [2/2]

K_STACK_DEFINE ( stack2  ,
 
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( threadstack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ test_main()

void test_main ( void  )

test case main entry

◆ thread_entry_fn_dual()

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

◆ thread_entry_fn_isr()

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

◆ thread_entry_fn_single()

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

◆ tIsr_entry_pop()

static void tIsr_entry_pop ( const void p)
static

◆ tIsr_entry_push()

static void tIsr_entry_push ( const void p)
static

Variable Documentation

◆ data1

ZTEST_DMEM stack_data_t data1[4] = { 0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD }
static

◆ data2

ZTEST_DMEM stack_data_t data2[4] = { 0x1111, 0x2222, 0x3333, 0x4444 }
static

◆ data_isr

ZTEST_DMEM stack_data_t data_isr[4]
static
Initial value:
= { 0xABCD, 0xABCD, 0xABCD,
0xABCD }

◆ end_sema

struct k_sem end_sema
static

◆ end_sema1

struct k_sem end_sema1
extern

◆ kstack

struct k_stack kstack
extern

◆ stack

struct k_stack stack
extern

◆ thread_data

◆ thread_data1

struct k_thread thread_data1
extern

◆ threadstack1

struct k_stack threadstack1
extern