summaryrefslogtreecommitdiff
path: root/ghc/includes/Cmm.h
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-04-22 09:32:40 +0000
committersimonmar <unknown>2005-04-22 09:32:40 +0000
commit0f3205e6c40575910d50bc2cc42020ccf55e07ba (patch)
tree03fa3c951bb7b2e37963469608acd8548abfa1d9 /ghc/includes/Cmm.h
parentb43be28258a3d49bde40095b210047e99742f8a5 (diff)
downloadhaskell-0f3205e6c40575910d50bc2cc42020ccf55e07ba.tar.gz
[project @ 2005-04-22 09:32:39 by simonmar]
SMP: the rest of the changes to support safe thunk entry & updates. I thought the compiler changes were independent, but I ended up breaking the HEAD, so I'll have to commit the rest. non-SMP compilation should not be affected.
Diffstat (limited to 'ghc/includes/Cmm.h')
-rw-r--r--ghc/includes/Cmm.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ghc/includes/Cmm.h b/ghc/includes/Cmm.h
index ff361962f3..e4f44d6033 100644
--- a/ghc/includes/Cmm.h
+++ b/ghc/includes/Cmm.h
@@ -325,6 +325,26 @@
}
/* -----------------------------------------------------------------------------
+ Closure headers
+ -------------------------------------------------------------------------- */
+
+/*
+ * This is really ugly, since we don't do the rest of StgHeader this
+ * way. The problem is that values from DerivedConstants.h cannot be
+ * dependent on the way (SMP, PROF etc.). For SIZEOF_StgHeader we get
+ * the value from GHC, but it seems like too much trouble to do that
+ * for StgThunkHeader.
+ */
+#ifdef SMP
+#define SIZEOF_StgThunkHeader SIZEOF_StgHeader+SIZEOF_StgSMPThunkHeader
+#else
+#define SIZEOF_StgThunkHeader SIZEOF_StgHeader
+#endif
+
+#define StgThunk_payload(__ptr__,__ix__) \
+ W_[__ptr__+SIZEOF_StgThunkHeader+ WDS(__ix__)]
+
+/* -----------------------------------------------------------------------------
Closures
-------------------------------------------------------------------------- */