Skip to content

Commit 1203289

Browse files
dcpleungcfriedt
authored andcommitted
tests: mem_protect/mem_map: pin test_page in memory
This pins the test_page in memory for tests about memory mapping. This is simply to make sure the whole array is in physical memory for mapping or else the mapping function would fail due to having nothing to map. Signed-off-by: Daniel Leung <[email protected]>
1 parent ba94780 commit 1203289

File tree

1 file changed

+2
-0
lines changed
  • tests/kernel/mem_protect/mem_map/src

1 file changed

+2
-0
lines changed

tests/kernel/mem_protect/mem_map/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <sys/mem_manage.h>
99
#include <toolchain.h>
1010
#include <mmu.h>
11+
#include <linker/sections.h>
1112

1213
/* 32-bit IA32 page tables have no mechanism to restrict execution */
1314
#if defined(CONFIG_X86) && !defined(CONFIG_X86_64) && !defined(CONFIG_X86_PAE)
@@ -17,6 +18,7 @@
1718
#define BASE_FLAGS (K_MEM_CACHE_WB)
1819
volatile bool expect_fault;
1920

21+
__pinned_noinit
2022
static uint8_t __aligned(CONFIG_MMU_PAGE_SIZE)
2123
test_page[2 * CONFIG_MMU_PAGE_SIZE];
2224

0 commit comments

Comments
 (0)