[project @ 2002-05-01 15:46:14 by simonmar]
[ghc-hetmet.git] / ghc / includes / StgMiscClosures.h
index 077927c..cd3a998 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.h,v 1.26 2000/12/19 12:58:50 simonmar Exp $
+ * $Id: StgMiscClosures.h,v 1.43 2002/03/02 17:46:03 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -22,15 +22,14 @@ STGFUN(stg_IND_OLDGEN_PERM_entry);
 STGFUN(stg_CAF_UNENTERED_entry);
 STGFUN(stg_CAF_ENTERED_entry);
 STGFUN(stg_BLACKHOLE_entry);
-STGFUN(stg_BLACKHOLE_STATIC_entry);
+STGFUN(stg_CAF_BLACKHOLE_entry);
 STGFUN(stg_BLACKHOLE_BQ_entry);
-STGFUN(stg_BLACKHOLE_BQ_STATIC_entry);
 #ifdef SMP
 STGFUN(stg_WHITEHOLE_entry);
 #endif
 #ifdef TICKY_TICKY
 STGFUN(stg_SE_BLACKHOLE_entry);
-STGFUN(stg_SE_BLACKHOLE_STATIC_entry);
+STGFUN(stg_SE_CAF_BLACKHOLE_entry);
 #endif
 #if defined(PAR) || defined(GRAN)
 STGFUN(stg_RBH_entry);
@@ -54,7 +53,7 @@ STGFUN(stg_MUT_CONS_entry);
 STGFUN(stg_END_MUT_LIST_entry);
 STGFUN(stg_dummy_ret_entry);
 
-#ifdef GHCI
+/* entry code for constructors created by the bytecode interpreter */
 STGFUN(stg_interp_constr_entry);
 STGFUN(stg_interp_constr1_entry);
 STGFUN(stg_interp_constr2_entry);
@@ -64,14 +63,34 @@ STGFUN(stg_interp_constr5_entry);
 STGFUN(stg_interp_constr6_entry);
 STGFUN(stg_interp_constr7_entry);
 STGFUN(stg_interp_constr8_entry);
-#endif
 
+/* Magic glue code for when compiled code returns a value in R1/F1/D1
+   or a VoidRep to the interpreter. */
+extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1p_info;
+extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1n_info;
+extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_F1_info;
+extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_D1_info;
+extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_V_info;
+
+/* Used by the interpreter to return an unboxed value on the stack to
+   compiled code. */
+extern DLL_IMPORT_RTS const StgInfoTable stg_gc_unbx_r1_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_gc_f1_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_gc_d1_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_gc_l1_info;
+
+
+/* this is the NIL ptr for a TSO queue (e.g. runnable queue) */
+#define END_TSO_QUEUE  ((StgTSO *)(void*)&stg_END_TSO_QUEUE_closure)
+/* this is the NIL ptr for a list CAFs */
+#define END_ECAF_LIST   ((StgCAF *)(void*)&stg_END_TSO_QUEUE_closure)
 #if defined(PAR) || defined(GRAN)
 /* this is the NIL ptr for a blocking queue */
-# define END_BQ_QUEUE  ((StgBlockingQueueElement *)(void*)&END_TSO_QUEUE_closure)
+# define END_BQ_QUEUE  ((StgBlockingQueueElement *)(void*)&stg_END_TSO_QUEUE_closure)
 /* this is the NIL ptr for a blocked fetch queue (as in PendingFetches in GUM) */
-# define END_BF_QUEUE  ((StgBlockedFetch *)(void*)&END_TSO_QUEUE_closure)
+# define END_BF_QUEUE  ((StgBlockedFetch *)(void*)&stg_END_TSO_QUEUE_closure)
 #endif
+/* ToDo?: different name for end of sleeping queue ? -- HWL */
 
 /* info tables */
 
@@ -83,19 +102,21 @@ extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_PERM_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_UNENTERED_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_ENTERED_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_info;
-extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_STATIC_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_info;
-extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_STATIC_info;
 #ifdef SMP
 extern DLL_IMPORT_RTS const StgInfoTable stg_WHITEHOLE_info;
 #endif
 #ifdef TICKY_TICKY
 extern DLL_IMPORT_RTS const StgInfoTable stg_SE_BLACKHOLE_info;
