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

Macros

#define TOTAL_THREADS_WAITING   (3)
 
#define PRIO_WAIT   (CONFIG_ZTEST_THREAD_PRIORITY - 1)
 
#define PRIO_WAKE   (CONFIG_ZTEST_THREAD_PRIORITY - 2)
 
#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define PRIORITY   5
 

Functions

 K_THREAD_STACK_DEFINE (stack_1,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_DEFINE (futex_wake_stack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_ARRAY_DEFINE (multiple_stack,(3),(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
 K_THREAD_STACK_ARRAY_DEFINE (multiple_wake_stack,(3),(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
void futex_isr_wake (const void *futex)
 
void futex_wake_from_isr (struct k_futex *futex)
 
void futex_wait_task (void *p1, void *p2, void *p3)
 
void futex_wake_task (void *p1, void *p2, void *p3)
 
void futex_wait_wake_task (void *p1, void *p2, void *p3)
 
void futex_multiple_wake_task (void *p1, void *p2, void *p3)
 
void futex_multiple_wait_wake_task (void *p1, void *p2, void *p3)
 
void test_futex_wait_forever (void)
 Test k_futex_wait() forever. More...
 
void test_futex_wait_timeout (void)
 
void test_futex_wait_nowait (void)
 
void test_futex_wait_forever_wake (void)
 Test k_futex_wait() and k_futex_wake() More...
 
void test_futex_wait_timeout_wake (void)
 
void test_futex_wait_nowait_wake (void)
 
void test_futex_wait_forever_wake_from_isr (void)
 
void test_futex_multiple_threads_wait_wake (void)
 
void test_multiple_futex_wait_wake (void)
 
void test_user_futex_bad (void)
 
void futex_wait_wake (void *p1, void *p2, void *p3)
 
void futex_wake (void *p1, void *p2, void *p3)
 
void test_futex_locate_access (void)
 Test kernel supports locating kernel objects without private kernel data anywhere in memory, control access with the memory domain configuration. More...
 
void test_main (void)
 

Variables

ZTEST_BMEM int woken
 
ZTEST_BMEM int timeout
 
ZTEST_BMEM int index [(3)]
 
ZTEST_BMEM struct k_futex simple_futex
 
ZTEST_BMEM struct k_futex multiple_futex [(3)]
 
struct k_futex no_access_futex
 
ZTEST_BMEM atomic_t not_a_futex
 
ZTEST_BMEM struct sys_mutex also_not_a_futex
 
struct k_thread futex_tid
 
struct k_thread futex_wake_tid
 
struct k_thread multiple_tid [(3)]
 
struct k_thread multiple_wake_tid [(3)]
 

Macro Definition Documentation

◆ PRIO_WAIT

#define PRIO_WAIT   (CONFIG_ZTEST_THREAD_PRIORITY - 1)

◆ PRIO_WAKE

#define PRIO_WAKE   (CONFIG_ZTEST_THREAD_PRIORITY - 2)

◆ PRIORITY

#define PRIORITY   5

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

◆ TOTAL_THREADS_WAITING

#define TOTAL_THREADS_WAITING   (3)

Function Documentation

◆ futex_isr_wake()

void futex_isr_wake ( const void futex)

◆ futex_multiple_wait_wake_task()

void futex_multiple_wait_wake_task ( void p1,
void p2,
void p3 
)

◆ futex_multiple_wake_task()

void futex_multiple_wake_task ( void p1,
void p2,
void p3 
)

◆ futex_wait_task()

void futex_wait_task ( void p1,
void p2,
void p3 
)

◆ futex_wait_wake_task()

void futex_wait_wake_task ( void p1,
void p2,
void p3 
)

◆ futex_wake_from_isr()

void futex_wake_from_isr ( struct k_futex futex)

◆ futex_wake_task()

void futex_wake_task ( void p1,
void p2,
void p3 
)

◆ K_THREAD_STACK_ARRAY_DEFINE() [1/2]

K_THREAD_STACK_ARRAY_DEFINE ( multiple_stack  ,
(3)  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_ARRAY_DEFINE() [2/2]

K_THREAD_STACK_ARRAY_DEFINE ( multiple_wake_stack  ,
(3)  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [1/2]

K_THREAD_STACK_DEFINE ( futex_wake_stack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ K_THREAD_STACK_DEFINE() [2/2]

K_THREAD_STACK_DEFINE ( stack_1  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)

Variable Documentation

◆ also_not_a_futex

ZTEST_BMEM struct sys_mutex also_not_a_futex

◆ futex_tid

struct k_thread futex_tid

◆ futex_wake_tid

struct k_thread futex_wake_tid

◆ index

ZTEST_BMEM int index[(3)]

◆ multiple_futex

ZTEST_BMEM struct k_futex multiple_futex[(3)]

◆ multiple_tid

struct k_thread multiple_tid[(3)]

◆ multiple_wake_tid

struct k_thread multiple_wake_tid[(3)]

◆ no_access_futex

struct k_futex no_access_futex

◆ not_a_futex

ZTEST_BMEM atomic_t not_a_futex

◆ simple_futex

ZTEST_BMEM struct k_futex simple_futex

◆ timeout

ZTEST_BMEM int timeout

◆ woken

ZTEST_BMEM int woken