[project @ 2000-04-04 10:04:47 by simonmar]
[ghc-hetmet.git] / ghc / rts / StgStartup.hc
index 631e991..c927de9 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.6 2000/03/08 17:48:24 simonmar Exp $
+ * $Id: StgStartup.hc,v 1.11 2000/04/03 16:28:08 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -129,8 +129,16 @@ STGFUN(stg_enterStackTop)
   
 /* -----------------------------------------------------------------------------
    Special STG entry points for module registration.
+
+   This stuff is problematic for Hugs, because it introduces a
+   dependency between the RTS and the program (ie. __init_PrelMain).  So
+   we currently disable module initialisation for Hugs.
    -------------------------------------------------------------------------- */
 
+#ifndef INTERPRETER 
+
+extern F_ *init_stack;
+
 STGFUN(stg_init_ret)
 {
   FB_
@@ -138,14 +146,15 @@ STGFUN(stg_init_ret)
   FE_
 }
 
+/* On entry to stg_init:
+ *    init_stack[0] = &stg_init_ret;
+ *    init_stack[1] = __init_Something;
+ */
 STGFUN(stg_init)
 {
-  EF_(__init_Main);
-  EF_(__init_Prelude);
   FB_
-  PUSH_INIT_STACK(stg_init_ret);
-  PUSH_INIT_STACK(__init_Prelude);
-  JMP_(__init_Main);
+  Sp = BaseReg->rSp;
+  JMP_(POP_INIT_STACK());
   FE_
 }
 
@@ -153,3 +162,5 @@ STGFUN(stg_init)
 
 START_MOD_INIT(__init_PrelGHC);
 END_MOD_INIT();
+
+#endif /* !INTERPRETER */