projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2001-03-23 16:36:20 by simonmar]
[ghc-hetmet.git]
/
ghc
/
rts
/
StgStartup.hc
diff --git
a/ghc/rts/StgStartup.hc
b/ghc/rts/StgStartup.hc
index
40f1198
..
bed2312
100644
(file)
--- a/
ghc/rts/StgStartup.hc
+++ b/
ghc/rts/StgStartup.hc
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.9 2000/03/21 14:33:18 simonmar Exp $
+ * $Id: StgStartup.hc,v 1.15 2001/03/23 16:36:21 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
@@
-7,6
+7,7
@@
*
* ---------------------------------------------------------------------------*/
*
* ---------------------------------------------------------------------------*/
+#include "Stg.h"
#include "Rts.h"
#include "StgRun.h" /* StgReturn */
#include "StgStartup.h"
#include "Rts.h"
#include "StgRun.h" /* StgReturn */
#include "StgStartup.h"
@@
-76,12
+77,15
@@
STGFUN(stg_stop_thread_entry)
* tidy up the registers and return to the scheduler.
*/
* tidy up the registers and return to the scheduler.
*/
- /* Move Su just off the end of the stack, we're about to spam the
- * STOP_FRAME with the return value.
+ /* Move Sp to the last word on the stack, and Su to just past the end
+ * of the stack. We then place the return value at the top of the stack.
*/
*/
+ Sp += sizeofW(StgStopFrame) - 1;
Su = (StgUpdateFrame *)(Sp+1);
Sp[0] = R1.w;
Su = (StgUpdateFrame *)(Sp+1);
Sp[0] = R1.w;
+ CurrentTSO->what_next = ThreadComplete;
+
SaveThreadState(); /* inline! */
/* R1 contains the return value of the thread */
SaveThreadState(); /* inline! */
/* R1 contains the return value of the thread */
@@
-135,8
+139,6
@@
STGFUN(stg_enterStackTop)
we currently disable module initialisation for Hugs.
-------------------------------------------------------------------------- */
we currently disable module initialisation for Hugs.
-------------------------------------------------------------------------- */
-#ifndef INTERPRETER
-
extern F_ *init_stack;
STGFUN(stg_init_ret)
extern F_ *init_stack;
STGFUN(stg_init_ret)
@@
-146,15
+148,15
@@
STGFUN(stg_init_ret)
FE_
}
FE_
}
+/* On entry to stg_init:
+ * init_stack[0] = &stg_init_ret;
+ * init_stack[1] = __init_Something;
+ */
STGFUN(stg_init)
{
STGFUN(stg_init)
{
- EF_(__init_PrelMain);
- EF_(__init_Prelude);
FB_
FB_
- Sp = (P_)init_stack;
- PUSH_INIT_STACK(stg_init_ret);
- PUSH_INIT_STACK(__init_Prelude);
- JMP_(__init_PrelMain);
+ Sp = BaseReg->rSp;
+ JMP_(POP_INIT_STACK());
FE_
}
FE_
}
@@
-162,5
+164,3
@@
STGFUN(stg_init)
START_MOD_INIT(__init_PrelGHC);
END_MOD_INIT();
START_MOD_INIT(__init_PrelGHC);
END_MOD_INIT();
-
-#endif /* !INTERPRETER */