X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=linux%2Fplat.c;h=9109a3242c5e251fc63083820e3290d557a654af;hb=de24250ab5038797e8f5ff8754d34a3219943134;hp=45ae37189cd23e72fbe23a10709e8f15d9777d58;hpb=e50d6e0656e2a31d45ddc52c13b3da6738e93a17;p=libpicofe.git diff --git a/linux/plat.c b/linux/plat.c index 45ae371..9109a32 100644 --- a/linux/plat.c +++ b/linux/plat.c @@ -192,6 +192,10 @@ void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed) */ if (size >= HUGETLB_THRESHOLD) flags |= MAP_HUGETLB; +#ifdef MAP_JIT + if (need_exec) + flags |= MAP_JIT; +#endif ret = mmap(req, size, prot, flags, -1, 0); if (ret == MAP_FAILED && (flags & MAP_HUGETLB)) { @@ -223,8 +227,11 @@ void *plat_mremap(void *ptr, size_t oldsize, size_t newsize) { void *ret; +#ifdef MREMAP_MAYMOVE ret = mremap(ptr, oldsize, newsize, MREMAP_MAYMOVE); - if (ret == MAP_FAILED) { + if (ret == MAP_FAILED) +#endif + { fprintf(stderr, "mremap %p %zd %zd: ", ptr, oldsize, newsize); perror(NULL);