Skip to content
Snippets Groups Projects
Commit b5bafea8 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-04-03 16:28:08 by simonmar]

Don't use MainRegTable to communicate Sp to stg_init, use a
dynamically-allocated Capability instead (works with SMP).
parent b74c1ccf
No related merge requests found
/* -----------------------------------------------------------------------------
* $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
*
......@@ -207,16 +207,18 @@ nat init_sp = 0;
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
*
......@@ -153,7 +153,7 @@ STGFUN(stg_init_ret)
STGFUN(stg_init)
{
FB_
Sp = MainRegTable.rSp;
Sp = BaseReg->rSp;
JMP_(POP_INIT_STACK());
FE_
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment