aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/cpu/os.c')
-rw-r--r--arch/sandbox/cpu/os.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 07e46471fe..325ded51d8 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -174,7 +174,12 @@ void *os_malloc(size_t length)
174 struct os_mem_hdr *hdr; 174 struct os_mem_hdr *hdr;
175 int page_size = getpagesize(); 175 int page_size = getpagesize();
176 176
177 hdr = mmap(NULL, length + page_size, 177 /*
178 * Use an address that is hopefully available to us so that pointers
179 * to this memory are fairly obvious. If we end up with a different
180 * address, that's fine too.
181 */
182 hdr = mmap((void *)0x10000000, length + page_size,
178 PROT_READ | PROT_WRITE | PROT_EXEC, 183 PROT_READ | PROT_WRITE | PROT_EXEC,
179 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 184 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
180 if (hdr == MAP_FAILED) 185 if (hdr == MAP_FAILED)