X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=includes%2FRegs.h;h=0f974ec4ad029f25a10bbcfc750360d36358b540;hp=bd7cb5325544adaa79fa1a90163de22a542c2cf8;hb=842e9d6628a27cf1f420d53f6a5901935dc50c54;hpb=1e3d53b4707a6c9c7c99cdaa54e3646b840f5cc9 diff --git a/includes/Regs.h b/includes/Regs.h index bd7cb53..0f974ec 100644 --- a/includes/Regs.h +++ b/includes/Regs.h @@ -22,8 +22,6 @@ #ifndef REGS_H #define REGS_H -#include "gmp.h" // Needs MP_INT definition - /* * Spark pools: used to store pending sparks * (THREADED_RTS & PARALLEL_HASKELL only) @@ -73,6 +71,11 @@ typedef union { StgTSOPtr t; } StgUnion; +// Urgh.. we don't know the size of an MP_INT here because we haven't +// #included gmp.h. We should really autoconf this, but GMP may not +// be available at ./configure time if we're building it (GMP) locally. +#define MP_INT_WORDS 3 + /* * This is the table that holds shadow-locations for all the STG * registers. The shadow locations are used when: @@ -111,15 +114,13 @@ typedef struct StgRegTable_ { // rmp_tmp1..rmp_result2 are only used in THREADED_RTS builds to // avoid per-thread temps in bss, but currently always incldue here // so we just run mkDerivedConstants once - StgWord rmp_tmp_w; - MP_INT rmp_tmp1; - MP_INT rmp_tmp2; - MP_INT rmp_result1; - MP_INT rmp_result2; + StgWord rmp_tmp_w[MP_INT_WORDS]; + StgWord rmp_tmp1[MP_INT_WORDS]; + StgWord rmp_tmp2[MP_INT_WORDS]; + StgWord rmp_result1[MP_INT_WORDS]; + StgWord rmp_result2[MP_INT_WORDS]; StgWord rRet; // holds the return code of the thread -#if defined(THREADED_RTS) || defined(PAR) StgSparkPool rSparks; /* per-task spark pool */ -#endif } StgRegTable; #if IN_STG_CODE @@ -335,7 +336,7 @@ struct PartCapability_ { /* No such thing as a MainCapability under THREADED_RTS - each thread must have * its own Capability. */ -#if IN_STG_CODE && !defined(THREADED_RTS) +#if IN_STG_CODE && !(defined(THREADED_RTS) && !defined(NOSMP)) extern W_ MainCapability[]; #endif @@ -351,7 +352,7 @@ extern W_ MainCapability[]; GLOBAL_REG_DECL(StgRegTable *,BaseReg,REG_Base) #define ASSIGN_BaseReg(e) (BaseReg = (e)) #else -#ifdef THREADED_RTS +#if defined(THREADED_RTS) && !defined(NOSMP) #error BaseReg must be in a register for THREADED_RTS #endif #define BaseReg (&((struct PartCapability_ *)MainCapability)->r)