X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FRts.h;h=0caccc77d81d33186033dc4d2dd5cfcf3b285aef;hb=1bca92d715d8b358ee83ff5ee0bc085bec063e59;hp=eba8146fd2efd9284c3e7ffbca0ca869e036a93b;hpb=6015a94f9108a502150565577b66c23650796639;p=ghc-hetmet.git diff --git a/includes/Rts.h b/includes/Rts.h index eba8146..0caccc7 100644 --- a/includes/Rts.h +++ b/includes/Rts.h @@ -18,6 +18,9 @@ extern "C" { #endif #include "Stg.h" +// ToDo: move RtsExternal stuff elsewhere +#include "RtsExternal.h" + // Turn off inlining when debugging - it obfuscates things #ifdef DEBUG # undef STATIC_INLINE @@ -35,6 +38,12 @@ extern "C" { #define FLEXIBLE_ARRAY 0 #endif +#if __GNUC__ >= 3 +#define ATTRIBUTE_ALIGNED(n) __attribute__((aligned(n))) +#else +#define ATTRIBUTE_ALIGNED(n) /*nothing*/ +#endif + /* Fix for mingw stat problem (done here so it's early enough) */ #ifdef mingw32_HOST_OS #define __MSVCRT__ 1 @@ -48,7 +57,9 @@ extern "C" { * 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_)) +#define ROUNDUP_BYTES_TO_WDS(n) (((n) + sizeof(W_) - 1) / sizeof(W_)) + +#define sizeofW(t) ROUNDUP_BYTES_TO_WDS(sizeof(t)) /* * It's nice to be able to grep for casts @@ -159,13 +170,10 @@ TAG_CLOSURE(StgWord tag,StgClosure * p) /* Info tables, closures & code fragments defined in the RTS */ #include "StgMiscClosures.h" -/* Simulated-parallel information */ -#include "GranSim.h" - /* Parallel information */ -#include "Parallel.h" #include "OSThreads.h" -#include "SMP.h" +#include "SMPClosureOps.h" +#include "SpinLock.h" /* GNU mp library */ #if defined(HAVE_FRAMEWORK_GMP) @@ -178,9 +186,6 @@ TAG_CLOSURE(StgWord tag,StgClosure * p) #include "Block.h" #include "ClosureMacros.h" - /* Ticky-ticky counters */ -#include "TickyCounters.h" - /* Runtime-system hooks */ #include "Hooks.h" #include "RtsMessages.h" @@ -201,7 +206,8 @@ DLL_IMPORT_RTS extern char *prog_name; extern void stackOverflow(void); extern void __decodeDouble (MP_INT *man, I_ *_exp, StgDouble dbl); -extern void __decodeFloat (MP_INT *man, I_ *_exp, StgFloat flt); +extern void __decodeDouble_2Int (I_ *man_sign, W_ *man_high, W_ *man_low, I_ *exp, StgDouble dbl); +extern void __decodeFloat_Int (I_ *man, I_ *exp, StgFloat flt); #if defined(WANT_DOTNET_SUPPORT) #include "DNInvoke.h" @@ -258,7 +264,11 @@ TICK_VAR(2) -------------------------------------------------------------------------- */ #ifdef DEBUG +#if IN_STG_CODE +#define IF_DEBUG(c,s) if (RtsFlags[0].DebugFlags.c) { s; } +#else #define IF_DEBUG(c,s) if (RtsFlags.DebugFlags.c) { s; } +#endif #else #define IF_DEBUG(c,s) doNothing() #endif @@ -269,18 +279,6 @@ TICK_VAR(2) #define DEBUG_ONLY(s) doNothing() #endif -#if defined(GRAN) && defined(DEBUG) -#define IF_GRAN_DEBUG(c,s) if (RtsFlags.GranFlags.Debug.c) { s; } -#else -#define IF_GRAN_DEBUG(c,s) doNothing() -#endif - -#if defined(PAR) && defined(DEBUG) -#define IF_PAR_DEBUG(c,s) if (RtsFlags.ParFlags.Debug.c) { s; } -#else -#define IF_PAR_DEBUG(c,s) doNothing() -#endif - /* ----------------------------------------------------------------------------- Useful macros and inline functions -------------------------------------------------------------------------- */