/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.38 2000/04/03 15:54:50 simonmar Exp $
+ * $Id: RtsStartup.c,v 1.39 2000/04/03 16:28:08 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
static void
initModules ( void *init_root )
{
- init_sp = 0;
- init_stack = (F_ *)allocate(INIT_STACK_SIZE / sizeof(W_));
- init_stack[init_sp++] = (F_)stg_init_ret;
- init_stack[init_sp++] = (F_)__init_Prelude;
- if (init_root != NULL) {
- init_stack[init_sp++] = (F_)init_root;
- }
-
- MainRegTable.rSp = (P_)(init_stack + init_sp);
- StgRun((StgFunPtr)stg_init, NULL/* no reg table */);
+ Capability cap;
+
+ init_sp = 0;
+ init_stack = (F_ *)allocate(INIT_STACK_SIZE / sizeof(W_));
+ init_stack[init_sp++] = (F_)stg_init_ret;
+ init_stack[init_sp++] = (F_)__init_Prelude;
+ if (init_root != NULL) {
+ init_stack[init_sp++] = (F_)init_root;
+ }
+
+ cap.rSp = (P_)(init_stack + init_sp);
+ StgRun((StgFunPtr)stg_init, &cap);
}
#endif /* !INTERPRETER */
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.10 2000/03/30 12:03:30 simonmar Exp $
+ * $Id: StgStartup.hc,v 1.11 2000/04/03 16:28:08 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
STGFUN(stg_init)
{
FB_
- Sp = MainRegTable.rSp;
+ Sp = BaseReg->rSp;
JMP_(POP_INIT_STACK());
FE_
}