return p;
}
+
+#ifdef sparc_HOST_ARCH
+/* The closures returned by allocateLocal are only guaranteed to be 32 bit
+ aligned, because that's the size of pointers. SPARC v9 can't do
+ misaligned loads/stores, so we have to write the 64bit word in chunks */
+
+HaskellObj
+rts_mkWord64 (Capability *cap, HsWord64 w_)
+{
+ StgWord64 w = (StgWord64)w_;
+ StgWord32 *tmp;
+
+ StgClosure *p = (StgClosure *)allocateLocal(cap,CONSTR_sizeW(0,2));
+ /* see mk_Int8 comment */
+ SET_HDR(p, W64zh_con_info, CCS_SYSTEM);
+
+ tmp = (StgWord32*)&(p->payload[0]);
+
+ tmp[0] = (StgWord32)((StgWord64)w >> 32);
+ tmp[1] = (StgWord32)w; /* truncate high 32 bits */
+ return p;
+}
+
+#else
+
HaskellObj
rts_mkWord64 (Capability *cap, HsWord64 w)
{
return p;
}
+#endif
+
+
HaskellObj
rts_mkFloat (Capability *cap, HsFloat f)
{
}
+#ifdef sparc_HOST_ARCH
+/* The closures returned by allocateLocal are only guaranteed to be 32 bit
+ aligned, because that's the size of pointers. SPARC v9 can't do
+ misaligned loads/stores, so we have to write the 64bit word in chunks */
+
+HsWord64
+rts_getWord64 (HaskellObj p)
+{
+ HsInt32* tmp;
+ // See comment above:
+ // ASSERT(p->header.info == I64zh_con_info ||
+ // p->header.info == I64zh_static_info);
+ tmp = (HsInt32*)&(UNTAG_CLOSURE(p)->payload[0]);
+
+ HsInt64 i = (HsWord64)((HsWord64)(tmp[0]) << 32) | (HsWord64)tmp[1];
+ return i;
+}
+
+#else
+
HsWord64
rts_getWord64 (HaskellObj p)
{
return *tmp;
}
+#endif
+
+
HsFloat
rts_getFloat (HaskellObj p)
{
createGenThread (Capability *cap, nat stack_size, StgClosure *closure)
{
StgTSO *t;
-#if defined(GRAN)
- t = createThread (cap, stack_size, NO_PRI);
-#else
t = createThread (cap, stack_size);
-#endif
pushClosure(t, (W_)closure);
pushClosure(t, (W_)&stg_enter_info);
return t;
createIOThread (Capability *cap, nat stack_size, StgClosure *closure)
{
StgTSO *t;
-#if defined(GRAN)
- t = createThread (cap, stack_size, NO_PRI);
-#else
t = createThread (cap, stack_size);
-#endif
pushClosure(t, (W_)&stg_noforceIO_info);
pushClosure(t, (W_)&stg_ap_v_info);
pushClosure(t, (W_)closure);
createStrictIOThread(Capability *cap, nat stack_size, StgClosure *closure)
{
StgTSO *t;
-#if defined(GRAN)
- t = createThread(cap, stack_size, NO_PRI);
-#else
t = createThread(cap, stack_size);
-#endif
pushClosure(t, (W_)&stg_forceIO_info);
pushClosure(t, (W_)&stg_ap_v_info);
pushClosure(t, (W_)closure);
Capability *cap;
Task *task;
- // ToDo: get rid of this lock in the common case. We could store
- // a free Task in thread-local storage, for example. That would
- // leave just one lock on the path into the RTS: cap->lock when
- // acquiring the Capability.
- ACQUIRE_LOCK(&sched_mutex);
task = newBoundTask();
- RELEASE_LOCK(&sched_mutex);
cap = NULL;
waitForReturnCapability(&cap, task);