X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2Fposix%2FOSMem.c;h=0a372560227027f4b79c6e0d1c4dde71a97f789d;hp=7216f0e03d8c13515282819c29d401ad8eaaa0bb;hb=a2a67cd520b9841114d69a87a423dabcb3b4368e;hpb=d9aa9b1a3059bd6c96f83fadec0419c22606f5f3 diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index 7216f0e..0a37256 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -6,12 +6,12 @@ * * ---------------------------------------------------------------------------*/ -/* This is non-posix compliant. */ -/* #include "PosixSource.h" */ +// This is non-posix compliant. +// #include "PosixSource.h" #include "Rts.h" -#include "OSMem.h" -#include "RtsFlags.h" + +#include "sm/OSMem.h" #ifdef HAVE_UNISTD_H #include @@ -112,8 +112,8 @@ my_mmap (void *addr, lnat size) vm_protect(mach_task_self(),(vm_address_t)ret,size,FALSE,VM_PROT_READ|VM_PROT_WRITE); } #else - ret = mmap(addr, size, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_ANON | MAP_PRIVATE, -1, 0); + ret = mmap(addr, size, PROT_READ | PROT_WRITE, + MAP_ANON | MAP_PRIVATE, -1, 0); #endif if (ret == (void *)-1) { @@ -138,7 +138,7 @@ static void * gen_map_mblocks (lnat size) { int slop; - void *ret; + StgWord8 *ret; // Try to map a larger block, and take the aligned portion from // it (unmap the rest). @@ -237,6 +237,6 @@ void setExecutable (void *p, lnat len, rtsBool exec) StgWord size = startOfLastPage - startOfFirstPage + pageSize; if (mprotect((void*)startOfFirstPage, (size_t)size, (exec ? PROT_EXEC : 0) | PROT_READ | PROT_WRITE) != 0) { - barf("makeExecutable: failed to protect 0x%p\n", p); + barf("setExecutable: failed to protect 0x%p\n", p); } }