Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
main.c File Reference
#include <ztest.h>
#include <sys/mem_manage.h>
#include <toolchain.h>
#include <mmu.h>
#include <linker/sections.h>

Macros

#define BASE_FLAGS   (K_MEM_CACHE_WB)
 
#define BUF_SIZE   5003
 
#define BUF_OFFSET   1238
 

Functions

void k_sys_fatal_error_handler (unsigned int reason, const z_arch_esf_t *pEsf)
 Fatal error policy handler. More...
 
void test_z_phys_map_rw (void)
 
void test_z_phys_map_exec (void)
 
void test_z_phys_map_side_effect (void)
 
void test_z_phys_unmap (void)
 
void test_k_mem_map_unmap (void)
 
void test_k_mem_map_guard_before (void)
 
void test_k_mem_map_guard_after (void)
 
void test_k_mem_map_exhaustion (void)
 
void test_main (void)
 

Variables

volatile bool expect_fault
 
static __pinned_noinit uint8_t test_page [2 *CONFIG_MMU_PAGE_SIZE]
 

Macro Definition Documentation

◆ BASE_FLAGS

#define BASE_FLAGS   (K_MEM_CACHE_WB)

◆ BUF_OFFSET

#define BUF_OFFSET   1238

◆ BUF_SIZE

#define BUF_SIZE   5003

Function Documentation

◆ test_k_mem_map_exhaustion()

void test_k_mem_map_exhaustion ( void  )

◆ test_k_mem_map_guard_after()

void test_k_mem_map_guard_after ( void  )

Test that the "after" guard page is in place for k_mem_map().

◆ test_k_mem_map_guard_before()

void test_k_mem_map_guard_before ( void  )

Test that the "before" guard page is in place for k_mem_map().

◆ test_k_mem_map_unmap()

void test_k_mem_map_unmap ( void  )

Basic k_mem_map() and k_mem_unmap() functionality

Does not exercise K_MEM_MAP_* control flags, just default behavior

◆ test_main()

void test_main ( void  )

test case main entry

◆ test_z_phys_map_exec()

void test_z_phys_map_exec ( void  )

Show that mapping with/withour K_MEM_PERM_EXEC works as expected

◆ test_z_phys_map_rw()

void test_z_phys_map_rw ( void  )

Show that mapping an irregular size buffer works and RW flag is respected

◆ test_z_phys_map_side_effect()

void test_z_phys_map_side_effect ( void  )

Show that memory mapping doesn't have unintended side effects

◆ test_z_phys_unmap()

void test_z_phys_unmap ( void  )

Test that z_phys_unmap() unmaps the memory and it is no longer accessible afterwards.

Variable Documentation

◆ expect_fault

volatile bool expect_fault

◆ test_page

__pinned_noinit uint8_t test_page[2 *CONFIG_MMU_PAGE_SIZE]
static