[project @ 2000-03-17 13:30:23 by simonmar]
[ghc-hetmet.git] / ghc / rts / StgStartup.hc
index b3591d1..cb8beca 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgStartup.hc,v 1.5 1999/05/13 17:31:13 simonm Exp $
+ * $Id: StgStartup.hc,v 1.8 2000/03/16 12:40:40 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -129,31 +129,38 @@ 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_Main).  So
+   we currently disable module initialisation for Hugs.
    -------------------------------------------------------------------------- */
 
-#ifdef PROFILING
+#ifndef INTERPRETER 
 
-STGFUN(stg_register_ret)
+extern F_ *init_stack;
+
+STGFUN(stg_init_ret)
 {
   FB_
   JMP_(StgReturn);
   FE_
 }
 
-STGFUN(stg_register)
+STGFUN(stg_init)
 {
-  EF_(_regMain);
-  EF_(_regPrelude);
+  EF_(__init_Main);
+  EF_(__init_Prelude);
   FB_
-  PUSH_REGISTER_STACK(stg_register_ret);
-  PUSH_REGISTER_STACK(_regPrelude);
-  JMP_(_regMain);
+  Sp = (P_)init_stack;
+  PUSH_INIT_STACK(stg_init_ret);
+  PUSH_INIT_STACK(__init_Prelude);
+  JMP_(__init_Main);
   FE_
 }
 
 /* PrelGHC doesn't really exist... */
 
-START_REGISTER_CCS(_regPrelGHC);
-END_REGISTER_CCS();
+START_MOD_INIT(__init_PrelGHC);
+END_MOD_INIT();
 
-#endif
+#endif /* !INTERPRETER */