summaryrefslogtreecommitdiff
path: root/includes/Cmm.h
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-06-29 13:47:26 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-06-29 13:47:26 +0000
commit73566e25d75588185b0581722406da5c48965c51 (patch)
tree5b44477006e139b0b5331c3c94af62afa8b53bc0 /includes/Cmm.h
parent6bf790bab31b9bb8791e2adc46c8ff511392419f (diff)
downloadhaskell-73566e25d75588185b0581722406da5c48965c51.tar.gz
Replace inline C functions with C-- macros in .cmm code
So that we can build the RTS with the NCG.
Diffstat (limited to 'includes/Cmm.h')
-rw-r--r--includes/Cmm.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index d95002c5af..e494b60102 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -514,4 +514,32 @@
#define TICK_MILLISECS (1000/TICK_FREQUENCY) /* ms per tick */
+#define NO_TREC stg_NO_TREC_closure
+#define END_TSO_QUEUE stg_END_TSO_QUEUE_closure
+
+#define dirtyTSO(tso) \
+ StgTSO_flags(tso) = StgTSO_flags(tso) | TSO_DIRTY::I32;
+
+#define recordMutableCap(p, gen, regs) \
+ W_ __bd; \
+ W_ mut_list; \
+ mut_list = Capability_mut_lists(MyCapability()) + WDS(gen); \
+ __bd = W_[mut_list]; \
+ if (bdescr_free(__bd) >= bdescr_start(__bd) + BLOCK_SIZE) { \
+ W_ __new_bd; \
+ "ptr" __new_bd = foreign "C" allocBlock_lock() [regs]; \
+ bdescr_link(__new_bd) = __bd; \
+ __bd = __new_bd; \
+ W_[mut_list] = __bd; \
+ } \
+ W_ free; \
+ free = bdescr_free(__bd); \
+ W_[free] = p; \
+ bdescr_free(__bd) = free + WDS(1);
+
+#define recordMutable(p, regs) \
+ W_ __p; \
+ __p = p; \
+ recordMutableCap(__p, TO_W_(bdescr_gen_no(Bdescr(__p))), regs)
+
#endif /* CMM_H */