X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FStgTypes.lh;h=824f56d6f7e8cf604fe40125901e987550adedbc;hb=967cc47f37cb93a5e2b6df7822c9a646f0428247;hp=776000f7a68425b9fcafc17209a478a2e5f6240f;hpb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;p=ghc-hetmet.git diff --git a/ghc/includes/StgTypes.lh b/ghc/includes/StgTypes.lh index 776000f..824f56d 100644 --- a/ghc/includes/StgTypes.lh +++ b/ghc/includes/StgTypes.lh @@ -25,7 +25,7 @@ StgFloat & float \\ StgDouble & double \\ StgChar & unsigned char \\\hline StgStablePtr & long \\ -StgMallocPtr & (long *) \\ +StgForeignObj & (long *) \\ \end{tabular} %partain:\end{center} @@ -85,16 +85,16 @@ typedef unsigned long *StgPtr; /* StgPtr is a ptr to a heap object typedef StgPtr *StgPtrPtr; /* used for A stack pointer */ typedef long StgInt; -/* seven shorthand forms: - StgChar, StgWord, StgPtr, StgPtrPtr, StgInt, StgAddr, const StgPtr */ - -typedef unsigned char C_; -typedef unsigned long W_; -typedef unsigned long *P_; -typedef P_ *PP_; -typedef long I_; -typedef void *A_; -typedef const unsigned long *D_; +#if HAVE_LONG_LONG +/* These types are only used to allow the passing of + 64-bit ints from Haskell to ccalls and to ease + the implementation of the Int64 and Word64 libraries. +*/ +typedef unsigned long long int StgWord64; +typedef long long int StgInt64; +typedef StgInt64 LI_; +typedef StgWord64 LW_; +#endif typedef unsigned char StgChar; typedef void *StgAddr; @@ -107,13 +107,36 @@ typedef float StgFloat; typedef double StgDouble; #endif +/* seven shorthand forms: + StgChar, StgWord, StgPtr, StgPtrPtr, StgInt, StgAddr, const StgPtr */ + +typedef StgChar C_; +typedef StgWord W_; +typedef StgPtr P_; +typedef P_ *PP_; +typedef StgInt I_; +typedef void *A_; +typedef const unsigned long *D_; + +/* Typedefs for the various sized ints + (ToDo: better.) +*/ + +typedef unsigned char StgWord8; +typedef signed char StgInt8; +typedef unsigned short StgWord16; +typedef short StgInt16; +typedef unsigned int StgWord32; +typedef signed int StgInt32; + + typedef StgPtr StgArray; typedef StgChar *StgByteArray; typedef StgByteArray B_; typedef I_ StgStablePtr; /* Index into Stable Pointer Table */ -typedef P_ StgMallocPtr; /* (Probably) Pointer to object in C Heap */ -/* On any architecture, StgMallocPtr should be big enough to hold +typedef P_ StgForeignObj; /* (Probably) Pointer to object in C Heap */ +/* On any architecture, StgForeignObj should be big enough to hold the largest possible pointer. */ /* These are used to pass the do_full_collection flag to RealPerformGC @@ -231,13 +254,25 @@ typedef union __ft unpacked_float fu; } float_thing; +#if HAVE_LONG_LONG +typedef union __it + { StgInt64 i; + unpacked_double iu; + } int64_thing; + +typedef union __wt + { StgWord64 w; + unpacked_double wu; + } word64_thing; +#endif + \end{code} Also include the RTS types for the runtime system modules. \begin{code} -#include "rtsTypes.h" +#include "RtsTypes.h" #endif /* ! STGTYPES_H */ \end{code}