From: simonmar Date: Tue, 22 Oct 2002 11:01:20 +0000 (+0000) Subject: [project @ 2002-10-22 11:01:18 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1525 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b7129526ec3cd30f39040982ebba7d7d3b0d76cf;p=ghc-hetmet.git [project @ 2002-10-22 11:01:18 by simonmar] change the types of cmp_thread, rts_getThreadId, and labelThread to take StgPtr rather than StgTSO *, since the compiler now has no distinction between these two types in the back end. I also noticed that labelThread need not be a primitive: it could just as well be a normal C function called by the FFI, but I haven't made that change. --- diff --git a/ghc/includes/PrimOps.h b/ghc/includes/PrimOps.h index a43105e..0e4ee74 100644 --- a/ghc/includes/PrimOps.h +++ b/ghc/includes/PrimOps.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.h,v 1.98 2002/10/18 09:51:04 simonmar Exp $ + * $Id: PrimOps.h,v 1.99 2002/10/22 11:01:18 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -276,10 +276,8 @@ EXTFUN_RTS(unblockAsyncExceptionszh_fast); EXTFUN_RTS(myThreadIdzh_fast); EXTFUN_RTS(labelThreadzh_fast); -extern int cmp_thread(const StgTSO *tso1, const StgTSO *tso2); -extern int rts_getThreadId(const StgTSO *tso); -extern void labelThread(StgTSO *tso, char *label); - +extern int cmp_thread(StgPtr tso1, StgPtr tso2); +extern int rts_getThreadId(StgPtr tso); /* ----------------------------------------------------------------------------- Weak Pointer PrimOps. diff --git a/ghc/rts/PrimOps.hc b/ghc/rts/PrimOps.hc index 9320708..a860dc8 100644 --- a/ghc/rts/PrimOps.hc +++ b/ghc/rts/PrimOps.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.hc,v 1.101 2002/10/18 09:51:03 simonmar Exp $ + * $Id: PrimOps.hc,v 1.102 2002/10/22 11:01:19 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -1123,7 +1123,7 @@ FN_(labelThreadzh_fast) R1.p = ThreadId# R2.p = Addr# */ #ifdef DEBUG - STGCALL2(labelThread,(StgTSO *)R1.p,(char *)R2.p); + STGCALL2(labelThread,R1.p,(char *)R2.p); #endif JMP_(ENTRY_CODE(Sp[0])); FE_ diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 9759b55..17c7e74 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.156 2002/09/25 14:46:31 simonmar Exp $ + * $Id: Schedule.c,v 1.157 2002/10/22 11:01:19 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -1657,10 +1657,11 @@ static void unblockThread(StgTSO *tso); * instances of Eq/Ord for ThreadIds. * ------------------------------------------------------------------------ */ -int cmp_thread(const StgTSO *tso1, const StgTSO *tso2) +int +cmp_thread(StgPtr tso1, StgPtr tso2) { - StgThreadID id1 = tso1->id; - StgThreadID id2 = tso2->id; + StgThreadID id1 = ((StgTSO *)tso1)->id; + StgThreadID id2 = ((StgTSO *)tso2)->id; if (id1 < id2) return (-1); if (id1 > id2) return 1; @@ -1672,13 +1673,15 @@ int cmp_thread(const StgTSO *tso1, const StgTSO *tso2) * * This is used in the implementation of Show for ThreadIds. * ------------------------------------------------------------------------ */ -int rts_getThreadId(const StgTSO *tso) +int +rts_getThreadId(StgPtr tso) { - return tso->id; + return ((StgTSO *)tso)->id; } #ifdef DEBUG -void labelThread(StgTSO *tso, char *label) +void +labelThread(StgPtr tso, char *label) { int len; void *buf; diff --git a/ghc/rts/Schedule.h b/ghc/rts/Schedule.h index 7722802..85bece5 100644 --- a/ghc/rts/Schedule.h +++ b/ghc/rts/Schedule.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Schedule.h,v 1.35 2002/07/25 18:37:00 sof Exp $ + * $Id: Schedule.h,v 1.36 2002/10/22 11:01:20 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -197,6 +197,8 @@ void print_bq (StgClosure *node); void print_bqe (StgBlockingQueueElement *bqe); #endif +void labelThread(StgPtr tso, char *label); + /* ----------------------------------------------------------------------------- * Some convenient macros... */