Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Futex

Tests for Kernel Futex objects. More...

 ZTEST (futex, test_futex_wait_forever)
 Test k_futex_wait() forever.
 
 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.
 
 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)
 
void * futex_setup (void)
 
 ZTEST_SUITE (futex, NULL, futex_setup, NULL, NULL, NULL)
 

Detailed Description

Tests for Kernel Futex objects.

Function Documentation

◆ futex_setup()

void * futex_setup ( void  )

◆ futex_wait_wake()

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

◆ futex_wake()

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

◆ ZTEST() [1/9]

ZTEST ( futex  ,
test_futex_multiple_threads_wait_wake   
)

◆ ZTEST() [2/9]

ZTEST ( futex  ,
test_futex_wait_forever   
)

◆ ZTEST() [3/9]

ZTEST ( futex  ,
test_futex_wait_forever_wake   
)

◆ ZTEST() [4/9]

ZTEST ( futex  ,
test_futex_wait_forever_wake_from_isr   
)

◆ ZTEST() [5/9]

ZTEST ( futex  ,
test_futex_wait_nowait   
)

◆ ZTEST() [6/9]

ZTEST ( futex  ,
test_futex_wait_nowait_wake   
)

◆ ZTEST() [7/9]

ZTEST ( futex  ,
test_futex_wait_timeout   
)

◆ ZTEST() [8/9]

ZTEST ( futex  ,
test_futex_wait_timeout_wake   
)

◆ ZTEST() [9/9]

ZTEST ( futex  ,
test_multiple_futex_wait_wake   
)

◆ ZTEST_SUITE()

ZTEST_SUITE ( futex  ,
NULL  ,
futex_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_USER() [1/2]

ZTEST_USER ( futex  ,
test_futex_locate_access   
)

#include <tests/kernel/mem_protect/futex/src/main.c>

Test kernel supports locating kernel objects without private kernel data anywhere in memory, control access with the memory domain configuration.

For that test kernel object which doesn't contain private kernel data will be used futex. Test performs handshaking between two user threads to test next requirements:

  • Place a futex simple_futex in user memory using ZTEST_BMEM
  • Show that user threads can write to futex value
  • Show that user threads can make wait/wake syscalls on it.
See also
atomic_set(), atomic_sub(), k_futex_wake(), k_futex_wait()

◆ ZTEST_USER() [2/2]

ZTEST_USER ( futex  ,
test_user_futex_bad   
)