Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
main.c File Reference
#include <zephyr/kernel.h>
#include <zephyr/ztest.h>
#include <zephyr/kernel_structs.h>
#include <zephyr/sys/barrier.h>
#include <string.h>
#include <stdlib.h>
#include "targets.h"

Macros

#define INFO(fmt, ...)   printk(fmt, ##__VA_ARGS__)
 
#define FUNC_TO_PTR(x)   (void *)(x)
 
#define PTR_TO_FUNC(x)   (int (*)(int))(x)
 
#define DO_BARRIERS()   do { } while (0)
 

Functions

void k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf)
 Fatal error policy handler.
 
static int add_one (int i)
 
static void execute_from_buffer (uint8_t *dst)
 
 ZTEST (protection, test_write_ro)
 Test write to read only section.
 
 ZTEST (protection, test_write_text)
 Test to execute on text section.
 
 ZTEST (protection, test_exec_data)
 Test execution from data section.
 
 ZTEST (protection, test_exec_stack)
 Test execution from stack section.
 
 ZTEST (protection, test_exec_heap)
 Test execution from heap.
 
 ZTEST_SUITE (protection, NULL, NULL, NULL, NULL, NULL)
 

Macro Definition Documentation

◆ DO_BARRIERS

#define DO_BARRIERS ( )    do { } while (0)

◆ FUNC_TO_PTR

#define FUNC_TO_PTR (   x)    (void *)(x)

◆ INFO

#define INFO (   fmt,
  ... 
)    printk(fmt, ##__VA_ARGS__)

◆ PTR_TO_FUNC

#define PTR_TO_FUNC (   x)    (int (*)(int))(x)

Function Documentation

◆ add_one()

static int add_one ( int  i)
static

◆ execute_from_buffer()

static void execute_from_buffer ( uint8_t dst)
static

◆ ZTEST() [1/5]

ZTEST ( protection  ,
test_exec_data   
)

Test execution from data section.

◆ ZTEST() [2/5]

ZTEST ( protection  ,
test_exec_heap   
)

Test execution from heap.

◆ ZTEST() [3/5]

ZTEST ( protection  ,
test_exec_stack   
)

Test execution from stack section.

◆ ZTEST() [4/5]

ZTEST ( protection  ,
test_write_ro   
)

Test write to read only section.

◆ ZTEST() [5/5]

ZTEST ( protection  ,
test_write_text   
)

Test to execute on text section.

◆ ZTEST_SUITE()

ZTEST_SUITE ( protection  ,
NULL  ,
NULL  ,
NULL  ,
NULL  ,
NULL   
)