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/irq_offload.h>

Macros

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

Functions

 K_STACK_DEFINE (stack1, 4)
 
 K_STACK_DEFINE (stack2, 4)
 
 K_THREAD_STACK_DEFINE (threadstack,(512+CONFIG_TEST_EXTRA_STACK_SIZE))
 
 K_HEAP_DEFINE (test_pool, 128 *3)
 
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)
 
 ZTEST_USER (stack_usage, test_single_stack_play)
 Verify data passing between threads using single stack.
 
 ZTEST_USER (stack_usage_1cpu, test_dual_stack_play)
 Verify data passing between threads using dual stack.
 
 ZTEST (stack_usage_1cpu, test_isr_stack_play)
 Verify data passing between thread and ISR.
 
void thread_entry_wait (void *p1, void *p2, void *p3)
 
 ZTEST (stack_usage, test_stack_pop_can_wait)
 Test that the stack pop can be waited if no item available.
 
static void * stack_setup (void)
 
 ZTEST_SUITE (stack_usage, NULL, stack_setup, NULL, NULL, NULL)
 
 ZTEST_SUITE (stack_contexts, NULL, stack_setup, NULL, NULL, NULL)
 
 ZTEST_SUITE (stack_fail, NULL, stack_setup, NULL, NULL, NULL)
 
 ZTEST_SUITE (stack_usage_1cpu, NULL, stack_setup, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL)
 

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

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

◆ stack_setup()

static void * stack_setup ( void  )
static

◆ 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

◆ ZTEST_SUITE() [1/4]

ZTEST_SUITE ( stack_contexts  ,
NULL  ,
stack_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [2/4]

ZTEST_SUITE ( stack_fail  ,
NULL  ,
stack_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [3/4]

ZTEST_SUITE ( stack_usage  ,
NULL  ,
stack_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_SUITE() [4/4]

ZTEST_SUITE ( stack_usage_1cpu  ,
NULL  ,
stack_setup  ,
ztest_simple_1cpu_before  ,
ztest_simple_1cpu_after  ,
NULL   
)

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