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

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define NUM_THREAD   4
 
#define IDLE_THRESH   20
 
#define SLEEP_TICKLESS   k_ticks_to_ms_floor64(IDLE_THRESH)
 
#define SLEEP_TICKFUL   k_ticks_to_ms_floor64(IDLE_THRESH - 1)
 
#define SLICE_SIZE   k_ticks_to_ms_floor64(IDLE_THRESH >> 1)
 
#define SLICE_SIZE_LIMIT   k_ticks_to_ms_floor64((IDLE_THRESH >> 1) + 1)
 
#define ALIGN_MS_BOUNDARY()
 

Functions

static K_THREAD_STACK_ARRAY_DEFINE (tstack, 4,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_SEM_DEFINE (sema, 0, 4)
 
static void thread_tslice (void *p1, void *p2, void *p3)
 
void test_tickless_sysclock (void)
 Verify system clock with and without tickless idle. More...
 
void test_tickless_slice (void)
 Verify tickless functionality with time slice. More...
 
void test_main (void)
 

Variables

static struct k_thread tdata [4]
 
static int64_t elapsed_slice
 

Macro Definition Documentation

◆ ALIGN_MS_BOUNDARY

#define ALIGN_MS_BOUNDARY ( )
Value:
do { \
uint32_t t = k_uptime_get_32(); \
while (t == k_uptime_get_32()) \
; \
} while (0)
static uint32_t k_uptime_get_32(void)
Get system uptime (32-bit version).
Definition: kernel.h:1602
struct k_thread t
Definition: kobject.c:1316

◆ IDLE_THRESH

#define IDLE_THRESH   20

◆ NUM_THREAD

#define NUM_THREAD   4

◆ SLEEP_TICKFUL

#define SLEEP_TICKFUL   k_ticks_to_ms_floor64(IDLE_THRESH - 1)

◆ SLEEP_TICKLESS

#define SLEEP_TICKLESS   k_ticks_to_ms_floor64(IDLE_THRESH)

◆ SLICE_SIZE

#define SLICE_SIZE   k_ticks_to_ms_floor64(IDLE_THRESH >> 1)

◆ SLICE_SIZE_LIMIT

#define SLICE_SIZE_LIMIT   k_ticks_to_ms_floor64((IDLE_THRESH >> 1) + 1)

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ K_SEM_DEFINE()

K_SEM_DEFINE ( sema  ,
,
 
)

◆ K_THREAD_STACK_ARRAY_DEFINE()

static K_THREAD_STACK_ARRAY_DEFINE ( tstack  ,
,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ test_main()

void test_main ( void  )

test case main entry

◆ thread_tslice()

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

TESTPOINT: verify slicing scheduler behaves as expected

Variable Documentation

◆ elapsed_slice

int64_t elapsed_slice
static

◆ tdata

struct k_thread tdata[4]
static