[project @ 2001-02-12 04:55:33 by chak]
[ghc-hetmet.git] / ghc / rts / PrimOps.hc
index d78f505..711f538 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.67 2001/01/15 09:55:41 sewardj Exp $
+ * $Id: PrimOps.hc,v 1.71 2001/02/11 17:51:07 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
    classes CCallable and CReturnable don't really exist, but the
    compiler insists on generating dictionaries containing references
    to GHC_ZcCCallable_static_info etc., so we provide dummy symbols
-   for these.
+   for these.  Some C compilers can't cope with zero-length static arrays,
+   so we have to make these one element long.
 */
 
-W_ GHC_ZCCCallable_static_info[0];
-W_ GHC_ZCCReturnable_static_info[0];
-
-
+StgWord GHC_ZCCCallable_static_info[1];
+StgWord GHC_ZCCReturnable_static_info[1];
+  
 /* -----------------------------------------------------------------------------
    Macros for Hand-written primitives.
    -------------------------------------------------------------------------- */
@@ -944,13 +944,8 @@ FN_(putMVarzh_fast)
 #endif
 
   if (info == &stg_FULL_MVAR_info) {
-#ifdef INTERPRETER
-    fprintf(stderr, "fatal: put on a full MVar in Hugs; aborting\n" );
-    exit(1);
-#else
     R1.cl = (StgClosure *)PutFullMVar_closure;
     JMP_(raisezh_fast);
-#endif
   }
   
   mvar->value = R2.cl;
@@ -1016,7 +1011,6 @@ FN_(makeStableNamezh_fast)
    Bytecode object primitives
    -------------------------------------------------------------------------  */
 
-#ifdef GHCI
 FN_(newBCOzh_fast)
 {
   /* R1.p = instrs
@@ -1062,7 +1056,6 @@ FN_(mkApUpd0zh_fast)
   RET_P(ap);
   FE_
 }
-#endif
 
 /* -----------------------------------------------------------------------------
    Thread I/O blocking primitives
@@ -1107,7 +1100,7 @@ FN_(delayzh_fast)
 
     ACQUIRE_LOCK(&sched_mutex);
 
-    target = (R1.i / (TICK_MILLISECS*1000)) + timestamp + ticks_since_timestamp;
+    target = (R1.i / (TICK_MILLISECS*1000)) + getourtimeofday();
     CurrentTSO->block_info.target = target;
 
     /* Insert the new thread in the sleeping queue. */