Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#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
 

Macro Definition Documentation

◆ MAIN_PRIORITY

#define MAIN_PRIORITY   7

◆ OVERFLOW_STACKSIZE

#define OVERFLOW_STACKSIZE   STACKSIZE

◆ PRIORITY

#define PRIORITY   5

◆ STACKSIZE

#define STACKSIZE   (2048 + CONFIG_TEST_EXTRA_STACK_SIZE)

Function Documentation

◆ blow_up_stack()

void blow_up_stack ( void  )

◆ check_stack_overflow()

void check_stack_overflow ( k_thread_entry_t  handler,
uint32_t  flags 
)

◆ entry_arbitrary_reason()

void entry_arbitrary_reason ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_arbitrary_reason_negative()

void entry_arbitrary_reason_negative ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_cpu_exception()

void entry_cpu_exception ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_cpu_exception_extend()

void entry_cpu_exception_extend ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_oops()

void entry_oops ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_panic()

void entry_panic ( void *  p1,
void *  p2,
void *  p3 
)

◆ entry_zephyr_assert()

void entry_zephyr_assert ( void *  p1,
void *  p2,
void *  p3 
)

◆ fatal_setup()

static void * fatal_setup ( void  )
static

◆ K_THREAD_STACK_DEFINE()

static K_THREAD_STACK_DEFINE ( alt_stack  ,
(2048+CONFIG_TEST_EXTRA_STACK_SIZE)   
)
static

◆ stack_hw_overflow()

void stack_hw_overflow ( void *  p1,
void *  p2,
void *  p3 
)

◆ stack_sentinel_swap()

void stack_sentinel_swap ( void *  p1,
void *  p2,
void *  p3 
)

◆ stack_sentinel_timer()

void stack_sentinel_timer ( void *  p1,
void *  p2,
void *  p3 
)

◆ stack_smasher()

__no_optimization int stack_smasher ( int  val)

◆ user_priv_stack_hw_overflow()

void user_priv_stack_hw_overflow ( void *  p1,
void *  p2,
void *  p3 
)

◆ ZTEST_SUITE()

ZTEST_SUITE ( fatal_exception  ,
NULL  ,
fatal_setup  ,
NULL  ,
NULL  ,
NULL   
)

Variable Documentation

◆ alt_thread

struct k_thread alt_thread
static

◆ expected_reason

ZTEST_DMEM volatile int expected_reason = -1
static

◆ rv

volatile int rv