From f832c312c2a879f98da09cf261ce4f8cb63259eb Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 8 Feb 2001 14:36:21 +0000 Subject: [PATCH] [project @ 2001-02-08 14:36:21 by simonmar] Fix bitrot in SMP code. --- ghc/includes/SMP.h | 8 ++++---- ghc/rts/RtsAPI.c | 4 ++-- ghc/rts/StgMiscClosures.hc | 8 ++++---- ghc/rts/Storage.h | 9 ++++++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ghc/includes/SMP.h b/ghc/includes/SMP.h index fa24798..3a31d96 100644 --- a/ghc/includes/SMP.h +++ b/ghc/includes/SMP.h @@ -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 * @@ -66,15 +66,15 @@ #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); diff --git a/ghc/rts/RtsAPI.c b/ghc/rts/RtsAPI.c index 8e03d7d..b05393b 100644 --- a/ghc/rts/RtsAPI.c +++ b/ghc/rts/RtsAPI.c @@ -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 diff --git a/ghc/rts/StgMiscClosures.hc b/ghc/rts/StgMiscClosures.hc index 8ed6fa8..3f26bef 100644 --- a/ghc/rts/StgMiscClosures.hc +++ b/ghc/rts/StgMiscClosures.hc @@ -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); diff --git a/ghc/rts/Storage.h b/ghc/rts/Storage.h index b834df4..4f4be78 100644 --- a/ghc/rts/Storage.h +++ b/ghc/rts/Storage.h @@ -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? */ -- 1.7.10.4