aRR_WORDS_HDR_SIZE,
aRR_PTRS_HDR_SIZE,
rESERVED_C_STACK_BYTES,
+ rESERVED_STACK_WORDS,
sTD_ITBL_SIZE,
pROF_ITBL_SIZE,
rESERVED_C_STACK_BYTES = (RESERVED_C_STACK_BYTES :: Int)
\end{code}
+The amount of (Haskell) stack to leave free for saving registers when
+returning to the scheduler.
+
+\begin{code}
+rESERVED_STACK_WORDS = (RESERVED_STACK_WORDS :: Int)
+\end{code}
+
Size of a word, in bytes
\begin{code}
import PrimOp ( PrimOp(..), CCall(..), CCallTarget(..) )
import PrimRep ( PrimRep(..), isFloatingRep )
import UniqSupply ( returnUs, thenUs, getUniqueUs, UniqSM )
-import Constants ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE )
+import Constants ( mIN_INTLIKE, mIN_CHARLIKE, uF_UPDATEE, bLOCK_SIZE,
+ rESERVED_STACK_WORDS )
import CLabel ( mkIntlikeClosureLabel, mkCharlikeClosureLabel,
mkMAP_FROZEN_infoLabel, mkForeignLabel )
import Outputable
(StInd PtrRep (StPrim IntAddOp
[tso, StInt (toInteger (TSO_SU*BYTES_PER_WORD))]))
stgSu :
- StAssign PtrRep
- (StInd PtrRep (StPrim IntAddOp
- [tso, StInt (toInteger (TSO_SPLIM*BYTES_PER_WORD))]))
- stgSpLim :
StAssign PtrRep
(StInd PtrRep (StPrim IntAddOp
[stgCurrentNursery,
(StInd PtrRep (StPrim IntAddOp
[tso, StInt (toInteger (TSO_SU*BYTES_PER_WORD))])) :
StAssign PtrRep stgSpLim
- (StInd PtrRep (StPrim IntAddOp
- [tso, StInt (toInteger (TSO_SPLIM*BYTES_PER_WORD))])) :
+ (StPrim IntAddOp [tso,
+ StInt (toInteger ((TSO_STACK + rESERVED_STACK_WORDS)
+ *BYTES_PER_WORD))]) :
StAssign PtrRep stgHp
(StPrim IntSubOp [
StInd PtrRep (StPrim IntAddOp
/* --------------------------------------------------------------------------
- * $Id: mkNativeHdr.c,v 1.4 2000/05/15 14:44:42 simonmar Exp $
+ * $Id: mkNativeHdr.c,v 1.5 2000/08/17 14:30:26 simonmar Exp $
*
* (c) The GHC Team, 1992-1998
*
#define OFFSET_CurrentNursery OFFSET(RegTable, RegTable.rCurrentNursery)
#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)
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-- Block descriptor offsets for the Native Code Generator\n");