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

Macros

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define NUM_OF_WORK   2
 
#define SYNC_SEM_INIT_VAL   (0U)
 

Functions

static K_THREAD_STACK_DEFINE (user_tstack,(512+CONFIG_TEST_EXTRA_STACKSIZE))
 
static void common_work_handler (struct k_work_user *unused)
 Common function using like a handler for workqueue tests API call in it means successful execution of that function. More...
 
static void test_k_work_user_init (void)
 
static void test_k_work_user_submit_to_queue_fail (void)
 Test k_work_user_submit_to_queue API. More...
 
static void work_handler (struct k_work_user *w)
 
static void twork_submit_1 (struct k_work_user_q *work_q, struct k_work_user *w, k_work_user_handler_t handler)
 
static void twork_submit (const void *data)
 
static void test_work_user_queue_start_before_submit (void)
 Test user mode work queue start before submit. More...
 
static void test_user_workq_granted_access_setup (void)
 Setup object permissions before test_user_workq_granted_access() More...
 
static void test_user_workq_granted_access (void)
 Test user mode grant workqueue permissions. More...
 
static void test_user_work_submit_to_queue_thread (void)
 Test work submission to work queue (user mode) More...
 
void test_main (void)
 

Variables

static struct k_work_user_q user_workq
 
static ZTEST_BMEM struct k_work_user work [2]
 
static struct k_sem sync_sema
 
static struct k_sem dummy_sema
 
static struct k_threadmain_thread
 

Macro Definition Documentation

◆ NUM_OF_WORK

#define NUM_OF_WORK   2

◆ STACK_SIZE

#define STACK_SIZE   (512 + CONFIG_TEST_EXTRA_STACKSIZE)

◆ SYNC_SEM_INIT_VAL

#define SYNC_SEM_INIT_VAL   (0U)

Function Documentation

◆ common_work_handler()

static void common_work_handler ( struct k_work_user *  unused)
static

Common function using like a handler for workqueue tests API call in it means successful execution of that function.

Parameters
unusedof type k_work to make handler function accepted by k_work_init
Returns
N/A

◆ K_THREAD_STACK_DEFINE()

static K_THREAD_STACK_DEFINE ( user_tstack  ,
(512+CONFIG_TEST_EXTRA_STACKSIZE)   
)
static

◆ test_k_work_user_init()

static void test_k_work_user_init ( void  )
static

◆ test_main()

void test_main ( void  )

test case main entry

◆ twork_submit()

static void twork_submit ( const void data)
static

◆ twork_submit_1()

static void twork_submit_1 ( struct k_work_user_q *  work_q,
struct k_work_user *  w,
k_work_user_handler_t  handler 
)
static

TESTPOINT: init via k_work_init

TESTPOINT: check pending after work init

TESTPOINT: work submit to queue

◆ work_handler()

static void work_handler ( struct k_work_user *  w)
static

Variable Documentation

◆ dummy_sema

struct k_sem dummy_sema
static

◆ main_thread

struct k_thread* main_thread
static

◆ sync_sema

struct k_sem sync_sema
static

◆ user_workq

struct k_work_user_q user_workq
static

◆ work

ZTEST_BMEM struct k_work_user work[2]
static