[project @ 2000-04-05 15:27:59 by simonmar]
[ghc-hetmet.git] / ghc / includes / InfoMacros.h
1 /* ----------------------------------------------------------------------------
2  * $Id: InfoMacros.h,v 1.11 2000/04/05 15:27:59 simonmar Exp $
3  * 
4  * (c) The GHC Team, 1998-1999
5  *
6  * Macros for building and deconstructing info tables.
7  *
8  * -------------------------------------------------------------------------- */
9
10 #ifndef INFOMACROS_H
11 #define INFOMACROS_H
12
13 #define STD_INFO(type_)                         \
14                 srt : 0,                        \
15                 srt_len : 0,                    \
16                 type : type_
17
18 #define SRT_INFO(type_,srt_,srt_off_,srt_len_)                  \
19                 srt : (StgSRT *)((StgClosure **)srt_+srt_off_), \
20                 srt_len : srt_len_,                             \
21                 type : type_
22
23 #define CONSTR_INFO(type_,tag_)                 \
24                 srt : 0,                        \
25                 srt_len : tag_,                 \
26                 type : type_
27
28 #ifdef PROFILING
29 #define PROF_INFO(type_str, desc_str)           \
30                 prof: {                         \
31                    closure_type: type_str,      \
32                    closure_desc: desc_str,      \
33                 },
34 #else
35 #define PROF_INFO(type_str, desc_str)
36 #endif
37
38 #ifdef USE_MINIINTERPRETER
39 #define INIT_VECTOR {}
40 #else
41 #define INIT_VECTOR
42 #endif
43
44 /*
45   On the GranSim/GUM specific parts of the InfoTables (GRAN/PAR):
46
47   In both GranSim and GUM we use revertible black holes (RBH) when putting
48   an updatable closure into a packet for communication. The entry code for
49   an RBH performs standard blocking (as with any kind of BH). The info
50   table for the RBH resides just before the one for the std info
51   table. (NB: there is one RBH ITBL for every ITBL of an updatable
52   closure.) The @rbh_infoptr@ field in the ITBL points from the std ITBL to
53   the RBH ITBL and vice versa. This is used by the RBH_INFOPTR and
54   REVERT_INFOPTR macros to turn an updatable node into an RBH and vice
55   versa. Note, that the only case where we have to revert the RBH in its
56   original form is when a packet is sent back because of garbage collection
57   on another PE. In the RTS for GdH we will use this reversion mechanism in 
58   order to deal with faults in the system. 
59   ToDo: Check that RBHs are needed for all the info tables below. From a quick
60   check of the macros generated in the libs it seems that all of them are used
61   for generating THUNKs.
62   Possible optimisation: Note that any RBH ITBL is a fixed distance away from 
63   the actual ITBL. We could inline this offset as a constant into the RTS and
64   avoid the rbh_infoptr fields altogether (Jim did that in the old RTS).
65   -- HWL
66 */
67
68
69 /* function/thunk info tables --------------------------------------------- */
70
71 #if defined(GRAN) || defined(PAR)
72
73 #define \
74 INFO_TABLE_SRT(info,                            /* info-table label */  \
75                entry,                           /* entry code label */  \
76                ptrs, nptrs,                     /* closure layout info */\
77                srt_, srt_off_, srt_len_,        /* SRT info */          \
78                type,                            /* closure type */      \
79                info_class, entry_class,         /* C storage classes */ \
80                prof_descr, prof_type)           /* profiling info */    \
81         entry_class(RBH_##entry);                                       \
82         entry_class(entry);                                             \
83         ED_RO_ StgInfoTable info;                                       \
84         info_class INFO_TBL_CONST StgInfoTable RBH_##info = {           \
85                 layout : { payload : {ptrs,nptrs} },                    \
86                 PROF_INFO(prof_type, prof_descr)                        \
87                 SRT_INFO(RBH,srt_,srt_off_,srt_len_),                   \
88                 INCLUDE_RBH_INFO(info),                                 \
89                 INIT_ENTRY(RBH_##entry),                                \
90                 INIT_VECTOR                                             \
91         } ;                                                             \
92         StgFunPtr  RBH_##entry (void) { JMP_(RBH_entry); } ;            \
93         info_class INFO_TBL_CONST StgInfoTable info = {                 \
94                 layout : { payload : {ptrs,nptrs} },                    \
95                 PROF_INFO(prof_type, prof_descr)                        \
96                 SRT_INFO(type,srt_,srt_off_,srt_len_),                  \
97                 INCLUDE_RBH_INFO(RBH_##info),                           \
98                 INIT_ENTRY(entry),                                      \
99                 INIT_VECTOR                                             \
100         }
101
102 #else
103
104 #define \
105 INFO_TABLE_SRT(info,                            /* info-table label */  \
106                entry,                           /* entry code label */  \
107                ptrs, nptrs,                     /* closure layout info */\
108                srt_, srt_off_, srt_len_,        /* SRT info */          \
109                type,                            /* closure type */      \
110                info_class, entry_class,         /* C storage classes */ \
111                prof_descr, prof_type)           /* profiling info */    \
112         entry_class(entry);                                             \
113         info_class INFO_TBL_CONST StgInfoTable info = {                 \
114                 layout : { payload : {ptrs,nptrs} },                    \
115                 PROF_INFO(prof_type, prof_descr)                        \
116                 SRT_INFO(type,srt_,srt_off_,srt_len_),                  \
117                 INIT_ENTRY(entry),                                      \
118                 INIT_VECTOR                                             \
119         }
120
121 #endif
122
123 /* direct-return address info tables  --------------------------------------*/
124
125 #if defined(GRAN) || defined(PAR)
126
127 #define                                                                 \
128 INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_,   \
129                       type, info_class, entry_class,                    \
130                       prof_descr, prof_type)                            \
131         entry_class(RBH_##entry);                                       \
132         entry_class(entry);                                             \
133         ED_RO_ StgInfoTable info;                                       \
134         info_class INFO_TBL_CONST StgInfoTable RBH_##info = {           \
135                 layout : { bitmap : (StgWord32)bitmap_ },               \
136                 PROF_INFO(prof_type, prof_descr)                        \
137                 SRT_INFO(RBH,srt_,srt_off_,srt_len_),                   \
138                 INCLUDE_RBH_INFO(info),                                 \
139                 INIT_ENTRY(RBH_##entry),                                \
140                 INIT_VECTOR                                             \
141         };                                                              \
142         StgFunPtr  RBH_##entry (void) { JMP_(RBH_entry); } ;            \
143         info_class INFO_TBL_CONST StgInfoTable info = {                 \
144                 layout : { bitmap : (StgWord32)bitmap_ },               \
145                 PROF_INFO(prof_type, prof_descr)                        \
146                 SRT_INFO(type,srt_,srt_off_,srt_len_),                  \
147                 INCLUDE_RBH_INFO(RBH_##info),                           \
148                 INIT_ENTRY(entry),                                      \
149                 INIT_VECTOR                                             \
150         }
151 #else
152
153 #define                                                                 \
154 INFO_TABLE_SRT_BITMAP(info, entry, bitmap_, srt_, srt_off_, srt_len_,   \
155                       type, info_class, entry_class,                    \
156                       prof_descr, prof_type)                            \
157         entry_class(entry);                                             \
158         info_class INFO_TBL_CONST StgInfoTable info = {                 \
159                 layout : { bitmap : (StgWord32)bitmap_ },               \
160                 PROF_INFO(prof_type, prof_descr)                        \
161                 SRT_INFO(type,srt_,srt_off_,srt_len_),                  \
162                 INIT_ENTRY(entry),                                      \
163                 INIT_VECTOR                                             \
164         }
165 #endif
166
167 /* info-table without an SRT -----------------------------------------------*/
168
169 #if defined(GRAN) || defined(PAR)
170
171 #define                                                         \
172 INFO_TABLE(info, entry, ptrs, nptrs, type, info_class,          \
173            entry_class, prof_descr, prof_type)                  \
174         entry_class(RBH_##entry);                               \
175         entry_class(entry);                                     \
176         ED_RO_ StgInfoTable info;                               \
177         info_class INFO_TBL_CONST StgInfoTable RBH_##info = {   \
178                 layout : { payload : {ptrs,nptrs} },            \
179                 PROF_INFO(prof_type, prof_descr)                \
180                 STD_INFO(RBH),                                  \
181                 INCLUDE_RBH_INFO(info),                         \
182                 INIT_ENTRY(RBH_##entry),                        \
183                 INIT_VECTOR                                     \
184         };                                                      \
185         StgFunPtr  RBH_##entry (void) { JMP_(RBH_entry); } ;    \
186         info_class INFO_TBL_CONST StgInfoTable info = {         \
187                 layout : { payload : {ptrs,nptrs} },            \
188                 PROF_INFO(prof_type, prof_descr)                \
189                 STD_INFO(type),                                 \
190                 INCLUDE_RBH_INFO(RBH_##info),                   \
191                 INIT_ENTRY(entry),                              \
192                 INIT_VECTOR                                     \
193         }
194
195 #else
196
197 #define                                                 \
198 INFO_TABLE(info, entry, ptrs, nptrs, type, info_class,  \
199            entry_class, prof_descr, prof_type)          \
200         entry_class(entry);                             \
201         info_class INFO_TBL_CONST StgInfoTable info = { \
202                 layout : { payload : {ptrs,nptrs} },    \
203                 PROF_INFO(prof_type, prof_descr)        \
204                 STD_INFO(type),                         \
205                 INIT_ENTRY(entry),                      \
206                 INIT_VECTOR                             \
207         }
208
209 #endif
210
211 /* special selector-thunk info table ---------------------------------------*/
212
213 #if defined(GRAN) || defined(PAR)
214
215 #define                                                         \
216 INFO_TABLE_SELECTOR(info, entry, offset, info_class,            \
217                     entry_class, prof_descr, prof_type)         \
218         entry_class(RBH_##entry);                               \
219         entry_class(entry);                                     \
220         ED_RO_ StgInfoTable info;                               \
221         info_class INFO_TBL_CONST StgInfoTable RBH_##info = {   \
222                 layout : { selector_offset : offset },          \
223                 PROF_INFO(prof_type, prof_descr)                \
224                 STD_INFO(RBH),                                  \
225                 INCLUDE_RBH_INFO(info),                         \
226                 INIT_ENTRY(RBH_##entry),                        \
227                 INIT_VECTOR                                     \
228         };                                                      \
229         StgFunPtr  RBH_##entry (void) { JMP_(RBH_entry); } ;    \
230         info_class INFO_TBL_CONST StgInfoTable info = {         \
231                 layout : { selector_offset : offset },          \
232                 PROF_INFO(prof_type, prof_descr)                \
233                 STD_INFO(THUNK_SELECTOR),                       \
234                 INCLUDE_RBH_INFO(RBH_##info),                   \
235                 INIT_ENTRY(entry),                              \
236                 INIT_VECTOR                                     \
237         }
238
239 #else
240
241 #define                                                 \
242 INFO_TABLE_SELECTOR(info, entry, offset, info_class,    \
243                     entry_class, prof_descr, prof_type) \
244         entry_class(entry);                             \
245         info_class INFO_TBL_CONST StgInfoTable info = { \
246                 layout : { selector_offset : offset },  \
247                 PROF_INFO(prof_type, prof_descr)        \
248                 STD_INFO(THUNK_SELECTOR),               \
249                 INIT_ENTRY(entry),                      \
250                 INIT_VECTOR                             \
251         }
252
253 #endif
254
255 /* constructor info table --------------------------------------------------*/
256
257 #define                                                                 \
258 INFO_TABLE_CONSTR(info, entry, ptrs, nptrs, tag_,type_,info_class,      \
259                   entry_class, prof_descr, prof_type)                   \
260         entry_class(entry);                                             \
261         info_class INFO_TBL_CONST StgInfoTable info = {                 \
262                 layout : { payload : {ptrs,nptrs} },                    \
263                 PROF_INFO(prof_type, prof_descr)                        \
264                 CONSTR_INFO(type_,tag_),                                \
265                 INIT_ENTRY(entry),                                      \
266                 INIT_VECTOR                                             \
267         }
268
269 #define constrTag(con) (get_itbl(con)->srt_len)
270
271 /* return-vectors ----------------------------------------------------------*/
272
273 /* vectored-return info tables have the vector slammed up against the
274  * start of the info table.
275  *
276  * A vectored-return address always has an SRT and a bitmap-style
277  * layout field, so we only need one macro for these.
278  */
279
280 #ifdef TABLES_NEXT_TO_CODE
281
282 typedef struct {
283   StgFunPtr vec[2];
284   StgInfoTable i;
285 } vec_info_2;
286
287 typedef struct {
288   StgFunPtr vec[3];
289   StgInfoTable i;
290 } vec_info_3;
291
292 typedef struct {
293   StgFunPtr vec[4];
294   StgInfoTable i;
295 } vec_info_4;
296
297 typedef struct {
298   StgFunPtr vec[5];
299   StgInfoTable i;
300 } vec_info_5;
301
302 typedef struct {
303   StgFunPtr vec[6];
304   StgInfoTable i;
305 } vec_info_6;
306
307 typedef struct {
308   StgFunPtr vec[7];
309   StgInfoTable i;
310 } vec_info_7;
311
312 typedef struct {
313   StgFunPtr vec[8];
314   StgInfoTable i;
315 } vec_info_8;
316
317 #define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_len_,         \
318                    type, info_class,                            \
319                    alt_1, alt_2)                                \
320         info_class INFO_TBL_CONST vec_info_2 info = {           \
321                 { alt_2, alt_1 },                               \
322                 i : {                                           \
323                    layout : { bitmap : (StgWord32)bitmap_ },    \
324                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
325                 }                                               \
326         }
327
328 #define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_len_,         \
329                    type, info_class,                            \
330                    alt_1, alt_2, alt_3                          \
331                   )                                             \
332         info_class INFO_TBL_CONST vec_info_3 info = {           \
333                 { alt_3, alt_2, alt_1 },                        \
334                 i : {                                           \
335                    layout : { bitmap : (StgWord32)bitmap_ },    \
336                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
337                 }                                               \
338         }
339
340 #define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_len_,         \
341                    type, info_class,                            \
342                    alt_1, alt_2, alt_3, alt_4                   \
343                   )                                             \
344         info_class INFO_TBL_CONST vec_info_4 info = {           \
345                 { alt_4, alt_3, alt_2, alt_1 },                 \
346                 i : {                                           \
347                    layout : { bitmap : (StgWord32)bitmap_ },    \
348                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
349                 }                                               \
350         }
351
352 #define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_len_,         \
353                    type, info_class,                            \
354                    alt_1, alt_2, alt_3, alt_4,                  \
355                    alt_5                                        \
356                   )                                             \
357         info_class INFO_TBL_CONST vec_info_5 info = {           \
358                 { alt_5, alt_4, alt_3, alt_2,                   \
359                   alt_1 },                                      \
360                 i : {                                           \
361                    layout : { bitmap : (StgWord32)bitmap_ },    \
362                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
363                 }                                               \
364         }
365
366 #define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_len_,         \
367                    type, info_class,                            \
368                    alt_1, alt_2, alt_3, alt_4,                  \
369                    alt_5, alt_6                                 \
370                   )                                             \
371         info_class INFO_TBL_CONST vec_info_6 info = {           \
372                 { alt_6, alt_5, alt_4, alt_3,                   \
373                   alt_2, alt_1 },                               \
374                 i : {                                           \
375                    layout : { bitmap : (StgWord32)bitmap_ },    \
376                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
377                 }                                               \
378         }
379
380 #define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_len_,         \
381                    type, info_class,                            \
382                    alt_1, alt_2, alt_3, alt_4,                  \
383                    alt_5, alt_6, alt_7                          \
384                   )                                             \
385         info_class INFO_TBL_CONST vec_info_7 info = {           \
386                 { alt_7, alt_6, alt_5, alt_4,                   \
387                   alt_3, alt_2, alt_1 },                        \
388                 i : {                                           \
389                    layout : { bitmap : (StgWord32)bitmap_ },    \
390                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
391                 }                                               \
392         }
393
394 #define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_len_,         \
395                    type, info_class,                            \
396                    alt_1, alt_2, alt_3, alt_4,                  \
397                    alt_5, alt_6, alt_7, alt_8                   \
398                   )                                             \
399         info_class INFO_TBL_CONST vec_info_8 info = {           \
400                 { alt_8, alt_7, alt_6, alt_5,                   \
401                   alt_4, alt_3, alt_2, alt_1 },                 \
402                 i : {                                           \
403                    layout : { bitmap : (StgWord32)bitmap_ },    \
404                    SRT_INFO(type,srt_,srt_off_,srt_len_)        \
405                 }                                               \
406         }
407
408
409 #else
410
411 /* We have to define these structure to work around a bug in gcc: if we
412  * try to initialise the vector directly (it's defined as a zero-length
413  * array tacked on the end of the info table structor), then gcc silently
414  * throws away our vector table sometimes.
415  */
416
417 typedef struct {
418   StgInfoTable i;
419   StgFunPtr vec[2];
420 } vec_info_2;
421
422 typedef struct {
423   StgInfoTable i;
424   StgFunPtr vec[3];
425 } vec_info_3;
426
427 typedef struct {
428   StgInfoTable i;
429   StgFunPtr vec[4];
430 } vec_info_4;
431
432 typedef struct {
433   StgInfoTable i;
434   StgFunPtr vec[5];
435 } vec_info_5;
436
437 typedef struct {
438   StgInfoTable i;
439   StgFunPtr vec[6];
440 } vec_info_6;
441
442 typedef struct {
443   StgInfoTable i;
444   StgFunPtr vec[7];
445 } vec_info_7;
446
447 typedef struct {
448   StgInfoTable i;
449   StgFunPtr vec[8];
450 } vec_info_8;
451
452 #define VEC_INFO_2(info,bitmap_,srt_,srt_off_,srt_len_,         \
453                    type, info_class,                            \
454                    alt_1, alt_2)                                \
455         info_class INFO_TBL_CONST vec_info_2 info = {           \
456                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
457                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
458                       INIT_ENTRY(NULL),                         \
459                 },                                              \
460                 vec : { alt_1, alt_2 }                          \
461         }
462
463 #define VEC_INFO_3(info,bitmap_,srt_,srt_off_,srt_len_,         \
464                    type, info_class,                            \
465                    alt_1, alt_2, alt_3                          \
466                   )                                             \
467         info_class INFO_TBL_CONST vec_info_3 info = {           \
468                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
469                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
470                       INIT_ENTRY(NULL),                         \
471                 },                                              \
472                 vec : { alt_1, alt_2, alt_3 }                   \
473         }
474
475 #define VEC_INFO_4(info,bitmap_,srt_,srt_off_,srt_len_,         \
476                    type, info_class,                            \
477                    alt_1, alt_2, alt_3, alt_4                   \
478                   )                                             \
479         info_class INFO_TBL_CONST vec_info_4 info = {           \
480                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
481                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
482                       INIT_ENTRY(NULL),                         \
483                 },                                              \
484                 vec : { alt_1, alt_2, alt_3, alt_4 }            \
485         }
486
487 #define VEC_INFO_5(info,bitmap_,srt_,srt_off_,srt_len_,         \
488                    type, info_class,                            \
489                    alt_1, alt_2, alt_3, alt_4,                  \
490                    alt_5                                        \
491                   )                                             \
492         info_class INFO_TBL_CONST vec_info_5 info = {           \
493                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
494                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
495                       INIT_ENTRY(NULL),                         \
496                 },                                              \
497                 vec : { alt_1, alt_2, alt_3, alt_4,             \
498                         alt_5 }                                 \
499         }
500
501 #define VEC_INFO_6(info,bitmap_,srt_,srt_off_,srt_len_,         \
502                    type, info_class,                            \
503                    alt_1, alt_2, alt_3, alt_4,                  \
504                    alt_5, alt_6                                 \
505                   )                                             \
506         info_class INFO_TBL_CONST vec_info_6 info = {           \
507                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
508                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
509                       INIT_ENTRY(NULL),                         \
510                 },                                              \
511                 vec : { alt_1, alt_2, alt_3, alt_4,             \
512                         alt_5, alt_6 }                          \
513         }
514
515 #define VEC_INFO_7(info,bitmap_,srt_,srt_off_,srt_len_,         \
516                    type, info_class,                            \
517                    alt_1, alt_2, alt_3, alt_4,                  \
518                    alt_5, alt_6, alt_7                          \
519                   )                                             \
520         info_class INFO_TBL_CONST vec_info_7 info = {           \
521                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
522                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
523                       INIT_ENTRY(NULL),                         \
524                 },                                              \
525                 vec : { alt_1, alt_2, alt_3, alt_4,             \
526                         alt_5, alt_6, alt_7 }                   \
527         }
528
529 #define VEC_INFO_8(info,bitmap_,srt_,srt_off_,srt_len_,         \
530                    type, info_class,                            \
531                    alt_1, alt_2, alt_3, alt_4,                  \
532                    alt_5, alt_6, alt_7, alt_8                   \
533                   )                                             \
534         info_class INFO_TBL_CONST vec_info_8 info = {           \
535                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
536                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
537                       INIT_ENTRY(NULL),                         \
538                 },                                              \
539                 vec : { alt_1, alt_2, alt_3, alt_4,             \
540                         alt_5, alt_6, alt_7, alt_8 }            \
541         }
542
543 #endif /* TABLES_NEXT_TO_CODE */
544
545 /* For polymorphic activation records, we need both a direct return
546  * address and a return vector:
547  */
548
549 typedef vec_info_8 StgPolyInfoTable;
550
551 #ifndef TABLES_NEXT_TO_CODE
552
553 #define VEC_POLY_INFO_TABLE(nm, bitmap_,                        \
554                            srt_, srt_off_, srt_len_,            \
555                            type, info_class, entry_class        \
556                            )                                    \
557   info_class INFO_TBL_CONST vec_info_8 nm##_info = {            \
558                 i : { layout : { bitmap : (StgWord32)bitmap_ }, \
559                       SRT_INFO(type,srt_,srt_off_,srt_len_),    \
560                       INIT_ENTRY(nm##_entry),                   \
561                       INIT_VECTOR                               \
562                 },                                              \
563                 vec : {                                         \
564                         (F_) nm##_0_entry,                      \
565                         (F_) nm##_1_entry,                      \
566                         (F_) nm##_2_entry,                      \
567                         (F_) nm##_3_entry,                      \
568                         (F_) nm##_4_entry,                      \
569                         (F_) nm##_5_entry,                      \
570                         (F_) nm##_6_entry,                      \
571                         (F_) nm##_7_entry                       \
572                 }                                               \
573             }
574 #else
575
576 #define VEC_POLY_INFO_TABLE(nm, bitmap_,                        \
577                            srt_, srt_off_, srt_len_,            \
578                            type, info_class, entry_class        \
579                            )                                    \
580         info_class INFO_TBL_CONST vec_info_8 nm##_info = {      \
581                 {                                               \
582                         (F_) nm##_7_entry,                      \
583                         (F_) nm##_6_entry,                      \
584                         (F_) nm##_5_entry,                      \
585                         (F_) nm##_4_entry,                      \
586                         (F_) nm##_3_entry,                      \
587                         (F_) nm##_2_entry,                      \
588                         (F_) nm##_1_entry,                      \
589                         (F_) nm##_0_entry                       \
590                 },                                              \
591                 i : {                                           \
592                    layout : { bitmap : (StgWord32)bitmap_ },    \
593                    SRT_INFO(type,srt_,srt_off_,srt_len_),       \
594                    INIT_ENTRY(nm##_entry)                       \
595                 }                                               \
596         }
597
598 #endif
599
600 #define SRT(lbl) \
601   static const StgSRT lbl = {
602
603 #define BITMAP(lbl,size) \
604   static const StgLargeBitmap lbl = { size, {
605
606 /* DLL_SRT_ENTRY is used on the Win32 side when filling initialising
607    an entry in an SRT table with a reference to a closure that's
608    living in a DLL. See elsewhere for reasons as to why we need
609    to distinguish these kinds of references.
610    (ToDo: fill in a more precise href.)
611 */
612 #ifdef HAVE_WIN32_DLL_SUPPORT
613 #define DLL_SRT_ENTRY(x) ((StgClosure*)(((char*)&DLL_IMPORT_DATA_VAR(x)) + 1))
614 #else
615 #define DLL_SRT_ENTRY(x) no-can-do
616 #endif
617
618 #endif /* INFOMACROS_H */