b2364d09656fe6fd0a71e0252d52725ca1895fbf
[ghc-hetmet.git] / ghc / includes / StgMiscClosures.h
1 /* -----------------------------------------------------------------------------
2  * $Id: StgMiscClosures.h,v 1.35 2001/02/11 17:51:08 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-1999
5  *
6  * Entry code for various built-in closure types.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 /* The naming scheme here follows the naming scheme for closure types
11  * defined in InfoTables.h.  The actual info tables and entry code for
12  * these objects can be found in StgMiscClosures.hc.
13  */
14
15 /* entry code */
16
17 STGFUN(stg_IND_entry);
18 STGFUN(stg_IND_STATIC_entry);
19 STGFUN(stg_IND_PERM_entry);
20 STGFUN(stg_IND_OLDGEN_entry);
21 STGFUN(stg_IND_OLDGEN_PERM_entry);
22 STGFUN(stg_CAF_UNENTERED_entry);
23 STGFUN(stg_CAF_ENTERED_entry);
24 STGFUN(stg_BLACKHOLE_entry);
25 STGFUN(stg_CAF_BLACKHOLE_entry);
26 STGFUN(stg_BLACKHOLE_BQ_entry);
27 #ifdef SMP
28 STGFUN(stg_WHITEHOLE_entry);
29 #endif
30 #ifdef TICKY_TICKY
31 STGFUN(stg_SE_BLACKHOLE_entry);
32 STGFUN(stg_SE_CAF_BLACKHOLE_entry);
33 #endif
34 #if defined(PAR) || defined(GRAN)
35 STGFUN(stg_RBH_entry);
36 #endif
37 STGFUN(stg_BCO_entry);
38 STGFUN(stg_EVACUATED_entry);
39 STGFUN(stg_FOREIGN_entry);
40 STGFUN(stg_WEAK_entry);
41 STGFUN(stg_NO_FINALIZER_entry);
42 STGFUN(stg_DEAD_WEAK_entry);
43 STGFUN(stg_STABLE_NAME_entry);
44 STGFUN(stg_TSO_entry);
45 STGFUN(stg_FULL_MVAR_entry);
46 STGFUN(stg_EMPTY_MVAR_entry);
47 STGFUN(stg_ARR_WORDS_entry);
48 STGFUN(stg_MUT_ARR_PTRS_entry);
49 STGFUN(stg_MUT_ARR_PTRS_FROZEN_entry);
50 STGFUN(stg_MUT_VAR_entry);
51 STGFUN(stg_END_TSO_QUEUE_entry);
52 STGFUN(stg_MUT_CONS_entry);
53 STGFUN(stg_END_MUT_LIST_entry);
54 STGFUN(stg_dummy_ret_entry);
55
56 #ifdef GHCI
57 /* entry code for constructors created by the bytecode interpreter */
58 STGFUN(stg_interp_constr_entry);
59 STGFUN(stg_interp_constr1_entry);
60 STGFUN(stg_interp_constr2_entry);
61 STGFUN(stg_interp_constr3_entry);
62 STGFUN(stg_interp_constr4_entry);
63 STGFUN(stg_interp_constr5_entry);
64 STGFUN(stg_interp_constr6_entry);
65 STGFUN(stg_interp_constr7_entry);
66 STGFUN(stg_interp_constr8_entry);
67
68 /* Magic glue code for when compiled code returns a value in R1/F1/D1
69    to the interpreter. */
70 extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1p_info;
71 extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_R1n_info;
72 extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_F1_info;
73 extern DLL_IMPORT_RTS const vec_info_8 stg_ctoi_ret_D1_info;
74
75 /* Used by the interpreter to return an unboxed value on the stack to
76    compiled code. */
77 extern DLL_IMPORT_RTS const StgInfoTable stg_gc_unbx_r1_info;
78 extern DLL_IMPORT_RTS const StgInfoTable stg_gc_f1_info;
79 extern DLL_IMPORT_RTS const StgInfoTable stg_gc_d1_info;
80 #endif
81
82 #if defined(PAR) || defined(GRAN)
83 /* this is the NIL ptr for a blocking queue */
84 # define END_BQ_QUEUE  ((StgBlockingQueueElement *)(void*)&END_TSO_QUEUE_closure)
85 /* this is the NIL ptr for a blocked fetch queue (as in PendingFetches in GUM) */
86 # define END_BF_QUEUE  ((StgBlockedFetch *)(void*)&END_TSO_QUEUE_closure)
87 #endif
88
89 /* info tables */
90
91 extern DLL_IMPORT_RTS const StgInfoTable stg_IND_info;
92 extern DLL_IMPORT_RTS const StgInfoTable stg_IND_STATIC_info;
93 extern DLL_IMPORT_RTS const StgInfoTable stg_IND_PERM_info;
94 extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_info;
95 extern DLL_IMPORT_RTS const StgInfoTable stg_IND_OLDGEN_PERM_info;
96 extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_UNENTERED_info;
97 extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_ENTERED_info;
98 extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_info;
99 extern DLL_IMPORT_RTS const StgInfoTable stg_CAF_BLACKHOLE_info;
100 extern DLL_IMPORT_RTS const StgInfoTable stg_BLACKHOLE_BQ_info;
101 #ifdef SMP
102 extern DLL_IMPORT_RTS const StgInfoTable stg_WHITEHOLE_info;
103 #endif
104 #ifdef TICKY_TICKY
105 extern DLL_IMPORT_RTS const StgInfoTable stg_SE_BLACKHOLE_info;
106 extern DLL_IMPORT_RTS const StgInfoTable stg_SE_CAF_BLACKHOLE_info;
107 #endif
108 #if defined(PAR) || defined(GRAN)
109 extern DLL_IMPORT_RTS const StgInfoTable stg_RBH_info;
110 #endif
111 extern DLL_IMPORT_RTS const StgInfoTable stg_BCO_info;
112 extern DLL_IMPORT_RTS const StgInfoTable stg_EVACUATED_info;
113 extern DLL_IMPORT_RTS const StgInfoTable stg_FOREIGN_info;
114 extern DLL_IMPORT_RTS const StgInfoTable stg_WEAK_info;
115 extern DLL_IMPORT_RTS const StgInfoTable stg_DEAD_WEAK_info;
116 extern DLL_IMPORT_RTS const StgInfoTable stg_STABLE_NAME_info;
117 extern DLL_IMPORT_RTS const StgInfoTable stg_FULL_MVAR_info;
118 extern DLL_IMPORT_RTS const StgInfoTable stg_EMPTY_MVAR_info;
119 extern DLL_IMPORT_RTS const StgInfoTable stg_TSO_info;
120 extern DLL_IMPORT_RTS const StgInfoTable stg_ARR_WORDS_info;
121 extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_WORDS_info;
122 extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_PTRS_info;
123 extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_ARR_PTRS_FROZEN_info;
124 extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_VAR_info;
125 extern DLL_IMPORT_RTS const StgInfoTable stg_END_TSO_QUEUE_info;
126 extern DLL_IMPORT_RTS const StgInfoTable stg_MUT_CONS_info;
127 extern DLL_IMPORT_RTS const StgInfoTable stg_END_MUT_LIST_info;
128 extern DLL_IMPORT_RTS const StgInfoTable stg_catch_info;
129 extern DLL_IMPORT_RTS const StgInfoTable stg_seq_info;
130 extern DLL_IMPORT_RTS const StgInfoTable stg_dummy_ret_info;
131
132 /* closures */
133
134 extern DLL_IMPORT_RTS StgClosure stg_END_TSO_QUEUE_closure;
135 extern DLL_IMPORT_RTS StgClosure stg_END_MUT_LIST_closure;
136 extern DLL_IMPORT_RTS StgClosure stg_NO_FINALIZER_closure;
137 extern DLL_IMPORT_RTS StgClosure stg_dummy_ret_closure;
138 extern DLL_IMPORT_RTS StgClosure stg_forceIO_closure;
139
140 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_CHARLIKE_closure[];
141 extern DLL_IMPORT_RTS StgIntCharlikeClosure stg_INTLIKE_closure[];
142
143 /* standard entry points */
144
145 /* EXTFUN_RTS(stg_error_entry); No longer used */
146
147   /* (see also below  -- KSW 1998-12) */
148
149 /* standard selector thunks */
150
151 EXTINFO_RTS stg_sel_0_upd_info;
152 EXTINFO_RTS stg_sel_1_upd_info;
153 EXTINFO_RTS stg_sel_2_upd_info;
154 EXTINFO_RTS stg_sel_3_upd_info;
155 EXTINFO_RTS stg_sel_4_upd_info;
156 EXTINFO_RTS stg_sel_5_upd_info;
157 EXTINFO_RTS stg_sel_6_upd_info;
158 EXTINFO_RTS stg_sel_7_upd_info;
159 EXTINFO_RTS stg_sel_8_upd_info;
160 EXTINFO_RTS stg_sel_8_upd_info;
161 EXTINFO_RTS stg_sel_9_upd_info;
162 EXTINFO_RTS stg_sel_10_upd_info;
163 EXTINFO_RTS stg_sel_11_upd_info;
164 EXTINFO_RTS stg_sel_12_upd_info;
165 EXTINFO_RTS stg_sel_13_upd_info;
166 EXTINFO_RTS stg_sel_14_upd_info;
167 EXTINFO_RTS stg_sel_15_upd_info;
168
169 EXTINFO_RTS stg_sel_0_noupd_info;
170 EXTINFO_RTS stg_sel_1_noupd_info;
171 EXTINFO_RTS stg_sel_2_noupd_info;
172 EXTINFO_RTS stg_sel_3_noupd_info;
173 EXTINFO_RTS stg_sel_4_noupd_info;
174 EXTINFO_RTS stg_sel_5_noupd_info;
175 EXTINFO_RTS stg_sel_6_noupd_info;
176 EXTINFO_RTS stg_sel_7_noupd_info;
177 EXTINFO_RTS stg_sel_8_noupd_info;
178 EXTINFO_RTS stg_sel_9_noupd_info;
179 EXTINFO_RTS stg_sel_10_noupd_info;
180 EXTINFO_RTS stg_sel_11_noupd_info;
181 EXTINFO_RTS stg_sel_12_noupd_info;
182 EXTINFO_RTS stg_sel_13_noupd_info;
183 EXTINFO_RTS stg_sel_14_noupd_info;
184 EXTINFO_RTS stg_sel_15_noupd_info;
185
186   /* and their standard entry points  -- KSW 1998-12 */
187
188 EXTFUN_RTS(stg_sel_0_upd_entry);
189 EXTFUN_RTS(stg_sel_1_upd_entry);
190 EXTFUN_RTS(stg_sel_2_upd_entry);
191 EXTFUN_RTS(stg_sel_3_upd_entry);
192 EXTFUN_RTS(stg_sel_4_upd_entry);
193 EXTFUN_RTS(stg_sel_5_upd_entry);
194 EXTFUN_RTS(stg_sel_6_upd_entry);
195 EXTFUN_RTS(stg_sel_7_upd_entry);
196 EXTFUN_RTS(stg_sel_8_upd_entry);
197 EXTFUN_RTS(stg_sel_8_upd_entry);
198 EXTFUN_RTS(stg_sel_9_upd_entry);
199 EXTFUN_RTS(stg_sel_10_upd_entry);
200 EXTFUN_RTS(stg_sel_11_upd_entry);
201 EXTFUN_RTS(stg_sel_12_upd_entry);
202 EXTFUN_RTS(stg_sel_13_upd_entry);
203 EXTFUN_RTS(stg_sel_14_upd_entry);
204 EXTFUN_RTS(stg_sel_15_upd_entry);
205
206 EXTFUN_RTS(stg_sel_0_noupd_entry);
207 EXTFUN_RTS(stg_sel_1_noupd_entry);
208 EXTFUN_RTS(stg_sel_2_noupd_entry);
209 EXTFUN_RTS(stg_sel_3_noupd_entry);
210 EXTFUN_RTS(stg_sel_4_noupd_entry);
211 EXTFUN_RTS(stg_sel_5_noupd_entry);
212 EXTFUN_RTS(stg_sel_6_noupd_entry);
213 EXTFUN_RTS(stg_sel_7_noupd_entry);
214 EXTFUN_RTS(stg_sel_8_noupd_entry);
215 EXTFUN_RTS(stg_sel_9_noupd_entry);
216 EXTFUN_RTS(stg_sel_10_noupd_entry);
217 EXTFUN_RTS(stg_sel_11_noupd_entry);
218 EXTFUN_RTS(stg_sel_12_noupd_entry);
219 EXTFUN_RTS(stg_sel_13_noupd_entry);
220 EXTFUN_RTS(stg_sel_14_noupd_entry);
221 EXTFUN_RTS(stg_sel_15_noupd_entry);
222
223 /* standard ap thunks */
224
225 EXTINFO_RTS stg_ap_1_upd_info;
226 EXTINFO_RTS stg_ap_2_upd_info;
227 EXTINFO_RTS stg_ap_3_upd_info;
228 EXTINFO_RTS stg_ap_4_upd_info;
229 EXTINFO_RTS stg_ap_5_upd_info;
230 EXTINFO_RTS stg_ap_6_upd_info;
231 EXTINFO_RTS stg_ap_7_upd_info;
232 EXTINFO_RTS stg_ap_8_upd_info;
233