-extern DLL_IMPORT_RTS const StgInfoTable stg_SE_BLACKHOLE_STATIC_info;
+extern DLL_IMPORT_RTS const StgInfoTable stg_SE_CAF_BLACKHOLE_info;
 #endif
 #if defined(PAR) || defined(GRAN)
 extern DLL_IMPORT_RTS const StgInfoTable stg_RBH_info;
 #endif
+#if defined(PAR)
+extern DLL_IMPORT_RTS const StgInfoTable stg_FETCH_ME_BQ_info;
+#endif
 extern DLL_IMPORT_RTS const StgInfoTable stg_BCO_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_EVACUATED_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_FOREIGN_info;
@@ -117,14 +138,6 @@ extern DLL_IMPORT_RTS const StgInfoTable stg_catch_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_seq_info;
 extern DLL_IMPORT_RTS const StgInfoTable stg_dummy_ret_info;
 
-#ifdef INTERPRETER
-
-EXTFUN(Hugs_CONSTR_entry);
-
-extern const vec_info_8 stg_ret_bco_info;
-
-#endif /* INTERPRETER */
-
 /* closures */
 
 extern DLL_IMPORT_RTS StgClosure stg_END_TSO_QUEUE_closure;
@@ -227,3 +240,64 @@ EXTINFO_RTS stg_ap_6_upd_info;
 EXTINFO_RTS stg_ap_7_upd_info;
 EXTINFO_RTS stg_ap_8_upd_info;
 
+/* standard GC & stack check entry points */
+
+EXTFUN(stg_gc_entertop);
+EXTFUN(stg_gc_enter_1_hponly);
+EXTFUN(__stg_gc_enter_1);
+EXTFUN(stg_gc_enter_2);
+EXTFUN(stg_gc_enter_3);
+EXTFUN(stg_gc_enter_4);
+EXTFUN(stg_gc_enter_5);
+EXTFUN(stg_gc_enter_6);
+EXTFUN(stg_gc_enter_7);
+EXTFUN(stg_gc_enter_8);
+EXTFUN(stg_gc_seq_1);
+
+EI_(stg_gc_noregs_info);
+EF_(stg_gc_noregs);
+
+EI_(stg_gc_unpt_r1_info);
+EF_(stg_gc_unpt_r1);
+
+EI_(stg_ut_1_0_unreg_info);
+
+EI_(stg_gc_unbx_r1_info);
+EF_(stg_gc_unbx_r1);
+
+EI_(stg_gc_f1_info);
+EF_(stg_gc_f1);
+
+EI_(stg_gc_d1_info);
+EF_(stg_gc_d1);
+
+EI_(stg_gc_ut_1_0_info);
+EI_(stg_gc_l1_info);
+EF_(stg_gc_l1);
+EF_(stg_gc_ut_1_0);
+
+EI_(stg_gc_ut_0_1_info);
+EF_(stg_gc_ut_0_1);
+
+EXTFUN(__stg_chk_0);
+EXTFUN(__stg_chk_1);
+EXTFUN(stg_chk_1n);
+EXTFUN(stg_chk_2);
+EXTFUN(stg_chk_3);
+EXTFUN(stg_chk_4);
+EXTFUN(stg_chk_5);
+EXTFUN(stg_chk_6);
+EXTFUN(stg_chk_7);
+EXTFUN(stg_chk_8);
+EXTFUN(stg_gen_chk_ret);
+EXTFUN(stg_gen_chk);
+EXTFUN(stg_gen_hp);
+EXTFUN(stg_gen_yield);
+EXTFUN(stg_yield_noregs);
+EXTFUN(stg_yield_to_interpreter);
+EXTFUN(stg_gen_block);
+EXTFUN(stg_block_noregs);
+EXTFUN(stg_block_1);
+EXTFUN(stg_block_takemvar);
+EXTFUN(stg_block_putmvar);
+