Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
user_api.c File Reference
#include "test_sched.h"
#include <zephyr/ztest.h>
#include <zephyr/irq_offload.h>
#include <kernel_internal.h>
#include <zephyr/ztest_error_hook.h>

Macros

#define THREAD_TEST_PRIORITY   0
 

Functions

 K_SEM_DEFINE (user_sem, 0, 1)
 
 K_THREAD_STACK_DEFINE (ustack,(640+CONFIG_TEST_EXTRA_STACK_SIZE))
 
static void sleepy_thread (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_user_k_wakeup)
 
static void preempt_test_thread (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_user_k_is_preempt)
 
static void thread_suspend_init_null (void *p1, void *p2, void *p3)
 userspace negative test: take NULL as input param to verify the api will trigger a fatal exception
 
 ZTEST_USER (threads_scheduling, test_k_thread_suspend_init_null)
 Test k_thread_suspend() API.
 
static void thread_resume_init_null (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_thread_resume_init_null)
 Test k_thread_resume() API.
 
static void thread_priority_get_init_null (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_thread_priority_get_init_null)
 Test k_thread_priority_get() API.
 
static void thread_priority_set_init_null (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_thread_priority_set_init_null)
 Test k_thread_priority_set() API.
 
static void thread_priority_set_overmax (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_thread_priority_set_overmax)
 Test k_thread_priority_set() API.
 
static void thread_priority_set_upgrade (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_thread_priority_set_upgrade)
 Test k_thread_priority_set() API.
 
static void thread_wakeup_init_null (void *p1, void *p2, void *p3)
 
 ZTEST_USER (threads_scheduling, test_k_wakeup_init_null)
 Test k_wakeup() API.
 

Variables

struct k_thread user_thread
 
ZTEST_BMEM volatile int thread_was_preempt
 

Macro Definition Documentation

◆ THREAD_TEST_PRIORITY

#define THREAD_TEST_PRIORITY   0

Function Documentation

◆ K_SEM_DEFINE()

K_SEM_DEFINE ( user_sem  ,
,
 
)

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( ustack  ,
(640+CONFIG_TEST_EXTRA_STACK_SIZE)   
)

◆ preempt_test_thread()

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

◆ sleepy_thread()

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

◆ thread_priority_get_init_null()

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

◆ thread_priority_set_init_null()

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

◆ thread_priority_set_overmax()

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

◆ thread_priority_set_upgrade()

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

◆ thread_resume_init_null()

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

◆ thread_suspend_init_null()

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

userspace negative test: take NULL as input param to verify the api will trigger a fatal exception

◆ thread_wakeup_init_null()

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

◆ ZTEST_USER() [1/2]

ZTEST_USER ( threads_scheduling  ,
test_user_k_is_preempt   
)

◆ ZTEST_USER() [2/2]

ZTEST_USER ( threads_scheduling  ,
test_user_k_wakeup   
)

Variable Documentation

◆ thread_was_preempt

ZTEST_BMEM volatile int thread_was_preempt

◆ user_thread

struct k_thread user_thread