X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FSMP.h;h=f574ec8100a97f9da7790b3d9425168b8fb6f8b4;hb=16887826bafb60d504f925d4aa09236c65d01121;hp=74fbf9ad2d8b993f98d05e9257b4682fe8ce7463;hpb=4c1a1e3013f92c3dc05c91fa87dd51b1f7e143f8;p=ghc-hetmet.git diff --git a/includes/SMP.h b/includes/SMP.h index 74fbf9a..f574ec8 100644 --- a/includes/SMP.h +++ b/includes/SMP.h @@ -16,6 +16,14 @@ * 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) @@ -175,7 +183,15 @@ write_barrier(void) { #define SPIN_COUNT 4000 -INLINE_HEADER StgInfoTable * +#ifdef KEEP_LOCKCLOSURE +// We want a callable copy of lockClosure() so that we can refer to it +// from .cmm files compiled using the native codegen. +extern StgInfoTable *lockClosure(StgClosure *p); +INLINE_ME +#else +INLINE_HEADER +#endif +StgInfoTable * lockClosure(StgClosure *p) { StgWord info; @@ -323,3 +339,5 @@ INLINE_HEADER void unlockTSO(StgTSO *tso) { unlockClosure((StgClosure*)tso, (StgInfoTable*)&stg_TSO_info); } #endif /* SMP_H */ + +#endif /* CMINUSMINUS */