diff --git a/tests/kernel/mem_protect/mem_map/custom-sections.ld b/tests/kernel/mem_protect/mem_map/custom-sections.ld index d6196a34138..7545e60a27b 100644 --- a/tests/kernel/mem_protect/mem_map/custom-sections.ld +++ b/tests/kernel/mem_protect/mem_map/custom-sections.ld @@ -8,5 +8,5 @@ SECTION_DATA_PROLOGUE(TEST_MEM_MAP,,SUBALIGN(CONFIG_MMU_PAGE_SIZE)) } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) -PROVIDE(__test_mem_map_start = LOADADDR(TEST_MEM_MAP)); +PROVIDE(__test_mem_map_start = ADDR(TEST_MEM_MAP)); PROVIDE(__test_mem_map_end = __test_mem_map_start + SIZEOF(TEST_MEM_MAP)); diff --git a/tests/kernel/mem_protect/mem_map/src/main.c b/tests/kernel/mem_protect/mem_map/src/main.c index f90fd0661c6..b10a6305d91 100644 --- a/tests/kernel/mem_protect/mem_map/src/main.c +++ b/tests/kernel/mem_protect/mem_map/src/main.c @@ -16,10 +16,8 @@ #define BASE_FLAGS (K_MEM_CACHE_WB) volatile bool expect_fault; -#ifndef CONFIG_KERNEL_LINK_IN_VIRT static uint8_t __aligned(CONFIG_MMU_PAGE_SIZE) test_page[2 * CONFIG_MMU_PAGE_SIZE]; -#endif void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf) { @@ -48,7 +46,6 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf) */ void test_z_phys_map_rw(void) { -#ifndef CONFIG_KERNEL_LINK_IN_VIRT uint8_t *mapped_rw, *mapped_ro; uint8_t *buf = test_page + BUF_OFFSET; @@ -79,17 +76,9 @@ void test_z_phys_map_rw(void) printk("shouldn't get here\n"); ztest_test_fail(); -#else - ztest_test_skip(); -#endif /* CONFIG_KERNEL_LINK_IN_VIRT */ } -#if defined(SKIP_EXECUTE_TESTS) || defined(CONFIG_KERNEL_LINK_IN_VIRT) -void test_z_phys_map_exec(void) -{ - ztest_test_skip(); -} -#else +#ifndef SKIP_EXECUTE_TESTS extern char __test_mem_map_start[]; extern char __test_mem_map_end[]; @@ -138,7 +127,12 @@ void test_z_phys_map_exec(void) printk("shouldn't get here\n"); ztest_test_fail(); } -#endif /* SKIP_EXECUTE_TESTS || CONFIG_KERNEL_LINK_IN_VIRT */ +#else +void test_z_phys_map_exec(void) +{ + ztest_test_skip(); +} +#endif /* SKIP_EXECUTE_TESTS */ /** * Show that memory mapping doesn't have unintended side effects @@ -147,7 +141,6 @@ void test_z_phys_map_exec(void) */ void test_z_phys_map_side_effect(void) { -#ifndef CONFIG_KERNEL_LINK_IN_VIRT uint8_t *mapped; expect_fault = false; @@ -167,9 +160,6 @@ void test_z_phys_map_side_effect(void) mapped[0] = 42; printk("shouldn't get here\n"); ztest_test_fail(); -#else - ztest_test_skip(); -#endif /* CONFIG_KERNEL_LINK_IN_VIRT */ } /**