summaryrefslogtreecommitdiff
path: root/ghc/includes/Stg.h
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/includes/Stg.h')
-rw-r--r--ghc/includes/Stg.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/ghc/includes/Stg.h b/ghc/includes/Stg.h
index 9b2ab0d5c0..756e8fb51a 100644
--- a/ghc/includes/Stg.h
+++ b/ghc/includes/Stg.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Stg.h,v 1.17 1999/07/06 09:42:39 sof Exp $
+ * $Id: Stg.h,v 1.18 1999/11/02 15:05:52 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
@@ -16,6 +16,17 @@
#define _POSIX_SOURCE
#endif
+/* If we include "Stg.h" directly, we're in STG code, and we therefore
+ * get all the global register variables, macros etc. that go along
+ * with that. If "Stg.h" is included via "Rts.h", we're assumed to
+ * be in vanilla C.
+ */
+#ifdef NOT_IN_STG_CODE
+#define NO_REGS /* don't define fixed registers */
+#else
+#define IN_STG_CODE
+#endif
+
/* Configuration */
#include "config.h"
#ifdef __HUGS__ /* vile hack till the GHC folks come on board */
@@ -33,13 +44,17 @@
* For now, do lazy and not eager.
*/
-#define LAZY_BLACKHOLING
-/* #define EAGER_BLACKHOLING */
-
-#ifdef TICKY_TICKY
-/* TICKY_TICKY needs EAGER_BLACKHOLING to verify no double-entries of single-entry thunks. */
-# undef LAZY_BLACKHOLING
-# define EAGER_BLACKHOLING
+/* TICKY_TICKY needs EAGER_BLACKHOLING to verify no double-entries of
+ * single-entry thunks.
+ *
+ * SMP needs EAGER_BLACKHOLING because it has to lock thunks
+ * synchronously, in case another thread is trying to evaluate the
+ * same thunk simultaneously.
+ */
+#if defined(SMP) || defined(TICKY_TICKY)
+# define EAGER_BLACKHOLING
+#else
+# define LAZY_BLACKHOLING
#endif
/* ToDo: Set this flag properly: COMPILER and INTERPRETER should not be mutually exclusive. */
@@ -96,8 +111,10 @@ void _stgAssert (char *, unsigned int);
#include "ClosureTypes.h"
#include "InfoTables.h"
#include "TSO.h"
+#include "Block.h"
/* STG/Optimised-C related stuff */
+#include "SMP.h"
#include "MachRegs.h"
#include "Regs.h"
#include "TailCalls.h"
@@ -121,6 +138,10 @@ void _stgAssert (char *, unsigned int);
#include <unistd.h>
#endif
+#ifdef SMP
+#include <pthread.h>
+#endif
+
/* GNU mp library */
#include "gmp.h"