err = vm_allocate(mach_task_self(),(vm_address_t*) &ret, size, TRUE);
if(err) // don't know what the error codes mean exactly
- barf("memory allocation failed (requested %d bytes)", size);
+ barf("memory allocation failed (requested %lu bytes)", size);
else
vm_protect(mach_task_self(),ret,size,FALSE,VM_PROT_READ|VM_PROT_WRITE);
#else
(errno == EINVAL && sizeof(void*)==4 && size >= 0xc0000000)) {
// If we request more than 3Gig, then we get EINVAL
// instead of ENOMEM (at least on Linux).
- errorBelch("out of memory (requested %d bytes)", size);
+ errorBelch("out of memory (requested %lu bytes)", size);
stg_exit(EXIT_FAILURE);
} else {
barf("getMBlock: mmap: %s", strerror(errno));
);
if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
- fprintf(prof_file, " %5lu %9llu", cc->time_ticks, cc->mem_alloc);
+ fprintf(prof_file, " %5llu %9llu", (StgWord64)(cc->time_ticks), cc->mem_alloc);
}
fprintf(prof_file, "\n");
}
);
if (RtsFlags.CcFlags.doCostCentres >= COST_CENTRES_VERBOSE) {
- fprintf(prof_file, " %5lu %9llu", ccs->time_ticks, ccs->mem_alloc*sizeof(W_));
+ fprintf(prof_file, " %5llu %9llu", (StgWord64)(ccs->time_ticks), ccs->mem_alloc*sizeof(W_));
#if defined(PROFILING_DETAIL_COUNTS)
fprintf(prof_file, " %8ld %8ld %8ld %8ld %8ld %8ld %8ld",
ccs->mem_allocs, ccs->thunk_count,
cc = ccs->cc;
- fprintf(prof_file, " 1 %d %llu %lu %llu",
- ccs->ccsID, ccs->scc_count, ccs->time_ticks, ccs->mem_alloc);
+ fprintf(prof_file, " 1 %d %llu %llu %llu",
+ ccs->ccsID, ccs->scc_count, (StgWord64)(ccs->time_ticks), ccs->mem_alloc);
for (i = ccs->indexTable; i != 0; i = i->next) {
if (!i->back_edge) {
}
}
-#if i386_TARGET_ARCH
-static void x86_init_fpu ( void );
+/* -----------------------------------------------------------------------------
+ Initialise floating point unit on x86 (currently disabled. why?)
+ -------------------------------------------------------------------------- */
+
+#define X86_INIT_FPU 0
+
+#if X86_INIT_FPU
+static void
+x86_init_fpu ( void )
+{
+ __volatile unsigned short int fpu_cw;
+
+ // Grab the control word
+ __asm __volatile ("fnstcw %0" : "=m" (fpu_cw));
+
+#if 0
+ printf("fpu_cw: %x\n", fpu_cw);
+#endif
+
+ // Set bits 8-9 to 10 (64-bit precision).
+ fpu_cw = (fpu_cw & 0xfcff) | 0x0200;
+
+ // Store the new control word back
+ __asm __volatile ("fldcw %0" : : "m" (fpu_cw));
+}
#endif
/* -----------------------------------------------------------------------------
setlocale(LC_CTYPE,"");
#endif
-#if i386_TARGET_ARCH
-// x86_init_fpu();
+#if X86_INIT_FPU
+ x86_init_fpu();
#endif
/* Record initialization times */
#endif
exit(n);
}
-
-/* -----------------------------------------------------------------------------
- Initialise floating point unit on x86
- -------------------------------------------------------------------------- */
-
-#if i386_TARGET_ARCH
-static void
-x86_init_fpu ( void )
-{
- __volatile unsigned short int fpu_cw;
-
- // Grab the control word
- __asm __volatile ("fnstcw %0" : "=m" (fpu_cw));
-
-#if 0
- printf("fpu_cw: %x\n", fpu_cw);
-#endif
-
- // Set bits 8-9 to 10 (64-bit precision).
- fpu_cw = (fpu_cw & 0xfcff) | 0x0200;
-
- // Store the new control word back
- __asm __volatile ("fldcw %0" : : "m" (fpu_cw));
-}
-#endif
-
static void schedule ( StgMainThread *mainThread, Capability *initialCapability );
void interruptStgRts ( void );
+#if !defined(PAR) && !defined(RTS_SUPPORTS_THREADS)
static void detectBlackHoles ( void );
+#endif
#if defined(RTS_SUPPORTS_THREADS)
/* ToDo: carefully document the invariants that go together
* Locks: sched_mutex is held upon entry and exit.
* -------------------------------------------------------------------------- */
+#if !defined(PAR) && !defined(RTS_SUPPORTS_THREADS)
static void
detectBlackHoles( void )
{
done: ;
}
}
+#endif
/* ----------------------------------------------------------------------------
* Debugging: why is a thread blocked