add pointers to the wiki for the rules about C prototypes
[ghc-hetmet.git] / includes / StgMiscClosures.h
index 3c64827..10e4638 100644 (file)
@@ -8,6 +8,8 @@
  * our Cmm code generator doesn't know how to generate local symbols
  * for the RTS bits (it assumes all RTS symbols are external).
  *
+ * See wiki:Commentary/Compiler/Backends/PprC#Prototypes
+ *
  * --------------------------------------------------------------------------*/
 
 #ifndef STGMISCCLOSURES_H
@@ -48,8 +50,12 @@ RTS_RET_INFO(stg_catch_stm_frame_info);
 RTS_ENTRY(stg_upd_frame_ret);
 RTS_ENTRY(stg_marked_upd_frame_ret);
 
-/* Entry code for constructors created by the bytecode interpreter */
-RTS_FUN(stg_interp_constr_entry);
+// RTS_FUN(stg_interp_constr_entry);
+//
+// This is referenced using the FFI in the compiler (ByteCodeItbls),
+// so we can't give it the correct type here because the prototypes
+// would clash (FFI references are always declared with type StgWord[]
+// in the generated C code).
 
 /* Magic glue code for when compiled code returns a value in R1/F1/D1
    or a VoidRep to the interpreter. */
@@ -99,8 +105,8 @@ RTS_INFO(stg_EVACUATED_info);
 RTS_INFO(stg_WEAK_info);
 RTS_INFO(stg_DEAD_WEAK_info);
 RTS_INFO(stg_STABLE_NAME_info);
-RTS_INFO(stg_FULL_MVAR_info);
-RTS_INFO(stg_EMPTY_MVAR_info);
+RTS_INFO(stg_MVAR_CLEAN_info);
+RTS_INFO(stg_MVAR_DIRTY_info);
 RTS_INFO(stg_TSO_info);
 RTS_INFO(stg_ARR_WORDS_info);
 RTS_INFO(stg_MUT_ARR_WORDS_info);
@@ -115,9 +121,11 @@ RTS_INFO(stg_MUT_CONS_info);
 RTS_INFO(stg_catch_info);
 RTS_INFO(stg_PAP_info);
 RTS_INFO(stg_AP_info);
+RTS_INFO(stg_AP_NOUPD_info);
 RTS_INFO(stg_AP_STACK_info);
 RTS_INFO(stg_dummy_ret_info);
 RTS_INFO(stg_raise_info);
+RTS_INFO(stg_raise_ret_info);
 RTS_INFO(stg_TVAR_WATCH_QUEUE_info);
 RTS_INFO(stg_INVARIANT_CHECK_QUEUE_info);
 RTS_INFO(stg_ATOMIC_INVARIANT_info);
@@ -171,9 +179,11 @@ RTS_ENTRY(stg_MUT_CONS_entry);
 RTS_ENTRY(stg_catch_entry);
 RTS_ENTRY(stg_PAP_entry);
 RTS_ENTRY(stg_AP_entry);
+RTS_ENTRY(stg_AP_NOUPD_entry);
 RTS_ENTRY(stg_AP_STACK_entry);
 RTS_ENTRY(stg_dummy_ret_entry);
 RTS_ENTRY(stg_raise_entry);
+RTS_ENTRY(stg_raise_ret_ret);
 RTS_ENTRY(stg_END_STM_WATCH_QUEUE_entry);
 RTS_ENTRY(stg_END_INVARIANT_CHECK_QUEUE_entry);
 RTS_ENTRY(stg_END_STM_CHUNK_LIST_entry);
@@ -489,6 +499,8 @@ RTS_FUN(stg_threadFinished);
 RTS_FUN(stg_init_finish);
 RTS_FUN(stg_init);
 
+RTS_FUN(StgReturn);
+
 /* -----------------------------------------------------------------------------
    PrimOps
    -------------------------------------------------------------------------- */
@@ -594,4 +606,50 @@ RTS_FUN(getApStackValzh_fast);
 
 RTS_FUN(noDuplicatezh_fast);
 
+/* Other misc stuff */
+// See wiki:Commentary/Compiler/Backends/PprC#Prototypes
+
+#if IN_STG_CODE && !IN_STGCRUN
+
+// Interpreter.c
+extern StgWord rts_stop_next_breakpoint[];
+extern StgWord rts_stop_on_exception[];
+extern StgWord rts_breakpoint_io_action[];
+
+// Schedule.c
+extern int RTS_VAR(context_switch);
+extern StgWord RTS_VAR(blocked_queue_hd), RTS_VAR(blocked_queue_tl);
+extern StgWord RTS_VAR(sleeping_queue);
+extern StgWord RTS_VAR(blackhole_queue);
+extern StgWord RTS_VAR(sched_mutex);
+
+// Apply.cmm
+// canned bitmap for each arg type
+extern StgWord stg_arg_bitmaps[];
+extern StgWord stg_ap_stack_entries[];
+extern StgWord stg_stack_save_entries[];
+
+// Storage.c
+extern unsigned int RTS_VAR(alloc_blocks);
+extern unsigned int RTS_VAR(alloc_blocks_lim);
+extern StgWord RTS_VAR(weak_ptr_list);
+extern StgWord RTS_VAR(atomic_modify_mutvar_mutex);
+
+// RtsFlags
+extern StgWord RTS_VAR(RtsFlags); // bogus type
+
+// Stable.c
+extern StgWord RTS_VAR(stable_ptr_table);
+
+// Profiling.c
+extern unsigned int RTS_VAR(era);
+extern StgWord      RTS_VAR(CCCS);             /* current CCS */
+extern unsigned int RTS_VAR(entering_PAP);
+extern StgWord      RTS_VAR(CC_LIST);               /* registered CC list */
+extern StgWord      RTS_VAR(CCS_LIST);         /* registered CCS list */
+extern unsigned int RTS_VAR(CC_ID);    /* global ids */
+extern unsigned int RTS_VAR(CCS_ID);
+
+#endif
+
 #endif /* STGMISCCLOSURES_H */