diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-06-26 21:10:58 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-06-26 21:10:58 +0000 |
commit | 16ed3e3cd3ba05ae7222f8da2c80f8294540817d (patch) | |
tree | 1d7a5e64f6f9c498a0801bd724a7eb46a7d6110e /includes/SMP.h | |
parent | bf3339dd17b16dcc13212cd016a7c44a58183336 (diff) | |
download | haskell-16ed3e3cd3ba05ae7222f8da2c80f8294540817d.tar.gz |
Make the threaded RTS compilable using -fasm
We needed to turn some inline C functions and C macros into either
real C functions or C-- macros.
Diffstat (limited to 'includes/SMP.h')
-rw-r--r-- | includes/SMP.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/includes/SMP.h b/includes/SMP.h index 74fbf9ad2d..f574ec8100 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 */ |