Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#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. | |
ZTEST_USER (syscalls, test_string_nlen) | |
Test to demonstrate usage of k_usermode_string_nlen() | |
ZTEST_USER (syscalls, test_user_string_alloc_copy) | |
Test to verify syscall for string alloc copy. | |
ZTEST_USER (syscalls, test_user_string_copy) | |
Test sys_call for string copy. | |
ZTEST_USER (syscalls, test_to_copy) | |
Test to demonstrate system call for copy. | |
void | run_test_arg64 (void) |
ZTEST_USER (syscalls, test_arg64) | |
ZTEST_USER (syscalls, test_more_args) | |
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) |
ZTEST (syscalls, test_syscall_torture) | |
void | test_syscall_context_user (void *p1, void *p2, void *p3) |
ZTEST (syscalls, test_syscall_context) | |
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)] |
#define BUF_SIZE 32 |
#define FAULTY_ADDRESS K_MEM_VM_FREE_START |
#define MAX_NR_THREADS (CONFIG_MP_MAX_NUM_CPUS * 4) |
#define NR_THREADS (arch_num_cpus() * 4) |
#define SLEEP_MS_LONG 15000 |
#define STACK_SZ (1024 + CONFIG_TEST_EXTRA_STACK_SIZE) |
K_HEAP_DEFINE | ( | test_heap | , |
32 * | 4 *(CONFIG_MP_MAX_NUM_CPUS *4) | ||
) |
K_THREAD_STACK_ARRAY_DEFINE | ( | torture_stacks | , |
(CONFIG_MP_MAX_NUM_CPUS *4) | , | ||
(1024+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
void run_test_arg64 | ( | void | ) |
void syscall_torture | ( | void * | arg1, |
void * | arg2, | ||
void * | arg3 | ||
) |
void * syscalls_setup | ( | void | ) |
void test_syscall_context_user | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
ZTEST | ( | syscalls | , |
test_syscall_context | |||
) |
ZTEST | ( | syscalls | , |
test_syscall_torture | |||
) |
ZTEST_SUITE | ( | syscalls | , |
NULL | , | ||
syscalls_setup | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
ZTEST_USER | ( | syscalls | , |
test_arg64 | |||
) |
ZTEST_USER | ( | syscalls | , |
test_more_args | |||
) |
ZTEST_USER | ( | syscalls | , |
test_string_nlen | |||
) |
Test to demonstrate usage of k_usermode_string_nlen()
The test will be called from user mode and kernel mode to check the behavior of k_usermode_string_nlen()
ZTEST_USER | ( | syscalls | , |
test_to_copy | |||
) |
Test to demonstrate system call for copy.
ZTEST_USER | ( | syscalls | , |
test_user_string_alloc_copy | |||
) |
Test to verify syscall for string alloc copy.
ZTEST_USER | ( | syscalls | , |
test_user_string_copy | |||
) |
Test sys_call for string copy.
char kernel_buf[32] |
char kernel_string[32] |
struct k_thread torture_threads[(CONFIG_MP_MAX_NUM_CPUS *4)] |
ZTEST_BMEM char user_string[32] |