Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/internal/syscall_handler.h>
#include <kernel_internal.h>
#include "test_syscall.h"
#include <zephyr/syscalls/stack_info_get_mrsh.c>
#include <zephyr/syscalls/check_perms_mrsh.c>
Data Structures | |
struct | foo |
struct | scenario_data |
Macros | |
#define | NUM_STACKS 3 |
#define | STEST_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
Functions | |
K_THREAD_STACK_DEFINE (user_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_THREAD_STACK_ARRAY_DEFINE (user_stack_array, 3,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_KERNEL_STACK_DEFINE (kern_stack,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
K_KERNEL_STACK_ARRAY_DEFINE (kern_stack_array, 3,(512+CONFIG_TEST_EXTRA_STACK_SIZE)) | |
void | stack_buffer_scenarios (void) |
void | stest_thread_entry (void *p1, void *p2, void *p3) |
void | stest_thread_launch (uint32_t flags, bool drop) |
void | scenario_entry (void *stack_obj, size_t obj_size, size_t reported_size, size_t declared_size, bool is_array) |
ZTEST (userspace_thread_stack, test_stack_buffer) | |
Test kernel provides user thread read/write access to its own stack memory buffer. | |
void | no_op_entry (void *p1, void *p2, void *p3) |
ZTEST (userspace_thread_stack, test_idle_stack) | |
Show that the idle thread stack size is correct. | |
void * | thread_setup (void) |
ZTEST_SUITE (userspace_thread_stack, NULL, thread_setup, ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL) | |
Variables | |
struct k_thread | test_thread |
__kstackmem struct foo | stest_member_stack |
ZTEST_BMEM struct scenario_data | scenario_data |
#define NUM_STACKS 3 |
#define STEST_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE) |
K_KERNEL_STACK_ARRAY_DEFINE | ( | kern_stack_array | , |
3 | , | ||
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_KERNEL_STACK_DEFINE | ( | kern_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_ARRAY_DEFINE | ( | user_stack_array | , |
3 | , | ||
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
K_THREAD_STACK_DEFINE | ( | user_stack | , |
(512+CONFIG_TEST_EXTRA_STACK_SIZE) | |||
) |
void no_op_entry | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void scenario_entry | ( | void * | stack_obj, |
size_t | obj_size, | ||
size_t | reported_size, | ||
size_t | declared_size, | ||
bool | is_array | ||
) |
void stack_buffer_scenarios | ( | void | ) |
void stest_thread_entry | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void * thread_setup | ( | void | ) |
ZTEST | ( | userspace_thread_stack | , |
test_idle_stack | |||
) |
Show that the idle thread stack size is correct.
The idle thread has to occasionally clean up self-exiting threads. Exercise this and show that we didn't overflow, reporting out stack usage.
ZTEST | ( | userspace_thread_stack | , |
test_stack_buffer | |||
) |
Test kernel provides user thread read/write access to its own stack memory buffer.
Thread can access its own stack memory buffer and perform read/write operations.
ZTEST_SUITE | ( | userspace_thread_stack | , |
NULL | , | ||
thread_setup | , | ||
ztest_simple_1cpu_before | , | ||
ztest_simple_1cpu_after | , | ||
NULL | |||
) |
ZTEST_BMEM struct scenario_data scenario_data |
__kstackmem struct foo stest_member_stack |
struct k_thread test_thread |