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

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define STACK_LEN   4
 
#define HIGH_T1   0xaaa
 
#define HIGH_T2   0xbbb
 
#define LOW_PRIO   0xccc
 

Functions

 K_STACK_DEFINE (kstack, 4)
 
 K_STACK_DEFINE (kstack_test_alloc, 4)
 
 K_THREAD_STACK_DEFINE (threadstack1,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_DEFINE (threadstack_t1,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_DEFINE (threadstack_t2,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void tstack_push (struct k_stack *pstack)
 
static void tstack_pop (struct k_stack *pstack)
 
static void tIsr_entry_push (const void *p)
 
static void tIsr_entry_pop (const void *p)
 
static void tThread_entry (void *p1, void *p2, void *p3)
 
static void tstack_thread_thread (struct k_stack *pstack)
 
static void tstack_thread_isr (struct k_stack *pstack)
 
void test_stack_thread2thread (void)
 Test to verify data passing between threads via stack. More...
 
void test_stack_user_thread2thread (void)
 Verifies data passing between user threads via stack. More...
 
void test_stack_thread2isr (void)
 Verifies data passing between thread and ISR via stack. More...
 
void test_stack_alloc_thread2thread (void)
 
static void low_prio_wait_for_stack (void *p1, void *p2, void *p3)
 
static void high_prio_t1_wait_for_stack (void *p1, void *p2, void *p3)
 
static void high_prio_t2_wait_for_stack (void *p1, void *p2, void *p3)
 
void test_stack_multithread_competition (void)
 Test multi-threads to get data from stack. More...
 

Variables

struct k_stack stack
 
struct k_thread thread_data1
 
static struct k_thread high_pro_thread_t1
 
static struct k_thread high_pro_thread_t2
 
static ZTEST_DMEM stack_data_t data [4] = { 0xABCD, 0x1234 }
 
struct k_sem end_sema1
 

Macro Definition Documentation

◆ HIGH_T1

#define HIGH_T1   0xaaa

◆ HIGH_T2

#define HIGH_T2   0xbbb

◆ LOW_PRIO

#define LOW_PRIO   0xccc

◆ STACK_LEN

#define STACK_LEN   4

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ K_STACK_DEFINE() [1/2]

K_STACK_DEFINE ( kstack  ,
 
)

TESTPOINT: init via K_STACK_DEFINE

◆ K_STACK_DEFINE() [2/2]

K_STACK_DEFINE ( kstack_test_alloc  ,
 
)

◆ K_THREAD_STACK_DEFINE() [1/3]

K_THREAD_STACK_DEFINE ( threadstack1  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [2/3]

K_THREAD_STACK_DEFINE ( threadstack_t1  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [3/3]

K_THREAD_STACK_DEFINE ( threadstack_t2  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ tIsr_entry_pop()

static void tIsr_entry_pop ( const void p)
static

◆ tIsr_entry_push()

static void tIsr_entry_push ( const void p)
static

◆ tstack_pop()

static void tstack_pop ( struct k_stack *  pstack)
static

TESTPOINT: stack pop

◆ tstack_push()

static void tstack_push ( struct k_stack *  pstack)
static

TESTPOINT: stack push

◆ tstack_thread_isr()

static void tstack_thread_isr ( struct k_stack *  pstack)
static

TESTPOINT: thread-isr data passing via stack

◆ tstack_thread_thread()

static void tstack_thread_thread ( struct k_stack *  pstack)
static

TESTPOINT: thread-thread data passing via stack

◆ tThread_entry()

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

Variable Documentation

◆ data

ZTEST_DMEM stack_data_t data[4] = { 0xABCD, 0x1234 }
static

◆ end_sema1

struct k_sem end_sema1

◆ high_pro_thread_t1

struct k_thread high_pro_thread_t1
static

◆ high_pro_thread_t2

struct k_thread high_pro_thread_t2
static

◆ stack

struct k_stack stack

◆ thread_data1

struct k_thread thread_data1