*
* ---------------------------------------------------------------------------*/
-/* 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 <unistd.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
#include <errno.h>
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) {
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).
osGetMBlocks(nat n)
{
caddr_t ret;
- lnat size = MBLOCK_SIZE * n;
+ lnat size = MBLOCK_SIZE * (lnat)n;
if (next_request == 0) {
// use gen_map_mblocks the first time.
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);
}
}