projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-11-06 13:10:46 by simonpj]
[ghc-hetmet.git]
/
ghc
/
rts
/
StgStartup.hc
diff --git
a/ghc/rts/StgStartup.hc
b/ghc/rts/StgStartup.hc
index
b3591d1
..
660bf35
100644
(file)
--- a/
ghc/rts/StgStartup.hc
+++ b/
ghc/rts/StgStartup.hc
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.5 1999/05/13 17:31:13 simonm Exp $
+ * $Id: StgStartup.hc,v 1.19 2002/07/16 14:56:09 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"
@@
-44,8
+45,8
@@
EXTFUN(stg_stop_thread_entry);
EXTFUN(stg_stop_thread_entry);
-#ifdef PROFILING
-#define STOP_THREAD_BITMAP 1
+#if defined(PROFILING)
+#define STOP_THREAD_BITMAP 3
#else
#define STOP_THREAD_BITMAP 0
#endif
#else
#define STOP_THREAD_BITMAP 0
#endif
@@
-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 */
@@
-131,29
+135,23
@@
STGFUN(stg_enterStackTop)
Special STG entry points for module registration.
-------------------------------------------------------------------------- */
Special STG entry points for module registration.
-------------------------------------------------------------------------- */
-#ifdef PROFILING
+extern F_ *init_stack;
-STGFUN(stg_register_ret)
+STGFUN(stg_init_ret)
{
FB_
JMP_(StgReturn);
FE_
}
{
FB_
JMP_(StgReturn);
FE_
}
-STGFUN(stg_register)
+/* On entry to stg_init:
+ * init_stack[0] = &stg_init_ret;
+ * init_stack[1] = __stginit_Something;
+ */
+STGFUN(stg_init)
{
{
- EF_(_regMain);
- EF_(_regPrelude);
FB_
FB_
- PUSH_REGISTER_STACK(stg_register_ret);
- PUSH_REGISTER_STACK(_regPrelude);
- JMP_(_regMain);
+ Sp = BaseReg->rSp;
+ JMP_(POP_INIT_STACK());
FE_
}
FE_
}
-
-/* PrelGHC doesn't really exist... */
-
-START_REGISTER_CCS(_regPrelGHC);
-END_REGISTER_CCS();
-
-#endif