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/irq_offload.h>
#include <zephyr/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_STACK_SIZE)
 
#define PRIORITY   5
 

Functions

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

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

◆ TOTAL_THREADS_WAITING

#define TOTAL_THREADS_WAITING   (3)

Function Documentation

◆ futex_isr_wake()

static void futex_isr_wake ( const void *  futex)
static

◆ futex_multiple_wait_wake_task()

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

◆ futex_multiple_wake_task()

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

◆ futex_wait_task()

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

◆ futex_wait_wake_task()

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

◆ futex_wake_from_isr()

static void futex_wake_from_isr ( struct k_futex futex)
static

◆ futex_wake_task()

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

◆ K_THREAD_STACK_ARRAY_DEFINE() [1/2]

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

◆ K_THREAD_STACK_ARRAY_DEFINE() [2/2]

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

◆ K_THREAD_STACK_DEFINE() [1/2]

K_THREAD_STACK_DEFINE ( futex_wake_stack  ,
(512+CONFIG_TEST_EXTRA_STACK_SIZE)   
)

◆ K_THREAD_STACK_DEFINE() [2/2]

K_THREAD_STACK_DEFINE ( stack_1  ,
(512+CONFIG_TEST_EXTRA_STACK_SIZE)   
)

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