Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/tc_util.h>
#include <zephyr/kernel_structs.h>
#include <zephyr/irq_offload.h>
#include <kswap.h>
#include <assert.h>
#include <zephyr/kernel/mm.h>
#include <zephyr/internal/syscall_handler.h>
#include "test_syscalls.h"
#include <zephyr/syscalls/blow_up_priv_stack_mrsh.c>
Macros | |
#define | STACKSIZE (2048 + CONFIG_TEST_EXTRA_STACK_SIZE) |
#define | MAIN_PRIORITY 7 |
#define | PRIORITY 5 |
#define | OVERFLOW_STACKSIZE STACKSIZE |
Functions | |
static | K_THREAD_STACK_DEFINE (alt_stack,(2048+CONFIG_TEST_EXTRA_STACK_SIZE)) |
void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf) |
Fatal error policy handler. | |
void | entry_cpu_exception (void *p1, void *p2, void *p3) |
void | entry_cpu_exception_extend (void *p1, void *p2, void *p3) |
void | entry_oops (void *p1, void *p2, void *p3) |
void | entry_panic (void *p1, void *p2, void *p3) |
void | entry_zephyr_assert (void *p1, void *p2, void *p3) |
void | entry_arbitrary_reason (void *p1, void *p2, void *p3) |
void | entry_arbitrary_reason_negative (void *p1, void *p2, void *p3) |
__no_optimization int | stack_smasher (int val) |
void | blow_up_stack (void) |
void | stack_sentinel_timer (void *p1, void *p2, void *p3) |
void | stack_sentinel_swap (void *p1, void *p2, void *p3) |
void | stack_hw_overflow (void *p1, void *p2, void *p3) |
void | user_priv_stack_hw_overflow (void *p1, void *p2, void *p3) |
void | check_stack_overflow (k_thread_entry_t handler, uint32_t flags) |
ZTEST (fatal_exception, test_fatal) | |
Test the kernel fatal error handling works correctly. | |
static void * | fatal_setup (void) |
ZTEST_SUITE (fatal_exception, NULL, fatal_setup, NULL, NULL, NULL) | |
Variables | |
static struct k_thread | alt_thread |
volatile int | rv |
static ZTEST_DMEM volatile int | expected_reason = -1 |
#define MAIN_PRIORITY 7 |
#define OVERFLOW_STACKSIZE STACKSIZE |
#define PRIORITY 5 |
#define STACKSIZE (2048 + CONFIG_TEST_EXTRA_STACK_SIZE) |
void blow_up_stack | ( | void | ) |
void check_stack_overflow | ( | k_thread_entry_t | handler, |
uint32_t | flags | ||
) |
void entry_arbitrary_reason | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_arbitrary_reason_negative | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_cpu_exception | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_cpu_exception_extend | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_oops | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_panic | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void entry_zephyr_assert | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
|
static |
|
static |
void stack_hw_overflow | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void stack_sentinel_swap | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
void stack_sentinel_timer | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
__no_optimization int stack_smasher | ( | int | val | ) |
void user_priv_stack_hw_overflow | ( | void * | p1, |
void * | p2, | ||
void * | p3 | ||
) |
ZTEST_SUITE | ( | fatal_exception | , |
NULL | , | ||
fatal_setup | , | ||
NULL | , | ||
NULL | , | ||
NULL | |||
) |
|
static |
|
static |
volatile int rv |