From a2ad8cc5a68892c8ae7d1964f4081f755654d325 Mon Sep 17 00:00:00 2001 From: notaz Date: Tue, 21 Aug 2012 02:04:46 +0300 Subject: use plat_mmap for RAM too --- frontend/common/plat.h | 2 +- frontend/linux/plat.c | 4 +++- frontend/plugin_lib.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'frontend') diff --git a/frontend/common/plat.h b/frontend/common/plat.h index 416f8ac..1fb8767 100644 --- a/frontend/common/plat.h +++ b/frontend/common/plat.h @@ -45,7 +45,7 @@ int plat_is_dir(const char *path); int plat_wait_event(int *fds_hnds, int count, int timeout_ms); void plat_sleep_ms(int ms); -void *plat_mmap(unsigned long addr, size_t size, int need_exec); +void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed); void *plat_mremap(void *ptr, size_t oldsize, size_t newsize); void plat_munmap(void *ptr, size_t size); diff --git a/frontend/linux/plat.c b/frontend/linux/plat.c index 044084e..4ed1e65 100644 --- a/frontend/linux/plat.c +++ b/frontend/linux/plat.c @@ -134,7 +134,7 @@ int plat_wait_event(int *fds_hnds, int count, int timeout_ms) return ret; } -void *plat_mmap(unsigned long addr, size_t size, int need_exec) +void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed) { static int hugetlb_disabled; int prot = PROT_READ | PROT_WRITE; @@ -144,6 +144,8 @@ void *plat_mmap(unsigned long addr, size_t size, int need_exec) req = (void *)addr; if (need_exec) prot |= PROT_EXEC; + if (is_fixed) + flags |= MAP_FIXED; if (size >= HUGETLB_THRESHOLD && !hugetlb_disabled) flags |= MAP_HUGETLB; diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index c2e2ab4..484d67b 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -487,7 +487,7 @@ static void pl_get_layer_pos(int *x, int *y, int *w, int *h) static void *pl_mmap(unsigned int size) { - return plat_mmap(0, size, 0); + return plat_mmap(0, size, 0, 0); } static void pl_munmap(void *ptr, unsigned int size) -- cgit v1.2.3