[project @ 2001-01-03 11:13:43 by simonmar]
[ghc-hetmet.git] / ghc / includes / Stg.h
index 4005542..4c891b7 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stg.h,v 1.29 2000/04/14 15:10:20 sewardj Exp $
+ * $Id: Stg.h,v 1.34 2000/12/04 12:31:20 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -102,13 +102,47 @@ void _stgAssert (char *, unsigned int);
 #endif /* DEBUG */
 
 /* -----------------------------------------------------------------------------
-   Include everything STG-ish
+   Global type definitions
    -------------------------------------------------------------------------- */
 
-/* Global type definitions*/
 #include "StgTypes.h"
 #include "RtsTypes.h"
 
+/* -----------------------------------------------------------------------------
+   Shorthand forms
+   -------------------------------------------------------------------------- */
+
+typedef StgChar                C_;
+typedef StgWord                W_;
+typedef StgWord*       P_;
+typedef P_*            PP_;
+typedef StgInt         I_;
+typedef StgAddr                A_;
+typedef const StgWord*  D_;
+typedef StgFunPtr       F_;
+typedef StgByteArray    B_;
+typedef StgClosurePtr   L_;
+
+typedef StgInt64        LI_;
+typedef StgWord64       LW_;
+
+/*
+ * We often want to know the size of something in units of an
+ * StgWord... (rounded up, of course!)
+ */
+
+#define sizeofW(t) ((sizeof(t)+sizeof(W_)-1)/sizeof(W_))
+
+/* 
+ * It's nice to be able to grep for casts
+ */
+
+#define stgCast(ty,e) ((ty)(e))
+
+/* -----------------------------------------------------------------------------
+   Include everything STG-ish
+   -------------------------------------------------------------------------- */
+
 /* Global constaints */
 #include "Constants.h"
 
@@ -179,12 +213,16 @@ void _stgAssert (char *, unsigned int);
 /* Runtime-system hooks */
 #include "Hooks.h"
 
+#include "HsFFI.h"
+
 /* Misc stuff without a home */
 DLL_IMPORT_RTS extern char **prog_argv;        /* so we can get at these from Haskell */
 DLL_IMPORT_RTS extern int    prog_argc;
 
 extern char **environ;
 
+extern void stackOverflow(void);
+
 /* Creating and destroying an adjustor thunk.
    I cannot make myself create a separate .h file
    for these two (sof.)