[project @ 2004-08-13 13:04:50 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgTypes.h
index 6ceb80c..ae9eec5 100644 (file)
@@ -1,10 +1,9 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.15 2000/11/07 17:05:47 simonmar Exp $
  *
- * (c) The GHC Team, 1998-2000
+ * (c) The GHC Team, 1998-2004
  *
  * Various C datatypes used in the run-time system.  This is the
- * lowest-level include file (after config.h).
+ * lowest-level include file, after ghcconfig.h and RtsConfig.h.
  *
  * This module should define types *only*, all beginning with "Stg".
  *
@@ -25,9 +24,9 @@
        StgCode, StgArray, StgByteArray, StgStablePtr, StgFunPtr,
        StgUnion.
 
- * WARNING: Keep this file and HsFFI.h in synch!
+ * WARNING: Keep this file, MachDeps.h, and HsFFI.h in synch!
  *
- * NOTE: assumes #include "config.h"
+ * NOTE: assumes #include "ghcconfig.h"
  * 
  * Works with or without _POSIX_SOURCE.
  *
@@ -57,19 +56,15 @@ typedef unsigned int             StgWord32;
 #error GHC untested on this architecture: sizeof(unsigned int) != 4
 #endif
 
-/* This #define controls whether we need to support long longs on a particular
- * platform. 
- *
- * ToDo: find a proper home for (derived) configuration information like this.
- */
-#if HAVE_LONG_LONG && SIZEOF_VOID_P < 8
-#define SUPPORT_LONG_LONGS
-#endif
-
 #ifdef SUPPORT_LONG_LONGS
 /* assume long long is 64 bits */
+# ifndef _MSC_VER
 typedef signed long long int   StgInt64;
 typedef unsigned long long int StgWord64;
+# else
+typedef __int64 StgInt64;
+typedef unsigned __int64 StgWord64;
+# endif
 #elif SIZEOF_LONG == 8
 typedef signed   long          StgInt64;
 typedef unsigned long          StgWord64;
@@ -88,15 +83,19 @@ typedef unsigned __int64       StgWord64;
 #if SIZEOF_VOID_P == 8
 typedef StgInt64           StgInt;
 typedef StgWord64          StgWord;
+typedef StgWord32          StgHalfWord;
 #else
 #if SIZEOF_VOID_P == 4
 typedef StgInt32           StgInt; 
 typedef StgWord32          StgWord;
+typedef StgWord16          StgHalfWord;
 #else
 #error GHC untested on this architecture: sizeof(void *) != 4 or 8
 #endif
 #endif
 
+#define W_MASK  (sizeof(W_)-1)
+
 typedef void*              StgAddr;
 
 /*
@@ -148,18 +147,4 @@ typedef void*                 StgStablePtr;
 typedef void  *(*(*StgFunPtr)(void))(void);
 typedef StgFunPtr StgFun(void);
 
-typedef union {
-    StgWord        w;
-    StgAddr        a;
-    StgChar        c;
-    StgInt8        i8;
-    StgFloat       f;
-    StgInt         i;
-    StgPtr         p;
-    StgClosurePtr  cl;
-    StgStackOffset offset;     /* unused? */
-    StgByteArray   b;
-    StgTSOPtr      t;
-} StgUnion;
-
 #endif /* STGTYPES_H */