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>

Macros

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

Functions

static K_THREAD_STACK_DEFINE (user_tstack,(512+CONFIG_TEST_EXTRA_STACK_SIZE))
 
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.
 
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.
 
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.
 
static void test_user_workq_granted_access_setup (void)
 Setup object permissions before test_user_workq_granted_access()
 
static void test_user_workq_granted_access (void)
 Test user mode grant workqueue permissions.
 
static void test_user_work_submit_to_queue_thread (void)
 Test work submission to work queue (user mode)
 
void * workq_setup (void)
 
 ZTEST_USER (workqueue_api, test_workq_user_mode)
 
 ZTEST_SUITE (workqueue_api, NULL, workq_setup, NULL, NULL, NULL)
 

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

◆ 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

◆ K_THREAD_STACK_DEFINE()

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

◆ test_k_work_user_init()

static void test_k_work_user_init ( void  )
static

◆ 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

◆ workq_setup()

void * workq_setup ( void  )

◆ ZTEST_SUITE()

ZTEST_SUITE ( workqueue_api  ,
NULL  ,
workq_setup  ,
NULL  ,
NULL  ,
NULL   
)

◆ ZTEST_USER()

ZTEST_USER ( workqueue_api  ,
test_workq_user_mode   
)

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