Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <zephyr.h>
#include <ztest.h>
#include <tc_util.h>
#include <kernel_structs.h>
#include <irq_offload.h>
#include <kswap.h>
#include <assert.h>
#include <sys/mem_manage.h>
#include <syscall_handler.h>
#include "test_syscalls.h"
#include <syscalls/blow_up_priv_stack_mrsh.c>

Macros

#define STACKSIZE   (2048 + CONFIG_TEST_EXTRA_STACKSIZE)
 
#define MAIN_PRIORITY   7
 
#define PRIORITY   5
 
#define OVERFLOW_STACKSIZE   STACKSIZE
 

Functions

static K_THREAD_STACK_DEFINE (alt_stack,(2048+CONFIG_TEST_EXTRA_STACKSIZE))
 
void k_sys_fatal_error_handler (unsigned int reason, const z_arch_esf_t *pEsf)
 Fatal error policy handler. More...
 
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)
 
void test_fatal (void)
 Test the kernel fatal error handling works correctly. More...
 
void test_main (void)
 

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

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 
)

◆ K_THREAD_STACK_DEFINE()

static K_THREAD_STACK_DEFINE ( alt_stack  ,
(2048+CONFIG_TEST_EXTRA_STACKSIZE)   
)
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)

◆ test_main()

void test_main ( void  )

◆ user_priv_stack_hw_overflow()

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

Variable Documentation

◆ alt_thread

struct k_thread alt_thread
static

◆ expected_reason

ZTEST_DMEM volatile int expected_reason = -1
static

◆ rv

volatile int rv