/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.43 2000/10/06 15:35:47 simonmar Exp $
+ * $Id: RtsStartup.c,v 1.49 2001/02/11 17:51:08 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
#include "StgRun.h"
#include "StgStartup.h"
#include "Prelude.h" /* fixupRTStoPreludeRefs */
-
-#ifdef GHCI
#include "HsFFI.h"
#include "Linker.h"
+
+#if defined(RTS_GTK_FRONTPANEL)
+#include "FrontPanel.h"
#endif
#if defined(PROFILING) || defined(DEBUG)
#endif
EXTFUN(__init_Prelude);
-static void initModules ( void * );
+static void initModules ( void (*)(void) );
void
setProgArgv(int argc, char *argv[])
void
-startupHaskell(int argc, char *argv[], void *init_root)
+startupHaskell(int argc, char *argv[], void (*init_root)(void))
{
/* To avoid repeated initialisations of the RTS */
if (rts_has_started_up)
/* The very first thing we do is grab the start time...just in case we're
* collecting timing statistics.
*/
- start_time();
+ stat_startInit();
#ifdef PAR
/*
/* initialize the storage manager */
initStorage();
- /* initialise the object linker, if necessary */
-#ifdef GHCI
- initLinker();
-#endif
-
/* initialise the stable pointer table */
initStablePtrTable();
#endif
/* run the per-module initialisation code */
-#if !defined(INTERPRETER)
initModules(init_root);
-#endif
#if defined(PROFILING) || defined(DEBUG)
initProfiling2();
init_default_handlers();
#endif
-#if !defined(INTERPRETER)
- /* Initialise pointers from the RTS to the prelude.
- Only for compiled code -- the interpreter
- will call this itself later, so don't do so now.
- */
- fixupRTStoPreludeRefs(NULL);
+#ifdef RTS_GTK_FRONTPANEL
+ if (RtsFlags.GcFlags.frontpanel) {
+ initFrontPanel();
+ }
#endif
/* Record initialization times */
- end_init();
+ stat_endInit();
}
/* -----------------------------------------------------------------------------
F_ *init_stack = NULL;
nat init_sp = 0;
-#ifndef INTERPRETER
static void
-initModules ( void *init_root )
+initModules ( void (*init_root)(void) )
{
#ifdef SMP
Capability cap;
cap.rSp = (P_)(init_stack + init_sp);
StgRun((StgFunPtr)stg_init, &cap);
}
-#endif /* !INTERPRETER */
/* -----------------------------------------------------------------------------
* Shutting down the RTS - two ways of doing this, one which
*/
exitStorage();
+#ifdef RTS_GTK_FRONTPANEL
+ if (RtsFlags.GcFlags.frontpanel) {
+ stopFrontPanel();
+ }
+#endif
+
#if defined(PROFILING) || defined(DEBUG)
endProfiling();
#endif