Fix building RTS with gcc 2.*; declare all variables at the top of a block
[ghc-hetmet.git] / rts / StgStartup.cmm
index 2f2a759..b5a5cdc 100644 (file)
 
 /* -----------------------------------------------------------------------------
    Returning from the STG world.
 
 /* -----------------------------------------------------------------------------
    Returning from the STG world.
-
-   This is a polymorphic return address, meaning that any old constructor
-   can be returned, we don't care (actually, it's probably going to be
-   an IOok constructor, which will indirect through the vector table
-   slot 0).
    -------------------------------------------------------------------------- */
 
    -------------------------------------------------------------------------- */
 
+INFO_TABLE_RET( stg_stop_thread, STOP_FRAME,
 #if defined(PROFILING)
 #if defined(PROFILING)
-#define STOP_THREAD_BITMAP 3
-#define STOP_THREAD_WORDS  2
-#else
-#define STOP_THREAD_BITMAP 0
-#define STOP_THREAD_WORDS  0
+  W_ unused,
+  W_ unused
 #endif
 #endif
-
-/* A polymorhpic return address, where all the vector slots point to the
-   direct entry point. */
-INFO_TABLE_RET( stg_stop_thread, STOP_THREAD_WORDS, STOP_THREAD_BITMAP,
-               STOP_FRAME, 
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread),
-               RET_LBL(stg_stop_thread) )
+)
 {
     /* 
        The final exit.
 {
     /* 
        The final exit.
@@ -143,6 +124,13 @@ stg_returnToSchedButFirst
   jump R2;
 }
 
   jump R2;
 }
 
+stg_threadFinished
+{
+  StgRegTable_rRet(BaseReg) = ThreadFinished;
+  R1 = BaseReg;
+  jump StgReturn;
+}  
+
 /* -----------------------------------------------------------------------------
     Strict IO application - performing an IO action and entering its result.
     
 /* -----------------------------------------------------------------------------
     Strict IO application - performing an IO action and entering its result.
     
@@ -154,9 +142,10 @@ stg_returnToSchedButFirst
 
     forceIO takes care of this, performing the IO action and entering the
     results that comes back.
 
     forceIO takes care of this, performing the IO action and entering the
     results that comes back.
+
     ------------------------------------------------------------------------- */
 
     ------------------------------------------------------------------------- */
 
-INFO_TABLE_RET( stg_forceIO, 0/*size*/, 0/*bitmap*/, RET_SMALL)
+INFO_TABLE_RET( stg_forceIO, RET_SMALL)
 
 #ifdef REG_R1
 {
 
 #ifdef REG_R1
 {
@@ -180,7 +169,7 @@ INFO_TABLE_RET( stg_forceIO, 0/*size*/, 0/*bitmap*/, RET_SMALL)
     is a register or not.
     ------------------------------------------------------------------------- */
 
     is a register or not.
     ------------------------------------------------------------------------- */
 
-INFO_TABLE_RET( stg_noforceIO, 0/*size*/, 0/*bitmap*/, RET_SMALL )
+INFO_TABLE_RET( stg_noforceIO, RET_SMALL )
 
 #ifdef REG_R1
 {
 
 #ifdef REG_R1
 {