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

Macros

#define NUM_THREADS   ARRAY_SIZE(worker_priorities)
 
#define STACK_SIZE   (640 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define PRI(n)   (worker_priorities[n])
 

Enumerations

enum  { METAIRQ , COOP , PREEMPTIBLE }
 

Functions

 K_THREAD_STACK_DEFINE (manager_stack,(640+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_ARRAY_DEFINE (worker_stacks, ARRAY_SIZE(worker_priorities),(640+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_SEM_DEFINE (main_sem, 0, 1)
 
void wakeup_src_thread (int id)
 
void manager (void *p1, void *p2, void *p3)
 
void irq_waker (const void *p)
 
void validate_wakeup (int src, int target, k_tid_t last_thread)
 
void worker (void *p1, void *p2, void *p3)
 
void test_preempt (void)
 Test preemption. More...
 
void test_main (void)
 

Variables

enum { ... }  worker_priorities []
 
k_tid_t last_thread
 
struct k_thread manager_thread
 
struct k_thread worker_threads [ARRAY_SIZE(worker_priorities)]
 
struct k_sem worker_sems [ARRAY_SIZE(worker_priorities)]
 
int target
 
volatile int do_lock
 
volatile int do_irq
 
volatile int do_sleep
 
volatile int do_yield
 

Macro Definition Documentation

◆ NUM_THREADS

#define NUM_THREADS   ARRAY_SIZE(worker_priorities)

◆ PRI

#define PRI (   n)    (worker_priorities[n])

◆ STACK_SIZE

#define STACK_SIZE   (640 + CONFIG_TEST_EXTRA_STACKSIZE)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
METAIRQ 
COOP 
PREEMPTIBLE 

Function Documentation

◆ irq_waker()

void irq_waker ( const void p)

◆ K_SEM_DEFINE()

K_SEM_DEFINE ( main_sem  ,
,
 
)

◆ K_THREAD_STACK_ARRAY_DEFINE()

K_THREAD_STACK_ARRAY_DEFINE ( worker_stacks  ,
ARRAY_SIZE(worker_priorities ,
(640+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( manager_stack  ,
(640+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ manager()

void manager ( void p1,
void p2,
void p3 
)

◆ test_main()

void test_main ( void  )

test case main entry

◆ validate_wakeup()

void validate_wakeup ( int  src,
int  target,
k_tid_t  last_thread 
)

◆ wakeup_src_thread()

void wakeup_src_thread ( int  id)

◆ worker()

void worker ( void p1,
void p2,
void p3 
)

Variable Documentation

◆ do_irq

volatile int do_irq

◆ do_lock

volatile int do_lock

◆ do_sleep

volatile int do_sleep

◆ do_yield

volatile int do_yield

◆ last_thread

k_tid_t last_thread

◆ manager_thread

struct k_thread manager_thread

◆ target

int target

◆ 

enum { ... } worker_priorities[]
Initial value:
= {
}
@ METAIRQ
Definition: main.c:43
@ PREEMPTIBLE
Definition: main.c:43
@ COOP
Definition: main.c:43

◆ worker_sems

struct k_sem worker_sems[ARRAY_SIZE(worker_priorities)]

◆ worker_threads

struct k_thread worker_threads[ARRAY_SIZE(worker_priorities)]