|
Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
#include <zephyr/ztest.h>#include <zephyr/toolchain.h>#include <mmu.h>#include <zephyr/linker/sections.h>#include <zephyr/cache.h>Macros | |
| #define | BASE_FLAGS (K_MEM_CACHE_WB) |
| #define | BUF_SIZE (CONFIG_MMU_PAGE_SIZE + 907) |
| #define | BUF_OFFSET 1238 |
| #define | TEST_PAGE_SZ ROUND_UP(BUF_OFFSET + BUF_SIZE, CONFIG_MMU_PAGE_SIZE) |
| #define | USER_STACKSIZE (128) |
| #define | FUNC_BEFORE NULL |
| #define | FUNC_AFTER NULL |
Functions | |
| void | k_sys_fatal_error_handler (unsigned int reason, const struct arch_esf *pEsf) |
| Fatal error policy handler. | |
| void | test_k_mem_map_phys_bare_rw (void) |
| Show that mapping an irregular size buffer works and RW flag is respected. | |
| void | test_k_mem_map_phys_bare_exec (void) |
| Show that mapping with/without K_MEM_PERM_EXEC works as expected. | |
| void | test_k_mem_map_phys_bare_side_effect (void) |
| Show that memory mapping doesn't have unintended side effects. | |
| void | test_k_mem_unmap_phys_bare (void) |
| Test that k_mem_unmap_phys_bare() unmaps the memory and it is no longer accessible afterwards. | |
| void | test_k_mem_map_phys_bare_unmap_reclaim_addr (void) |
| Show that k_mem_unmap_phys_bare() can reclaim the virtual region correctly. | |
| void | test_k_mem_map_unmap (void) |
| Basic k_mem_map() and k_mem_unmap() functionality. | |
| void | test_k_mem_map_guard_before (void) |
| Test that the "before" guard page is in place for k_mem_map(). | |
| void | test_k_mem_map_guard_after (void) |
| Test that the "after" guard page is in place for k_mem_map(). | |
| void | test_k_mem_map_exhaustion (void) |
| K_THREAD_STACK_DEFINE (user_stack,(128)) | |
| K_APPMEM_PARTITION_DEFINE (default_part) | |
| K_APP_DMEM (default_part) | |
| void | test_k_mem_map_user (void) |
| Test that the allocated region will be only accessible to userspace when K_MEM_PERM_USER is used. | |
| void * | mem_map_env_setup (void) |
| ZTEST_SUITE (mem_map, NULL, NULL, NULL, NULL, NULL) | |
| ZTEST_SUITE (mem_map_api, NULL, mem_map_env_setup, NULL, NULL, NULL) | |
Variables | |
| volatile bool | expect_fault |
| static __pinned_noinit uint8_t | test_page [ROUND_UP(1238+(CONFIG_MMU_PAGE_SIZE+907), CONFIG_MMU_PAGE_SIZE)] |
| struct k_thread | user_thread |
| #define BASE_FLAGS (K_MEM_CACHE_WB) |
| #define BUF_OFFSET 1238 |
| #define BUF_SIZE (CONFIG_MMU_PAGE_SIZE + 907) |
| #define FUNC_AFTER NULL |
| #define FUNC_BEFORE NULL |
| #define TEST_PAGE_SZ ROUND_UP(BUF_OFFSET + BUF_SIZE, CONFIG_MMU_PAGE_SIZE) |
| #define USER_STACKSIZE (128) |
| K_APP_DMEM | ( | default_part | ) |
| K_APPMEM_PARTITION_DEFINE | ( | default_part | ) |
| K_THREAD_STACK_DEFINE | ( | user_stack | , |
| (128) | ) |
| void * mem_map_env_setup | ( | void | ) |
| void test_k_mem_map_exhaustion | ( | void | ) |
| void test_k_mem_map_guard_after | ( | void | ) |
Test that the "after" guard page is in place for k_mem_map().
| void test_k_mem_map_guard_before | ( | void | ) |
Test that the "before" guard page is in place for k_mem_map().
| 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
| void test_k_mem_map_user | ( | void | ) |
Test that the allocated region will be only accessible to userspace when K_MEM_PERM_USER is used.
| ZTEST_SUITE | ( | mem_map_api | , |
| NULL | , | ||
| mem_map_env_setup | , | ||
| NULL | , | ||
| NULL | , | ||
| NULL | ) |
| volatile bool expect_fault |
|
static |
| struct k_thread user_thread |