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

Macros

#define BUF_SIZE   32
 
#define SLEEP_MS_LONG   15000
 
#define FAULTY_ADDRESS   K_MEM_VM_FREE_START
 
#define NR_THREADS   (arch_num_cpus() * 4)
 
#define MAX_NR_THREADS   (CONFIG_MP_MAX_NUM_CPUS * 4)
 
#define STACK_SZ   (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)
 

Functions

void k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf)
 Fatal error policy handler.
 
void test_string_nlen (void)
 Test to demonstrate usage of k_usermode_string_nlen()
 
void test_user_string_alloc_copy (void)
 Test to verify syscall for string alloc copy.
 
void test_user_string_copy (void)
 Test sys_call for string copy.
 
void test_to_copy (void)
 Test to demonstrate system call for copy.
 
void run_test_arg64 (void)
 
void test_arg64 (void)
 
void test_more_args (void)
 
 K_THREAD_STACK_ARRAY_DEFINE (torture_stacks,(CONFIG_MP_MAX_NUM_CPUS *4),(1024+CONFIG_TEST_EXTRA_STACK_SIZE))
 
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_MAX_NUM_CPUS *4)))
 
void * syscalls_setup (void)
 
 ZTEST_SUITE (syscalls, NULL, syscalls_setup, NULL, NULL, NULL)
 

Variables

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

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE   32

◆ FAULTY_ADDRESS

#define FAULTY_ADDRESS   K_MEM_VM_FREE_START

◆ MAX_NR_THREADS

#define MAX_NR_THREADS   (CONFIG_MP_MAX_NUM_CPUS * 4)

◆ NR_THREADS

#define NR_THREADS   (arch_num_cpus() * 4)

◆ SLEEP_MS_LONG

#define SLEEP_MS_LONG   15000

◆ STACK_SZ

#define STACK_SZ   (1024 + CONFIG_TEST_EXTRA_STACK_SIZE)

Function Documentation

◆ K_HEAP_DEFINE()

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

◆ K_THREAD_STACK_ARRAY_DEFINE()

K_THREAD_STACK_ARRAY_DEFINE ( torture_stacks ,
(CONFIG_MP_MAX_NUM_CPUS *4) ,
(1024+CONFIG_TEST_EXTRA_STACK_SIZE)  )

◆ run_test_arg64()

void run_test_arg64 ( void )

◆ syscall_torture()

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

◆ syscalls_setup()

void * syscalls_setup ( void )

◆ test_arg64()

void test_arg64 ( void )

◆ test_more_args()

void test_more_args ( void )

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

◆ ZTEST_SUITE()

ZTEST_SUITE ( syscalls ,
NULL ,
syscalls_setup ,
NULL ,
NULL ,
NULL  )

Variable Documentation

◆ kernel_buf

char kernel_buf[32]

◆ kernel_string

char kernel_string[32]

◆ torture_threads

struct k_thread torture_threads[(CONFIG_MP_MAX_NUM_CPUS *4)]

◆ user_string

ZTEST_BMEM char user_string[32]