Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <zephyr.h>
#include <syscall_handler.h>
#include <ztest.h>
#include <linker/linker-defs.h>
#include "test_syscalls.h"
#include <mmu.h>
#include <syscalls/string_nlen_mrsh.c>
#include <syscalls/string_alloc_copy_mrsh.c>
#include <syscalls/string_copy_mrsh.c>
#include <syscalls/to_copy_mrsh.c>
#include <syscalls/syscall_arg64_mrsh.c>
#include <syscalls/syscall_arg64_big_mrsh.c>
#include <syscalls/more_args_mrsh.c>
#include <syscalls/syscall_context_mrsh.c>

Macros

#define BUF_SIZE   32
 
#define SLEEP_MS_LONG   15000
 
#define FAULTY_ADDRESS   Z_FREE_VM_START
 
#define NR_THREADS   (CONFIG_MP_NUM_CPUS * 4)
 
#define STACK_SZ   (1024 + CONFIG_TEST_EXTRA_STACKSIZE)
 

Functions

void test_string_nlen (void)
 Test to demonstrate usage of z_user_string_nlen() More...
 
void test_user_string_alloc_copy (void)
 Test to verify syscall for string alloc copy. More...
 
void test_user_string_copy (void)
 Test sys_call for string copy. More...
 
void test_to_copy (void)
 Test to demonstrate system call for copy. More...
 
void test_arg64 (void)
 
void test_more_args (void)
 
 K_THREAD_STACK_ARRAY_DEFINE (torture_stacks,(CONFIG_MP_NUM_CPUS *4),(1024+CONFIG_TEST_EXTRA_STACKSIZE))
 
void syscall_torture (void *arg1, void *arg2, void *arg3)
 
void test_syscall_torture (void)
 
void test_syscall_context_user (void *p1, void *p2, void *p3)
 
void test_syscall_context (void)
 
 K_HEAP_DEFINE (test_heap, 32 *(4 *(CONFIG_MP_NUM_CPUS *4)))
 
void test_main (void)
 

Variables

char kernel_string [32]
 
char kernel_buf [32]
 
ZTEST_BMEM char user_string [32]
 
struct k_thread torture_threads [(CONFIG_MP_NUM_CPUS *4)]
 

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   32

◆ FAULTY_ADDRESS

#define FAULTY_ADDRESS   Z_FREE_VM_START

◆ NR_THREADS

#define NR_THREADS   (CONFIG_MP_NUM_CPUS * 4)

◆ SLEEP_MS_LONG

#define SLEEP_MS_LONG   15000

◆ STACK_SZ

#define STACK_SZ   (1024 + CONFIG_TEST_EXTRA_STACKSIZE)

Function Documentation

◆ K_HEAP_DEFINE()

K_HEAP_DEFINE ( test_heap  ,
32 *  4 *(CONFIG_MP_NUM_CPUS *4) 
)

◆ K_THREAD_STACK_ARRAY_DEFINE()

K_THREAD_STACK_ARRAY_DEFINE ( torture_stacks  ,
(CONFIG_MP_NUM_CPUS *4)  ,
(1024+CONFIG_TEST_EXTRA_STACKSIZE)   
)

◆ syscall_torture()

void syscall_torture ( void arg1,
void arg2,
void arg3 
)

◆ test_arg64()

void test_arg64 ( void  )

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_more_args()

void test_more_args ( void  )

◆ test_string_nlen()

void test_string_nlen ( void  )

Test to demonstrate usage of z_user_string_nlen()

The test will be called from user mode and kernel mode to check the behavior of z_user_string_nlen()

See also
z_user_string_nlen()

◆ test_syscall_context()

void test_syscall_context ( void  )

◆ test_syscall_context_user()

void test_syscall_context_user ( void p1,
void p2,
void p3 
)

◆ test_syscall_torture()

void test_syscall_torture ( void  )

◆ test_to_copy()

void test_to_copy ( void  )

Test to demonstrate system call for copy.

See also
memcpy(), z_user_to_copy()

◆ test_user_string_alloc_copy()

void test_user_string_alloc_copy ( void  )

Test to verify syscall for string alloc copy.

See also
z_user_string_alloc_copy(), strcmp()

◆ test_user_string_copy()

void test_user_string_copy ( void  )

Test sys_call for string copy.

See also
z_user_string_copy(), strcmp()

Variable Documentation

◆ kernel_buf

char kernel_buf[32]

◆ kernel_string

char kernel_string[32]

◆ torture_threads

struct k_thread torture_threads[(CONFIG_MP_NUM_CPUS *4)]

◆ user_string

ZTEST_BMEM char user_string[32]