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

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACK_SIZE)
 
#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_STACK_SIZE))
 
 K_SEM_DEFINE (sema, 0, 4)
 
static void thread_tslice (void *p1, void *p2, void *p3)
 
 ZTEST (tickless_concept, test_tickless_sysclock)
 Verify system clock with and without tickless idle.
 
 ZTEST (tickless_concept, test_tickless_slice)
 Verify tickless functionality with time slice.
 
 ZTEST_SUITE (tickless_concept, NULL, NULL, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL)
 

Variables

static struct k_thread tdata [4]
 
static int64_t elapsed_slice
 

Macro Definition Documentation

◆ ALIGN_MS_BOUNDARY

#define ALIGN_MS_BOUNDARY ( )
Value:
do { \
while (t == k_uptime_get_32()) \
Z_SPIN_DELAY(50); \
} while (0)
static uint32_t k_uptime_get_32(void)
Get system uptime (32-bit version).
Definition kernel.h:1775
struct k_thread t
Definition kobject.c:1324
__UINT32_TYPE__ uint32_t
Definition stdint.h:90

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

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

◆ thread_tslice()

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

TESTPOINT: verify slicing scheduler behaves as expected

◆ ZTEST_SUITE()

ZTEST_SUITE ( tickless_concept  ,
NULL  ,
NULL  ,
ztest_simple_1cpu_before  ,
ztest_simple_1cpu_after  ,
NULL   
)

Variable Documentation

◆ elapsed_slice

int64_t elapsed_slice
static

◆ tdata

struct k_thread tdata[4]
static