9834c4bbf3524ce36ddb00fa493b2002802bd9a6
[ghc.git] / includes / stg / MiscClosures.h
1 /* ----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2009
4 *
5 * Declarations for various symbols exported by the RTS.
6 *
7 * ToDo: many of the symbols in here don't need to be exported, but
8 * our Cmm code generator doesn't know how to generate local symbols
9 * for the RTS bits (it assumes all RTS symbols are external).
10 *
11 * See wiki:Commentary/Compiler/Backends/PprC#Prototypes
12 *
13 * Do not #include this file directly: #include "Rts.h" instead.
14 *
15 * To understand the structure of the RTS headers, see the wiki:
16 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
17 *
18 * --------------------------------------------------------------------------*/
19
20 #ifndef STGMISCCLOSURES_H
21 #define STGMISCCLOSURES_H
22
23 #if IN_STG_CODE
24 # define RTS_RET_INFO(i) extern W_(i)[]
25 # define RTS_FUN_INFO(i) extern W_(i)[]
26 # define RTS_THUNK_INFO(i) extern W_(i)[]
27 # define RTS_INFO(i) extern W_(i)[]
28 # define RTS_CLOSURE(i) extern W_(i)[]
29 # define RTS_FUN(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
30 #else
31 # define RTS_RET_INFO(i) extern DLL_IMPORT_RTS const StgRetInfoTable i
32 # define RTS_FUN_INFO(i) extern DLL_IMPORT_RTS const StgFunInfoTable i
33 # define RTS_THUNK_INFO(i) extern DLL_IMPORT_RTS const StgThunkInfoTable i
34 # define RTS_INFO(i) extern DLL_IMPORT_RTS const StgInfoTable i
35 # define RTS_CLOSURE(i) extern DLL_IMPORT_RTS StgClosure i
36 # define RTS_FUN(f) extern DLL_IMPORT_RTS StgFunPtr f(void)
37 #endif
38
39 #ifdef TABLES_NEXT_TO_CODE
40 # define RTS_ENTRY(f) /* nothing */
41 #else
42 # define RTS_ENTRY(f) RTS_FUN(f)
43 #endif
44
45 /* Stack frames */
46 RTS_RET_INFO(stg_upd_frame_info);
47 RTS_RET_INFO(stg_bh_upd_frame_info);
48 RTS_RET_INFO(stg_marked_upd_frame_info);
49 RTS_RET_INFO(stg_noupd_frame_info);
50 RTS_RET_INFO(stg_catch_frame_info);
51 RTS_RET_INFO(stg_catch_retry_frame_info);
52 RTS_RET_INFO(stg_atomically_frame_info);
53 RTS_RET_INFO(stg_atomically_waiting_frame_info);
54 RTS_RET_INFO(stg_catch_stm_frame_info);
55 RTS_RET_INFO(stg_unblockAsyncExceptionszh_ret_info);
56
57 RTS_ENTRY(stg_upd_frame_ret);
58 RTS_ENTRY(stg_bh_upd_frame_ret);
59 RTS_ENTRY(stg_marked_upd_frame_ret);
60
61 // RTS_FUN(stg_interp_constr_entry);
62 //
63 // This is referenced using the FFI in the compiler (ByteCodeItbls),
64 // so we can't give it the correct type here because the prototypes
65 // would clash (FFI references are always declared with type StgWord[]
66 // in the generated C code).
67
68 /* Magic glue code for when compiled code returns a value in R1/F1/D1
69 or a VoidRep to the interpreter. */
70 RTS_RET_INFO(stg_ctoi_R1p_info);
71 RTS_RET_INFO(stg_ctoi_R1unpt_info);
72 RTS_RET_INFO(stg_ctoi_R1n_info);
73 RTS_RET_INFO(stg_ctoi_F1_info);
74 RTS_RET_INFO(stg_ctoi_D1_info);
75 RTS_RET_INFO(stg_ctoi_L1_info);
76 RTS_RET_INFO(stg_ctoi_V_info);
77
78 RTS_ENTRY(stg_ctoi_R1p_ret);
79 RTS_ENTRY(stg_ctoi_R1unpt_ret);
80 RTS_ENTRY(stg_ctoi_R1n_ret);
81 RTS_ENTRY(stg_ctoi_F1_ret);
82 RTS_ENTRY(stg_ctoi_D1_ret);
83 RTS_ENTRY(stg_ctoi_L1_ret);
84 RTS_ENTRY(stg_ctoi_V_ret);
85
86 RTS_RET_INFO(stg_apply_interp_info);
87 RTS_ENTRY(stg_apply_interp_ret);
88
89 RTS_INFO(stg_IND_info);
90 RTS_INFO(stg_IND_direct_info);
91 RTS_INFO(stg_IND_STATIC_info);
92 RTS_INFO(stg_IND_PERM_info);
93 RTS_INFO(stg_IND_OLDGEN_info);
94 RTS_INFO(stg_IND_OLDGEN_PERM_info);
95 RTS_INFO(stg_BLACKHOLE_info);
96 RTS_INFO(stg_CAF_BLACKHOLE_info);
97 RTS_INFO(__stg_EAGER_BLACKHOLE_info);
98 RTS_INFO(stg_WHITEHOLE_info);
99 RTS_INFO(stg_BLOCKING_QUEUE_CLEAN_info);
100 RTS_INFO(stg_BLOCKING_QUEUE_DIRTY_info);
101
102 RTS_FUN_INFO(stg_BCO_info);
103 RTS_INFO(stg_EVACUATED_info);
104 RTS_INFO(stg_WEAK_info);
105 RTS_INFO(stg_DEAD_WEAK_info);
106 RTS_INFO(stg_STABLE_NAME_info);
107 RTS_INFO(stg_MVAR_CLEAN_info);
108 RTS_INFO(stg_MVAR_DIRTY_info);
109 RTS_INFO(stg_TSO_info);
110 RTS_INFO(stg_ARR_WORDS_info);
111 RTS_INFO(stg_MUT_ARR_WORDS_info);
112 RTS_INFO(stg_MUT_ARR_PTRS_CLEAN_info);
113 RTS_INFO(stg_MUT_ARR_PTRS_DIRTY_info);
114 RTS_INFO(stg_MUT_ARR_PTRS_FROZEN_info);
115 RTS_INFO(stg_MUT_ARR_PTRS_FROZEN0_info);
116 RTS_INFO(stg_MUT_VAR_CLEAN_info);
117 RTS_INFO(stg_MUT_VAR_DIRTY_info);
118 RTS_INFO(stg_END_TSO_QUEUE_info);
119 RTS_INFO(stg_MSG_WAKEUP_info);
120 RTS_INFO(stg_MSG_TRY_WAKEUP_info);
121 RTS_INFO(stg_MSG_THROWTO_info);
122 RTS_INFO(stg_MSG_BLACKHOLE_info);
123 RTS_INFO(stg_MUT_CONS_info);
124 RTS_INFO(stg_catch_info);
125 RTS_INFO(stg_PAP_info);
126 RTS_INFO(stg_AP_info);
127 RTS_INFO(stg_AP_NOUPD_info);
128 RTS_INFO(stg_AP_STACK_info);
129 RTS_INFO(stg_dummy_ret_info);
130 RTS_INFO(stg_raise_info);
131 RTS_INFO(stg_raise_ret_info);
132 RTS_INFO(stg_TVAR_WATCH_QUEUE_info);
133 RTS_INFO(stg_INVARIANT_CHECK_QUEUE_info);
134 RTS_INFO(stg_ATOMIC_INVARIANT_info);
135 RTS_INFO(stg_TVAR_info);
136 RTS_INFO(stg_TREC_CHUNK_info);
137 RTS_INFO(stg_TREC_HEADER_info);
138 RTS_INFO(stg_END_STM_WATCH_QUEUE_info);
139 RTS_INFO(stg_END_INVARIANT_CHECK_QUEUE_info);
140 RTS_INFO(stg_END_STM_CHUNK_LIST_info);
141 RTS_INFO(stg_NO_TREC_info);
142
143 RTS_ENTRY(stg_IND_entry);
144 RTS_ENTRY(stg_IND_direct_entry);
145 RTS_ENTRY(stg_IND_STATIC_entry);
146 RTS_ENTRY(stg_IND_PERM_entry);
147 RTS_ENTRY(stg_IND_OLDGEN_entry);
148 RTS_ENTRY(stg_IND_OLDGEN_PERM_entry);
149 RTS_ENTRY(stg_WHITEHOLE_entry);
150 RTS_ENTRY(stg_BLACKHOLE_entry);
151 RTS_ENTRY(stg_CAF_BLACKHOLE_entry);
152 RTS_ENTRY(__stg_EAGER_BLACKHOLE_entry);
153 RTS_ENTRY(stg_BCO_entry);
154 RTS_ENTRY(stg_EVACUATED_entry);
155 RTS_ENTRY(stg_WEAK_entry);
156 RTS_ENTRY(stg_DEAD_WEAK_entry);
157 RTS_ENTRY(stg_STABLE_NAME_entry);
158 RTS_ENTRY(stg_FULL_MVAR_entry);
159 RTS_ENTRY(stg_EMPTY_MVAR_entry);
160 RTS_ENTRY(stg_TSO_entry);
161 RTS_ENTRY(stg_ARR_WORDS_entry);
162 RTS_ENTRY(stg_MUT_ARR_WORDS_entry);
163 RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN_entry);
164 RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY_entry);
165 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_entry);
166 RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0_entry);
167 RTS_ENTRY(stg_MUT_VAR_CLEAN_entry);
168 RTS_ENTRY(stg_MUT_VAR_DIRTY_entry);
169 RTS_ENTRY(stg_END_TSO_QUEUE_entry);
170 RTS_ENTRY(stg_MSG_WAKEUP_entry);
171 RTS_ENTRY(stg_MSG_TRY_WAKEUP_entry);
172 RTS_ENTRY(stg_MSG_THROWTO_entry);
173 RTS_ENTRY(stg_MSG_BLACKHOLE_entry);
174 RTS_ENTRY(stg_MUT_CONS_entry);
175 RTS_ENTRY(stg_catch_entry);
176 RTS_ENTRY(stg_PAP_entry);
177 RTS_ENTRY(stg_AP_entry);
178 RTS_ENTRY(stg_AP_NOUPD_entry);
179 RTS_ENTRY(stg_AP_STACK_entry);
180 RTS_ENTRY(stg_dummy_ret_entry);
181 RTS_ENTRY(stg_raise_entry);
182 RTS_ENTRY(stg_raise_ret_ret);
183 RTS_ENTRY(stg_END_STM_WATCH_QUEUE_entry);
184 RTS_ENTRY(stg_END_INVARIANT_CHECK_QUEUE_entry);
185 RTS_ENTRY(stg_END_STM_CHUNK_LIST_entry);
186 RTS_ENTRY(stg_NO_TREC_entry);
187 RTS_ENTRY(stg_TVAR_entry);
188 RTS_ENTRY(stg_TVAR_WATCH_QUEUE_entry);
189 RTS_ENTRY(stg_INVARIANT_CHECK_QUEUE_entry);
190 RTS_ENTRY(stg_ATOMIC_INVARIANT_entry);
191 RTS_ENTRY(stg_TREC_CHUNK_entry);
192 RTS_ENTRY(stg_TREC_HEADER_entry);
193
194
195 RTS_ENTRY(stg_unblockAsyncExceptionszh_ret_ret);
196 RTS_ENTRY(stg_blockAsyncExceptionszh_ret_ret);
197 RTS_ENTRY(stg_catch_frame_ret);
198 RTS_ENTRY(stg_catch_retry_frame_ret);
199 RTS_ENTRY(stg_atomically_frame_ret);
200 RTS_ENTRY(stg_atomically_waiting_frame_ret);
201 RTS_ENTRY(stg_catch_stm_frame_ret);
202
203 /* closures */
204
205 RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
206 RTS_CLOSURE(stg_NO_FINALIZER_closure);
207 RTS_CLOSURE(stg_dummy_ret_closure);
208 RTS_CLOSURE(stg_forceIO_closure);
209
210 RTS_CLOSURE(stg_END_STM_WATCH_QUEUE_closure);
211 RTS_CLOSURE(stg_END_INVARIANT_CHECK_QUEUE_closure);
212 RTS_CLOSURE(stg_END_STM_CHUNK_LIST_closure);
213 RTS_CLOSURE(stg_NO_TREC_closure);
214
215 RTS_ENTRY(stg_NO_FINALIZER_entry);
216
217 #if IN_STG_CODE
218 extern DLL_IMPORT_RTS StgWordArray stg_CHARLIKE_closure;
219 extern DLL_IMPORT_RTS StgWordArray stg_INTLIKE_closure;
220 #else
221 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
222 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
223 #endif
224
225 /* StgStartup */
226
227 RTS_RET_INFO(stg_forceIO_info);
228 RTS_ENTRY(stg_forceIO_ret);
229
230 RTS_RET_INFO(stg_noforceIO_info);
231 RTS_ENTRY(stg_noforceIO_ret);
232
233 /* standard entry points */
234
235 /* standard selector thunks */
236
237 RTS_ENTRY(stg_sel_ret_0_upd_ret);
238 RTS_ENTRY(stg_sel_ret_1_upd_ret);
239 RTS_ENTRY(stg_sel_ret_2_upd_ret);
240 RTS_ENTRY(stg_sel_ret_3_upd_ret);
241 RTS_ENTRY(stg_sel_ret_4_upd_ret);
242 RTS_ENTRY(stg_sel_ret_5_upd_ret);
243 RTS_ENTRY(stg_sel_ret_6_upd_ret);
244 RTS_ENTRY(stg_sel_ret_7_upd_ret);
245 RTS_ENTRY(stg_sel_ret_8_upd_ret);
246 RTS_ENTRY(stg_sel_ret_9_upd_ret);
247 RTS_ENTRY(stg_sel_ret_10_upd_ret);
248 RTS_ENTRY(stg_sel_ret_11_upd_ret);
249 RTS_ENTRY(stg_sel_ret_12_upd_ret);
250 RTS_ENTRY(stg_sel_ret_13_upd_ret);
251 RTS_ENTRY(stg_sel_ret_14_upd_ret);
252 RTS_ENTRY(stg_sel_ret_15_upd_ret);
253
254 RTS_INFO(stg_sel_0_upd_info);
255 RTS_INFO(stg_sel_1_upd_info);
256 RTS_INFO(stg_sel_2_upd_info);
257 RTS_INFO(stg_sel_3_upd_info);
258 RTS_INFO(stg_sel_4_upd_info);
259 RTS_INFO(stg_sel_5_upd_info);
260 RTS_INFO(stg_sel_6_upd_info);
261 RTS_INFO(stg_sel_7_upd_info);
262 RTS_INFO(stg_sel_8_upd_info);
263 RTS_INFO(stg_sel_9_upd_info);
264 RTS_INFO(stg_sel_10_upd_info);
265 RTS_INFO(stg_sel_11_upd_info);
266 RTS_INFO(stg_sel_12_upd_info);
267 RTS_INFO(stg_sel_13_upd_info);
268 RTS_INFO(stg_sel_14_upd_info);
269 RTS_INFO(stg_sel_15_upd_info);
270
271 RTS_ENTRY(stg_sel_0_upd_entry);
272 RTS_ENTRY(stg_sel_1_upd_entry);
273 RTS_ENTRY(stg_sel_2_upd_entry);
274 RTS_ENTRY(stg_sel_3_upd_entry);
275 RTS_ENTRY(stg_sel_4_upd_entry);
276 RTS_ENTRY(stg_sel_5_upd_entry);
277 RTS_ENTRY(stg_sel_6_upd_entry);
278 RTS_ENTRY(stg_sel_7_upd_entry);
279 RTS_ENTRY(stg_sel_8_upd_entry);
280 RTS_ENTRY(stg_sel_9_upd_entry);
281 RTS_ENTRY(stg_sel_10_upd_entry);
282 RTS_ENTRY(stg_sel_11_upd_entry);
283 RTS_ENTRY(stg_sel_12_upd_entry);
284 RTS_ENTRY(stg_sel_13_upd_entry);
285 RTS_ENTRY(stg_sel_14_upd_entry);
286 RTS_ENTRY(stg_sel_15_upd_entry);
287
288 RTS_ENTRY(stg_sel_ret_0_noupd_ret);
289 RTS_ENTRY(stg_sel_ret_1_noupd_ret);
290 RTS_ENTRY(stg_sel_ret_2_noupd_ret);
291 RTS_ENTRY(stg_sel_ret_3_noupd_ret);
292 RTS_ENTRY(stg_sel_ret_4_noupd_ret);
293 RTS_ENTRY(stg_sel_ret_5_noupd_ret);
294 RTS_ENTRY(stg_sel_ret_6_noupd_ret);
295 RTS_ENTRY(stg_sel_ret_7_noupd_ret);
296 RTS_ENTRY(stg_sel_ret_8_noupd_ret);
297 RTS_ENTRY(stg_sel_ret_9_noupd_ret);
298 RTS_ENTRY(stg_sel_ret_10_noupd_ret);
299 RTS_ENTRY(stg_sel_ret_11_noupd_ret);
300 RTS_ENTRY(stg_sel_ret_12_noupd_ret);
301 RTS_ENTRY(stg_sel_ret_13_noupd_ret);
302 RTS_ENTRY(stg_sel_ret_14_noupd_ret);
303 RTS_ENTRY(stg_sel_ret_15_noupd_ret);
304
305 RTS_INFO(stg_sel_0_noupd_info);
306 RTS_INFO(stg_sel_1_noupd_info);
307 RTS_INFO(stg_sel_2_noupd_info);
308 RTS_INFO(stg_sel_3_noupd_info);
309 RTS_INFO(stg_sel_4_noupd_info);
310 RTS_INFO(stg_sel_5_noupd_info);
311 RTS_INFO(stg_sel_6_noupd_info);
312 RTS_INFO(stg_sel_7_noupd_info);
313 RTS_INFO(stg_sel_8_noupd_info);
314 RTS_INFO(stg_sel_9_noupd_info);
315 RTS_INFO(stg_sel_10_noupd_info);
316 RTS_INFO(stg_sel_11_noupd_info);
317 RTS_INFO(stg_sel_12_noupd_info);
318 RTS_INFO(stg_sel_13_noupd_info);
319 RTS_INFO(stg_sel_14_noupd_info);
320 RTS_INFO(stg_sel_15_noupd_info);
321
322 RTS_ENTRY(stg_sel_0_noupd_entry);
323 RTS_ENTRY(stg_sel_1_noupd_entry);
324 RTS_ENTRY(stg_sel_2_noupd_entry);
325 RTS_ENTRY(stg_sel_3_noupd_entry);
326 RTS_ENTRY(stg_sel_4_noupd_entry);
327 RTS_ENTRY(stg_sel_5_noupd_entry);
328 RTS_ENTRY(stg_sel_6_noupd_entry);
329 RTS_ENTRY(stg_sel_7_noupd_entry);
330 RTS_ENTRY(stg_sel_8_noupd_entry);
331 RTS_ENTRY(stg_sel_9_noupd_entry);
332 RTS_ENTRY(stg_sel_10_noupd_entry);
333 RTS_ENTRY(stg_sel_11_noupd_entry);
334 RTS_ENTRY(stg_sel_12_noupd_entry);
335 RTS_ENTRY(stg_sel_13_noupd_entry);
336 RTS_ENTRY(stg_sel_14_noupd_entry);
337 RTS_ENTRY(stg_sel_15_noupd_entry);
338
339 /* standard ap thunks */
340
341 RTS_THUNK_INFO(stg_ap_1_upd_info);
342 RTS_THUNK_INFO(stg_ap_2_upd_info);
343 RTS_THUNK_INFO(stg_ap_3_upd_info);
344 RTS_THUNK_INFO(stg_ap_4_upd_info);
345 RTS_THUNK_INFO(stg_ap_5_upd_info);
346 RTS_THUNK_INFO(stg_ap_6_upd_info);
347 RTS_THUNK_INFO(stg_ap_7_upd_info);
348
349 RTS_ENTRY(stg_ap_1_upd_entry);
350 RTS_ENTRY(stg_ap_2_upd_entry);
351 RTS_ENTRY(stg_ap_3_upd_entry);
352 RTS_ENTRY(stg_ap_4_upd_entry);
353 RTS_ENTRY(stg_ap_5_upd_entry);
354 RTS_ENTRY(stg_ap_6_upd_entry);
355 RTS_ENTRY(stg_ap_7_upd_entry);
356
357 /* standard application routines (see also rts/gen_apply.py,
358 * and compiler/codeGen/CgStackery.lhs).
359 */
360 RTS_RET_INFO(stg_ap_v_info);
361 RTS_RET_INFO(stg_ap_f_info);
362 RTS_RET_INFO(stg_ap_d_info);
363 RTS_RET_INFO(stg_ap_l_info);
364 RTS_RET_INFO(stg_ap_n_info);
365 RTS_RET_INFO(stg_ap_p_info);
366 RTS_RET_INFO(stg_ap_pv_info);
367 RTS_RET_INFO(stg_ap_pp_info);
368 RTS_RET_INFO(stg_ap_ppv_info);
369 RTS_RET_INFO(stg_ap_ppp_info);
370 RTS_RET_INFO(stg_ap_pppv_info);
371 RTS_RET_INFO(stg_ap_pppp_info);
372 RTS_RET_INFO(stg_ap_ppppp_info);
373 RTS_RET_INFO(stg_ap_pppppp_info);
374
375 RTS_ENTRY(stg_ap_v_ret);
376 RTS_ENTRY(stg_ap_f_ret);
377 RTS_ENTRY(stg_ap_d_ret);
378 RTS_ENTRY(stg_ap_l_ret);
379 RTS_ENTRY(stg_ap_n_ret);
380 RTS_ENTRY(stg_ap_p_ret);
381 RTS_ENTRY(stg_ap_pv_ret);
382 RTS_ENTRY(stg_ap_pp_ret);
383 RTS_ENTRY(stg_ap_ppv_ret);
384 RTS_ENTRY(stg_ap_ppp_ret);
385 RTS_ENTRY(stg_ap_pppv_ret);
386 RTS_ENTRY(stg_ap_pppp_ret);
387 RTS_ENTRY(stg_ap_ppppp_ret);
388 RTS_ENTRY(stg_ap_pppppp_ret);
389
390 RTS_FUN(stg_ap_0_fast);
391 RTS_FUN(stg_ap_v_fast);
392 RTS_FUN(stg_ap_f_fast);
393 RTS_FUN(stg_ap_d_fast);
394 RTS_FUN(stg_ap_l_fast);
395 RTS_FUN(stg_ap_n_fast);
396 RTS_FUN(stg_ap_p_fast);
397 RTS_FUN(stg_ap_pv_fast);
398 RTS_FUN(stg_ap_pp_fast);
399 RTS_FUN(stg_ap_ppv_fast);
400 RTS_FUN(stg_ap_ppp_fast);
401 RTS_FUN(stg_ap_pppv_fast);
402 RTS_FUN(stg_ap_pppp_fast);
403 RTS_FUN(stg_ap_ppppp_fast);
404 RTS_FUN(stg_ap_pppppp_fast);
405 RTS_FUN(stg_PAP_apply);
406
407 /* standard GC & stack check entry points, all defined in HeapStackCheck.hc */
408
409 RTS_RET_INFO(stg_enter_info);
410 RTS_ENTRY(stg_enter_ret);
411 RTS_RET_INFO(stg_enter_checkbh_info);
412 RTS_ENTRY(stg_enter_checkbh_ret);
413
414 RTS_RET_INFO(stg_gc_void_info);
415 RTS_ENTRY(stg_gc_void_ret);
416
417 RTS_FUN(__stg_gc_enter_1);
418
419 RTS_FUN(stg_gc_noregs);
420
421 RTS_RET_INFO(stg_gc_unpt_r1_info);
422 RTS_ENTRY(stg_gc_unpt_r1_ret);
423 RTS_FUN(stg_gc_unpt_r1);
424
425 RTS_RET_INFO(stg_gc_unbx_r1_info);
426 RTS_ENTRY(stg_gc_unbx_r1_ret);
427 RTS_FUN(stg_gc_unbx_r1);
428
429 RTS_RET_INFO(stg_gc_f1_info);
430 RTS_ENTRY(stg_gc_f1_ret);
431 RTS_FUN(stg_gc_f1);
432
433 RTS_RET_INFO(stg_gc_d1_info);
434 RTS_ENTRY(stg_gc_d1_ret);
435 RTS_FUN(stg_gc_d1);
436
437 RTS_RET_INFO(stg_gc_l1_info);
438 RTS_ENTRY(stg_gc_l1_ret);
439 RTS_FUN(stg_gc_l1);
440
441 RTS_FUN(__stg_gc_fun);
442 RTS_RET_INFO(stg_gc_fun_info);
443 RTS_ENTRY(stg_gc_fun_ret);
444
445 RTS_RET_INFO(stg_gc_gen_info);
446 RTS_ENTRY(stg_gc_gen_ret);
447 RTS_FUN(stg_gc_gen);
448
449 RTS_ENTRY(stg_ut_1_0_unreg_ret);
450 RTS_RET_INFO(stg_ut_1_0_unreg_info);
451
452 RTS_FUN(stg_gc_gen_hp);
453 RTS_FUN(stg_gc_ut);
454 RTS_FUN(stg_gen_yield);
455 RTS_FUN(stg_yield_noregs);
456 RTS_FUN(stg_yield_to_interpreter);
457 RTS_FUN(stg_gen_block);
458 RTS_FUN(stg_block_noregs);
459 RTS_FUN(stg_block_1);
460 RTS_FUN(stg_block_blackhole);
461 RTS_FUN(stg_block_blackhole_finally);
462 RTS_FUN(stg_block_takemvar);
463 RTS_ENTRY(stg_block_takemvar_ret);
464 RTS_FUN(stg_block_putmvar);
465 RTS_ENTRY(stg_block_putmvar_ret);
466 #ifdef mingw32_HOST_OS
467 RTS_FUN(stg_block_async);
468 RTS_ENTRY(stg_block_async_ret);
469 RTS_FUN(stg_block_async_void);
470 RTS_ENTRY(stg_block_async_void_ret);
471 #endif
472 RTS_FUN(stg_block_stmwait);
473 RTS_FUN(stg_block_throwto);
474 RTS_ENTRY(stg_block_throwto_ret);
475 RTS_RET_INFO(stg_block_throwto_info);
476
477 /* Entry/exit points from StgStartup.cmm */
478
479 RTS_RET_INFO(stg_stop_thread_info);
480 RTS_ENTRY(stg_stop_thread_ret);
481
482 RTS_FUN(stg_returnToStackTop);
483 RTS_FUN(stg_returnToSched);
484 RTS_FUN(stg_returnToSchedNotPaused);
485 RTS_FUN(stg_returnToSchedButFirst);
486 RTS_FUN(stg_threadFinished);
487
488 RTS_FUN(stg_init_finish);
489 RTS_FUN(stg_init);
490
491 RTS_FUN(StgReturn);
492
493 /* -----------------------------------------------------------------------------
494 PrimOps
495 -------------------------------------------------------------------------- */
496
497 RTS_FUN(stg_plusIntegerzh);
498 RTS_FUN(stg_minusIntegerzh);
499 RTS_FUN(stg_timesIntegerzh);
500 RTS_FUN(stg_gcdIntegerzh);
501 RTS_FUN(stg_quotRemIntegerzh);
502 RTS_FUN(stg_quotIntegerzh);
503 RTS_FUN(stg_remIntegerzh);
504 RTS_FUN(stg_divExactIntegerzh);
505 RTS_FUN(stg_divModIntegerzh);
506
507 RTS_FUN(stg_cmpIntegerIntzh);
508 RTS_FUN(stg_cmpIntegerzh);
509 RTS_FUN(stg_integer2Intzh);
510 RTS_FUN(stg_integer2Wordzh);
511 RTS_FUN(stg_gcdIntegerIntzh);
512 RTS_FUN(stg_gcdIntzh);
513
514 RTS_FUN(stg_int2Integerzh);
515 RTS_FUN(stg_word2Integerzh);
516
517 RTS_FUN(stg_decodeFloatzuIntzh);
518 RTS_FUN(stg_decodeDoublezh);
519 RTS_FUN(stg_decodeDoublezu2Intzh);
520
521 RTS_FUN(stg_andIntegerzh);
522 RTS_FUN(stg_orIntegerzh);
523 RTS_FUN(stg_xorIntegerzh);
524 RTS_FUN(stg_complementIntegerzh);
525
526 #if SIZEOF_HSINT == 4
527
528 RTS_FUN(stg_int64ToIntegerzh);
529 RTS_FUN(stg_word64ToIntegerzh);
530
531 #endif
532
533 RTS_FUN(stg_unsafeThawArrayzh);
534 RTS_FUN(stg_newByteArrayzh);
535 RTS_FUN(stg_newPinnedByteArrayzh);
536 RTS_FUN(stg_newAlignedPinnedByteArrayzh);
537 RTS_FUN(stg_newArrayzh);
538
539 RTS_FUN(stg_newMutVarzh);
540 RTS_FUN(stg_atomicModifyMutVarzh);
541
542 RTS_FUN(stg_isEmptyMVarzh);
543 RTS_FUN(stg_newMVarzh);
544 RTS_FUN(stg_takeMVarzh);
545 RTS_FUN(stg_putMVarzh);
546 RTS_FUN(stg_tryTakeMVarzh);
547 RTS_FUN(stg_tryPutMVarzh);
548
549 RTS_FUN(stg_waitReadzh);
550 RTS_FUN(stg_waitWritezh);
551 RTS_FUN(stg_delayzh);
552 #ifdef mingw32_HOST_OS
553 RTS_FUN(stg_asyncReadzh);
554 RTS_FUN(stg_asyncWritezh);
555 RTS_FUN(stg_asyncDoProczh);
556 #endif
557
558 RTS_FUN(stg_catchzh);
559 RTS_FUN(stg_raisezh);
560 RTS_FUN(stg_raiseIOzh);
561
562 RTS_FUN(stg_makeStableNamezh);
563 RTS_FUN(stg_makeStablePtrzh);
564 RTS_FUN(stg_deRefStablePtrzh);
565
566 RTS_FUN(stg_forkzh);
567 RTS_FUN(stg_forkOnzh);
568 RTS_FUN(stg_yieldzh);
569 RTS_FUN(stg_killThreadzh);
570 RTS_FUN(stg_asyncExceptionsBlockedzh);
571 RTS_FUN(stg_blockAsyncExceptionszh);
572 RTS_FUN(stg_unblockAsyncExceptionszh);
573 RTS_FUN(stg_myThreadIdzh);
574 RTS_FUN(stg_labelThreadzh);
575 RTS_FUN(stg_isCurrentThreadBoundzh);
576 RTS_FUN(stg_threadStatuszh);
577
578 RTS_FUN(stg_mkWeakzh);
579 RTS_FUN(stg_mkWeakForeignzh);
580 RTS_FUN(stg_mkWeakForeignEnvzh);
581 RTS_FUN(stg_finalizzeWeakzh);
582 RTS_FUN(stg_deRefWeakzh);
583
584 RTS_FUN(stg_newBCOzh);
585 RTS_FUN(stg_mkApUpd0zh);
586
587 RTS_FUN(stg_retryzh);
588 RTS_FUN(stg_catchRetryzh);
589 RTS_FUN(stg_catchSTMzh);
590 RTS_FUN(stg_atomicallyzh);
591 RTS_FUN(stg_newTVarzh);
592 RTS_FUN(stg_readTVarzh);
593 RTS_FUN(stg_readTVarIOzh);
594 RTS_FUN(stg_writeTVarzh);
595 RTS_FUN(stg_checkzh);
596
597 RTS_FUN(stg_unpackClosurezh);
598 RTS_FUN(stg_getApStackValzh);
599 RTS_FUN(stg_getSparkzh);
600
601 RTS_FUN(stg_noDuplicatezh);
602
603 RTS_FUN(stg_traceCcszh);
604 RTS_FUN(stg_traceEventzh);
605
606 /* Other misc stuff */
607 // See wiki:Commentary/Compiler/Backends/PprC#Prototypes
608
609 #if IN_STG_CODE && !IN_STGCRUN
610
611 // Interpreter.c
612 extern StgWord rts_stop_next_breakpoint[];
613 extern StgWord rts_stop_on_exception[];
614 extern StgWord rts_breakpoint_io_action[];
615
616 // Schedule.c
617 extern StgWord RTS_VAR(blocked_queue_hd), RTS_VAR(blocked_queue_tl);
618 extern StgWord RTS_VAR(sleeping_queue);
619 extern StgWord RTS_VAR(blackhole_queue);
620 extern StgWord RTS_VAR(sched_mutex);
621
622 // Apply.cmm
623 // canned bitmap for each arg type
624 extern StgWord stg_arg_bitmaps[];
625 extern StgWord stg_ap_stack_entries[];
626 extern StgWord stg_stack_save_entries[];
627
628 // Storage.c
629 extern unsigned int RTS_VAR(g0);
630 extern unsigned int RTS_VAR(alloc_blocks_lim);
631 extern StgWord RTS_VAR(weak_ptr_list);
632 extern StgWord RTS_VAR(atomic_modify_mutvar_mutex);
633
634 // RtsFlags
635 extern StgWord RTS_VAR(RtsFlags); // bogus type
636
637 // Stable.c
638 extern StgWord RTS_VAR(stable_ptr_table);
639
640 // Profiling.c
641 extern unsigned int RTS_VAR(era);
642 extern StgWord RTS_VAR(CCCS); /* current CCS */
643 extern unsigned int RTS_VAR(entering_PAP);
644 extern StgWord RTS_VAR(CC_LIST); /* registered CC list */
645 extern StgWord RTS_VAR(CCS_LIST); /* registered CCS list */
646 extern unsigned int RTS_VAR(CC_ID); /* global ids */
647 extern unsigned int RTS_VAR(CCS_ID);
648
649 #endif
650
651 #endif /* STGMISCCLOSURES_H */