From: Simon Marlow Date: Fri, 14 Nov 2008 09:58:17 +0000 (+0000) Subject: refactor: move unlockClosure() into SMPClosureOps() where it should be X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9d5c9fb05b4f05d803a437cba18581d562793f43;p=ghc-hetmet.git refactor: move unlockClosure() into SMPClosureOps() where it should be --- diff --git a/includes/Cmm.h b/includes/Cmm.h index 9915830..c0b2fe9 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -301,7 +301,7 @@ #include "ClosureTypes.h" #include "StgFun.h" #include "OSThreads.h" -#include "SMP.h" +#include "SMPClosureOps.h" /* * Need MachRegs, because some of the RTS code is conditionally diff --git a/includes/SMP.h b/includes/SMP.h index e3b4cd5..bf23e08 100644 --- a/includes/SMP.h +++ b/includes/SMP.h @@ -16,14 +16,6 @@ * Unregisterised builds are ok, but only 1 CPU supported. */ -#ifdef CMINUSMINUS - -#define unlockClosure(ptr,info) \ - prim %write_barrier() []; \ - StgHeader_info(ptr) = info; - -#else - #if defined(THREADED_RTS) #if defined(TICKY_TICKY) @@ -203,6 +195,4 @@ xchg(StgPtr p, StgWord w) #endif /* !THREADED_RTS */ -#endif /* CMINUSMINUS */ - #endif /* SMP_H */ diff --git a/includes/SMPClosureOps.h b/includes/SMPClosureOps.h index a43222d..f46dbde 100644 --- a/includes/SMPClosureOps.h +++ b/includes/SMPClosureOps.h @@ -9,6 +9,14 @@ #ifndef SMPCLOSUREOPS_H #define SMPCLOSUREOPS_H +#ifdef CMINUSMINUS + +#define unlockClosure(ptr,info) \ + prim %write_barrier() []; \ + StgHeader_info(ptr) = info; + +#else + EXTERN_INLINE StgInfoTable *lockClosure(StgClosure *p); EXTERN_INLINE void unlockClosure(StgClosure *p, const StgInfoTable *info); @@ -65,4 +73,6 @@ EXTERN_INLINE void unlockTSO(StgTSO *tso); EXTERN_INLINE void unlockTSO(StgTSO *tso) { unlockClosure((StgClosure*)tso, (const StgInfoTable *)&stg_TSO_info); } +#endif /* CMINUSMINUS */ + #endif /* SMPCLOSUREOPS_H */