Zephyr Project API 3.5.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>

Macros

#define TIMEOUT_MS   500
 
#define STACK_OBJ_SIZE   Z_THREAD_STACK_SIZE_ADJUST(CONFIG_DYNAMIC_THREAD_STACK_SIZE)
 
#define MAX_HEAP_STACKS   (CONFIG_HEAP_MEM_POOL_SIZE / STACK_OBJ_SIZE)
 

Functions

static void func (void *arg1, void *arg2, void *arg3)
 
 ZTEST (dynamic_thread_stack, test_dynamic_thread_stack_pool)
 Exercise the pool-based thread stack allocator.
 
 ZTEST (dynamic_thread_stack, test_dynamic_thread_stack_alloc)
 Exercise the heap-based thread stack allocator.
 
static void * dynamic_thread_stack_setup (void)
 
 ZTEST_SUITE (dynamic_thread_stack, NULL, dynamic_thread_stack_setup, NULL, NULL, NULL)
 

Variables

ZTEST_DMEM bool tflag [MAX(CONFIG_DYNAMIC_THREAD_POOL_SIZE,(1/Z_THREAD_STACK_SIZE_ADJUST(CONFIG_DYNAMIC_THREAD_STACK_SIZE)))]
 

Macro Definition Documentation

◆ MAX_HEAP_STACKS

#define MAX_HEAP_STACKS   (CONFIG_HEAP_MEM_POOL_SIZE / STACK_OBJ_SIZE)

◆ STACK_OBJ_SIZE

#define STACK_OBJ_SIZE   Z_THREAD_STACK_SIZE_ADJUST(CONFIG_DYNAMIC_THREAD_STACK_SIZE)

◆ TIMEOUT_MS

#define TIMEOUT_MS   500

Function Documentation

◆ dynamic_thread_stack_setup()

static void * dynamic_thread_stack_setup ( void  )
static

◆ func()

static void func ( void *  arg1,
void *  arg2,
void *  arg3 
)
static

◆ ZTEST() [1/2]

ZTEST ( dynamic_thread_stack  ,
test_dynamic_thread_stack_alloc   
)

Exercise the heap-based thread stack allocator.

◆ ZTEST() [2/2]

ZTEST ( dynamic_thread_stack  ,
test_dynamic_thread_stack_pool   
)

Exercise the pool-based thread stack allocator.

◆ ZTEST_SUITE()

ZTEST_SUITE ( dynamic_thread_stack  ,
NULL  ,
dynamic_thread_stack_setup  ,
NULL  ,
NULL  ,
NULL   
)

Variable Documentation

◆ tflag

ZTEST_DMEM bool tflag[MAX(CONFIG_DYNAMIC_THREAD_POOL_SIZE,(1/ Z_THREAD_STACK_SIZE_ADJUST(CONFIG_DYNAMIC_THREAD_STACK_SIZE)))]