X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FmkNativeHdr.c;h=d078055bf5a5647aeef02b77cc845091fb08e1a8;hb=553e90d9a32ee1b1809430f260c401cc4169c6c7;hp=d9d8a9507ab0003175b875c4b33906496935da9c;hpb=474abb9a731838fdfd967cd457e9a0877f998b98;p=ghc-hetmet.git diff --git a/ghc/includes/mkNativeHdr.c b/ghc/includes/mkNativeHdr.c index d9d8a95..d078055 100644 --- a/ghc/includes/mkNativeHdr.c +++ b/ghc/includes/mkNativeHdr.c @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- - * $Id: mkNativeHdr.c,v 1.3 2000/01/25 18:09:52 sewardj Exp $ + * $Id: mkNativeHdr.c,v 1.12 2003/03/21 15:48:06 sof Exp $ * * (c) The GHC Team, 1992-1998 * @@ -9,6 +9,8 @@ #include "Stg.h" +#include + #define OFFSET(table, x) ((StgUnion *) &(x) - (StgUnion *) (&table)) #define OFFSET_R1 OFFSET(RegTable, RegTable.rR1) @@ -29,17 +31,33 @@ #define OFFSET_D2 OFFSET(RegTable, RegTable.rD2) #define OFFSET_L1 OFFSET(RegTable, RegTable.rL1) #define OFFSET_Sp OFFSET(RegTable, RegTable.rSp) -#define OFFSET_Su OFFSET(RegTable, RegTable.rSu) #define OFFSET_SpLim OFFSET(RegTable, RegTable.rSpLim) #define OFFSET_Hp OFFSET(RegTable, RegTable.rHp) #define OFFSET_HpLim OFFSET(RegTable, RegTable.rHpLim) +#define OFFSET_CurrentTSO OFFSET(RegTable, RegTable.rCurrentTSO) +#define OFFSET_CurrentNursery OFFSET(RegTable, RegTable.rCurrentNursery) +#define OFFSET_HpAlloc OFFSET(RegTable, RegTable.rHpAlloc) + +#define FUN_OFFSET(sym) ((StgPtr)&cap.f.sym - (StgPtr)&cap.r) + +#define OFFSET_stgGCEnter1 FUN_OFFSET(stgGCEnter1) +#define OFFSET_stgGCFun FUN_OFFSET(stgGCFun) + +#define OFFW_Capability_r OFFSET(cap, cap.r) #define TSO_SP OFFSET(tso, tso.sp) -#define TSO_SPLIM OFFSET(tso, tso.splim) -#define TSO_SU OFFSET(tso, tso.su) +#define TSO_STACK OFFSET(tso, tso.stack) + +#define BDESCR_START OFFSET(bd, bd.start) +#define BDESCR_FREE OFFSET(bd, bd.free) +#define BDESCR_BLOCKS OFFSET(bd, bd.blocks) StgRegTable RegTable; + +Capability cap; + StgTSO tso; +bdescr bd; int main() @@ -68,22 +86,32 @@ main() printf("#define OFFSET_L1 %d\n", OFFSET_L1); #endif printf("#define OFFSET_Sp %d\n", OFFSET_Sp); - printf("#define OFFSET_Su %d\n", OFFSET_Su); printf("#define OFFSET_SpLim %d\n", OFFSET_SpLim); printf("#define OFFSET_Hp %d\n", OFFSET_Hp); printf("#define OFFSET_HpLim %d\n", OFFSET_HpLim); + printf("#define OFFSET_CurrentTSO %d\n", OFFSET_CurrentTSO); + printf("#define OFFSET_CurrentNursery %d\n", OFFSET_CurrentNursery); + printf("#define OFFSET_HpAlloc %d\n", OFFSET_HpAlloc); + + printf("#define OFFSET_stgGCEnter1 (%d)\n", OFFSET_stgGCEnter1); + printf("#define OFFSET_stgGCFun (%d)\n", OFFSET_stgGCFun); + + printf("\n-- Offset of the .r (StgRegTable) field in a Capability\n"); + + printf("#define OFFW_Capability_r (%d)\n", OFFW_Capability_r); printf("\n-- Storage Manager offsets for the Native Code Generator\n"); printf("\n-- TSO offsets for the Native Code Generator\n"); printf("#define TSO_SP %d\n", TSO_SP); - printf("#define TSO_SU %d\n", TSO_SU); - printf("#define TSO_SPLIM %d\n", TSO_SPLIM); + printf("#define TSO_STACK %d\n", TSO_STACK); - printf("\n-- FILE size for the Native Code Generator\n"); + printf("\n-- Block descriptor offsets for the Native Code Generator\n"); - printf("#define FILE_SIZE %d\n", sizeof(*stdin)); + printf("#define BDESCR_START %d\n", BDESCR_START); + printf("#define BDESCR_FREE %d\n", BDESCR_FREE); + printf("#define BDESCR_BLOCKS %d\n", BDESCR_BLOCKS); exit(0); }