tests: mem_protect/mem_map: no need to skip test if link in virt
This reverts commit 9de70a78fe
.
The tests have been updated so there is no need to skip tests
when the kernel is linked in virtual address space.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2b48f591e1
commit
a120799b85
2 changed files with 8 additions and 18 deletions
|
@ -8,5 +8,5 @@ SECTION_DATA_PROLOGUE(TEST_MEM_MAP,,SUBALIGN(CONFIG_MMU_PAGE_SIZE))
|
||||||
|
|
||||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
} 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));
|
PROVIDE(__test_mem_map_end = __test_mem_map_start + SIZEOF(TEST_MEM_MAP));
|
||||||
|
|
|
@ -16,10 +16,8 @@
|
||||||
#define BASE_FLAGS (K_MEM_CACHE_WB)
|
#define BASE_FLAGS (K_MEM_CACHE_WB)
|
||||||
volatile bool expect_fault;
|
volatile bool expect_fault;
|
||||||
|
|
||||||
#ifndef CONFIG_KERNEL_LINK_IN_VIRT
|
|
||||||
static uint8_t __aligned(CONFIG_MMU_PAGE_SIZE)
|
static uint8_t __aligned(CONFIG_MMU_PAGE_SIZE)
|
||||||
test_page[2 * 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)
|
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)
|
void test_z_phys_map_rw(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_KERNEL_LINK_IN_VIRT
|
|
||||||
uint8_t *mapped_rw, *mapped_ro;
|
uint8_t *mapped_rw, *mapped_ro;
|
||||||
uint8_t *buf = test_page + BUF_OFFSET;
|
uint8_t *buf = test_page + BUF_OFFSET;
|
||||||
|
|
||||||
|
@ -79,17 +76,9 @@ void test_z_phys_map_rw(void)
|
||||||
|
|
||||||
printk("shouldn't get here\n");
|
printk("shouldn't get here\n");
|
||||||
ztest_test_fail();
|
ztest_test_fail();
|
||||||
#else
|
|
||||||
ztest_test_skip();
|
|
||||||
#endif /* CONFIG_KERNEL_LINK_IN_VIRT */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(SKIP_EXECUTE_TESTS) || defined(CONFIG_KERNEL_LINK_IN_VIRT)
|
#ifndef SKIP_EXECUTE_TESTS
|
||||||
void test_z_phys_map_exec(void)
|
|
||||||
{
|
|
||||||
ztest_test_skip();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
extern char __test_mem_map_start[];
|
extern char __test_mem_map_start[];
|
||||||
extern char __test_mem_map_end[];
|
extern char __test_mem_map_end[];
|
||||||
|
|
||||||
|
@ -138,7 +127,12 @@ void test_z_phys_map_exec(void)
|
||||||
printk("shouldn't get here\n");
|
printk("shouldn't get here\n");
|
||||||
ztest_test_fail();
|
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
|
* 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)
|
void test_z_phys_map_side_effect(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_KERNEL_LINK_IN_VIRT
|
|
||||||
uint8_t *mapped;
|
uint8_t *mapped;
|
||||||
|
|
||||||
expect_fault = false;
|
expect_fault = false;
|
||||||
|
@ -167,9 +160,6 @@ void test_z_phys_map_side_effect(void)
|
||||||
mapped[0] = 42;
|
mapped[0] = 42;
|
||||||
printk("shouldn't get here\n");
|
printk("shouldn't get here\n");
|
||||||
ztest_test_fail();
|
ztest_test_fail();
|
||||||
#else
|
|
||||||
ztest_test_skip();
|
|
||||||
#endif /* CONFIG_KERNEL_LINK_IN_VIRT */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue