[project @ 2001-02-08 14:36:21 by simonmar]
authorsimonmar <unknown>
Thu, 8 Feb 2001 14:36:21 +0000 (14:36 +0000)
committersimonmar <unknown>
Thu, 8 Feb 2001 14:36:21 +0000 (14:36 +0000)
Fix bitrot in SMP code.

ghc/includes/SMP.h
ghc/rts/RtsAPI.c
ghc/rts/StgMiscClosures.hc
ghc/rts/Storage.h

index fa24798..3a31d96 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: SMP.h,v 1.1 1999/11/02 15:05:52 simonmar Exp $
+ * $Id: SMP.h,v 1.2 2001/02/08 14:36:21 simonmar Exp $
  *
  * (c) The GHC Team, 1999
  *
 #define LOCK_CLOSURE(c)                                        \
   ({                                                   \
     const StgInfoTable *__info;                                \
-    __info = &WHITEHOLE_info;                          \
+    __info = &stg_WHITEHOLE_info;                      \
     do {                                               \
       XCHG(__info,((StgClosure *)(c))->header.info);   \
-    } while (__info == &WHITEHOLE_info);               \
+    } while (__info == &stg_WHITEHOLE_info);           \
     __info;                                            \
   })
 
 #define LOCK_THUNK(__info)                             \
-  CMPXCHG(R1.cl->header.info, __info, &WHITEHOLE_info);
+  CMPXCHG(R1.cl->header.info, __info, &stg_WHITEHOLE_info);
 
 #define ACQUIRE_LOCK(mutex) pthread_mutex_lock(mutex);
 #define RELEASE_LOCK(mutex) pthread_mutex_unlock(mutex);
index 8e03d7d..b05393b 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: RtsAPI.c,v 1.24 2001/01/11 17:25:56 simonmar Exp $
+ * $Id: RtsAPI.c,v 1.25 2001/02/08 14:36:21 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2001
  *
@@ -356,7 +356,7 @@ rts_evalLazyIO (HaskellObj p, unsigned int stack_size, /*out*/HaskellObj *ret)
   return waitThread(tso, ret);
 }
 
-#if defined(PAR) || defined(SMP)
+#if defined(PAR)
 /*
   Needed in the parallel world for non-Main PEs, which do not get a piece
   of work to start with --- they have to humbly ask for it
index 8ed6fa8..3f26bef 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.hc,v 1.62 2001/01/31 10:12:08 simonmar Exp $
+ * $Id: StgMiscClosures.hc,v 1.63 2001/02/08 14:36:21 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -398,7 +398,7 @@ STGFUN(stg_BLACKHOLE_entry)
       bdescr *bd = Bdescr(R1.p);
       if (bd->back != (bdescr *)BaseReg) {
        if (bd->gen->no >= 1 || bd->step->no >= 1) {
-         CMPXCHG(R1.cl->header.info, &BLACKHOLE_info, &WHITEHOLE_info);
+         CMPXCHG(R1.cl->header.info, &stg_BLACKHOLE_info, &stg_WHITEHOLE_info);
        } else {
          EXTFUN_RTS(stg_gc_enter_1_hponly);
          JMP_(stg_gc_enter_1_hponly);
@@ -447,7 +447,7 @@ STGFUN(stg_BLACKHOLE_BQ_entry)
       bdescr *bd = Bdescr(R1.p);
       if (bd->back != (bdescr *)BaseReg) {
        if (bd->gen->no >= 1 || bd->step->no >= 1) {
-         CMPXCHG(R1.cl->header.info, &BLACKHOLE_info, &WHITEHOLE_info);
+         CMPXCHG(R1.cl->header.info, &stg_BLACKHOLE_info, &stg_WHITEHOLE_info);
        } else {
          EXTFUN_RTS(stg_gc_enter_1_hponly);
          JMP_(stg_gc_enter_1_hponly);
@@ -538,7 +538,7 @@ STGFUN(stg_CAF_BLACKHOLE_entry)
       bdescr *bd = Bdescr(R1.p);
       if (bd->back != (bdescr *)BaseReg) {
        if (bd->gen->no >= 1 || bd->step->no >= 1) {
-         CMPXCHG(R1.cl->header.info, &CAF_BLACKHOLE_info, &WHITEHOLE_info);
+         CMPXCHG(R1.cl->header.info, &stg_CAF_BLACKHOLE_info, &stg_WHITEHOLE_info);
        } else {
          EXTFUN_RTS(stg_gc_enter_1_hponly);
          JMP_(stg_gc_enter_1_hponly);
index b834df4..4f4be78 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.25 2001/01/29 17:23:41 simonmar Exp $
+ * $Id: Storage.h,v 1.26 2001/02/08 14:36:21 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -103,6 +103,13 @@ extern void markCafs( void );
 
    -------------------------------------------------------------------------- */
 
+/*
+ * Storage manager mutex
+ */
+#ifdef SMP
+extern pthread_mutex_t sm_mutex;
+#endif
+
 /* ToDo: shouldn't recordMutable and recordOldToNewPtrs acquire some
  * kind of lock in the SMP case?
  */