X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2FmkNativeHdr.c;h=d078055bf5a5647aeef02b77cc845091fb08e1a8;hb=553e90d9a32ee1b1809430f260c401cc4169c6c7;hp=7b2bebd8eb264c99715f410bdee9d6aafe12f952;hpb=0671ef05dd65137d501cb97f0e42be3b78d4004d;p=ghc-hetmet.git diff --git a/ghc/includes/mkNativeHdr.c b/ghc/includes/mkNativeHdr.c index 7b2bebd..d078055 100644 --- a/ghc/includes/mkNativeHdr.c +++ b/ghc/includes/mkNativeHdr.c @@ -1,5 +1,5 @@ /* -------------------------------------------------------------------------- - * $Id: mkNativeHdr.c,v 1.6 2001/11/08 12:46:31 simonmar 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,7 +31,6 @@ #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) @@ -39,17 +40,17 @@ #define FUN_OFFSET(sym) ((StgPtr)&cap.f.sym - (StgPtr)&cap.r) -#define OFFSET_stgChk0 FUN_OFFSET(stgChk0) -#define OFFSET_stgChk1 FUN_OFFSET(stgChk1) #define OFFSET_stgGCEnter1 FUN_OFFSET(stgGCEnter1) -#define OFFSET_stgUpdatePAP FUN_OFFSET(stgUpdatePAP) +#define OFFSET_stgGCFun FUN_OFFSET(stgGCFun) + +#define OFFW_Capability_r OFFSET(cap, cap.r) #define TSO_SP OFFSET(tso, tso.sp) -#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; @@ -85,7 +86,6 @@ 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); @@ -93,27 +93,25 @@ main() printf("#define OFFSET_CurrentNursery %d\n", OFFSET_CurrentNursery); printf("#define OFFSET_HpAlloc %d\n", OFFSET_HpAlloc); - printf("#define OFFSET_stgChk0 (%d)\n", OFFSET_stgChk0); - printf("#define OFFSET_stgChk1 (%d)\n", OFFSET_stgChk1); printf("#define OFFSET_stgGCEnter1 (%d)\n", OFFSET_stgGCEnter1); - printf("#define OFFSET_stgUpdatePAP (%d)\n", OFFSET_stgUpdatePAP); + 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_STACK %d\n", TSO_STACK); printf("\n-- Block descriptor offsets for the Native Code Generator\n"); printf("#define BDESCR_START %d\n", BDESCR_START); printf("#define BDESCR_FREE %d\n", BDESCR_FREE); - - printf("\n-- FILE size for the Native Code Generator\n"); - - printf("#define FILE_SIZE %d\n", sizeof(*stdin)); + printf("#define BDESCR_BLOCKS %d\n", BDESCR_BLOCKS); exit(0); }