X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FRegs.h;h=f1b8597d60e066d7e91c0df604fd27d29c617af8;hb=84b434c5c07ce864353cdf9780873555daad3b47;hp=10e0b3fbdaa3d8d60e2377f289c371191939e1e3;hpb=03dc2dd3dd814ad85cc4c45e9cafc7b73163c8be;p=ghc-hetmet.git diff --git a/ghc/includes/Regs.h b/ghc/includes/Regs.h index 10e0b3f..f1b8597 100644 --- a/ghc/includes/Regs.h +++ b/ghc/includes/Regs.h @@ -22,6 +22,7 @@ #ifndef REGS_H #define REGS_H +#include "gmp.h" // Needs MP_INT definition /* * This is the table that holds shadow-locations for all the STG @@ -86,39 +87,23 @@ typedef struct StgRegTable_ { StgPtr rHp; StgPtr rHpLim; struct StgTSO_ *rCurrentTSO; - struct bdescr_ *rNursery; - struct bdescr_ *rCurrentNursery; + struct step_ *rNursery; + struct bdescr_ *rCurrentNursery; /* Hp/HpLim point into this block */ + struct bdescr_ *rCurrentAlloc; /* for allocation using allocate() */ StgWord rHpAlloc; /* number of *bytes* being allocated in heap */ + // rmp_tmp1..rmp_result2 are only used in SMP builds to avoid per-thread temps + // in bss, but currently always incldue here so we just run mkDerivedConstants once + StgInt rmp_tmp_w; + MP_INT rmp_tmp1; + MP_INT rmp_tmp2; + MP_INT rmp_result1; + MP_INT rmp_result2; + StgWord rRet; // holds the return code of the thread #if defined(SMP) || defined(PAR) - StgSparkPool rSparks; /* per-task spark pool */ + StgSparkPool rSparks; /* per-task spark pool */ #endif } StgRegTable; - -/* A capability is a combination of a FunTable and a RegTable. In STG - * code, BaseReg normally points to the RegTable portion of this - * structure, so that we can index both forwards and backwards to take - * advantage of shorter instruction forms on some archs (eg. x86). - */ -typedef struct Capability_ { - StgFunTable f; - StgRegTable r; -#if defined(SMP) - struct Capability_ *link; /* per-task register tables are linked together */ -#endif -} Capability; - -/* No such thing as a MainCapability under SMP - each thread must have - * its own Capability. - */ -#ifndef SMP -#if IN_STG_CODE -extern W_ MainCapability[]; -#else -extern DLL_IMPORT_RTS Capability MainCapability; -#endif -#endif - #if IN_STG_CODE /* @@ -317,13 +302,32 @@ GLOBAL_REG_DECL(StgWord64,L1,REG_L1) * concurrent Haskell, MainRegTable otherwise). */ +/* A capability is a combination of a FunTable and a RegTable. In STG + * code, BaseReg normally points to the RegTable portion of this + * structure, so that we can index both forwards and backwards to take + * advantage of shorter instruction forms on some archs (eg. x86). + * This is a cut-down version of the Capability structure; the full + * version is defined in Capability.h. + */ +struct PartCapability_ { + StgFunTable f; + StgRegTable r; +}; + +/* No such thing as a MainCapability under SMP - each thread must have + * its own Capability. + */ +#if IN_STG_CODE && !defined(SMP) +extern W_ MainCapability[]; +#endif + #if defined(REG_Base) && !defined(NO_GLOBAL_REG_DECLS) GLOBAL_REG_DECL(StgRegTable *,BaseReg,REG_Base) #else #ifdef SMP #error BaseReg must be in a register for SMP #endif -#define BaseReg (&((Capability *)MainCapability)[0].r) +#define BaseReg (&((struct PartCapability_ *)MainCapability)->r) #endif #if defined(REG_Sp) && !defined(NO_GLOBAL_REG_DECLS)