[project @ 2000-07-07 11:03:57 by simonmar]
[ghc-hetmet.git] / ghc / rts / Prelude.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Prelude.h,v 1.12 2000/07/07 11:03:57 simonmar Exp $
3  *
4  * (c) The GHC Team, 1998-2000
5  *
6  * Prelude identifiers that we sometimes need to refer to in the RTS.
7  *
8  * ---------------------------------------------------------------------------*/
9
10 #ifndef PRELUDE_H
11 #define PRELUDE_H
12
13 /* Define canonical names so we can abstract away from the actual
14  * module these names are defined in.
15  */
16
17 #ifndef INTERPRETER
18 extern DLL_IMPORT const StgClosure PrelBase_True_closure;
19 extern DLL_IMPORT const StgClosure PrelBase_False_closure;
20 extern DLL_IMPORT const StgClosure PrelPack_unpackCString_closure;
21 extern DLL_IMPORT const StgClosure PrelWeak_runFinalizzerBatch_closure;
22 extern const StgClosure PrelMain_mainIO_closure;
23
24 extern DLL_IMPORT const StgClosure PrelIOBase_stackOverflow_closure;
25 extern DLL_IMPORT const StgClosure PrelIOBase_heapOverflow_closure;
26 extern DLL_IMPORT const StgClosure PrelIOBase_PutFullMVar_closure;
27 extern DLL_IMPORT const StgClosure PrelIOBase_BlockedOnDeadMVar_closure;
28 extern DLL_IMPORT const StgClosure PrelIOBase_NonTermination_closure;
29
30 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_static_info;
31 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_static_info;
32 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_static_info;
33 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_static_info;
34 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_static_info;
35 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_static_info;
36 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_con_info;
37 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_con_info;
38 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_con_info;
39 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_con_info;
40 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_con_info;
41 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_con_info;
42 extern DLL_IMPORT const StgInfoTable PrelAddr_I64zh_con_info;
43 extern DLL_IMPORT const StgInfoTable PrelAddr_W64zh_con_info;
44 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_static_info;
45 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_con_info;
46
47 #define True_closure              (&PrelBase_True_closure)
48 #define False_closure             (&PrelBase_False_closure)
49 #define unpackCString_closure     (&PrelPack_unpackCString_closure)
50 #define runFinalizerBatch_closure (&PrelWeak_runFinalizzerBatch_closure)
51 #define mainIO_closure            (&PrelMain_mainIO_closure)
52
53 #define stackOverflow_closure     (&PrelIOBase_stackOverflow_closure)
54 #define heapOverflow_closure      (&PrelIOBase_heapOverflow_closure)
55 #define PutFullMVar_closure       (&PrelIOBase_PutFullMVar_closure)
56 #define BlockedOnDeadMVar_closure (&PrelIOBase_BlockedOnDeadMVar_closure)
57 #define NonTermination_closure    (&PrelIOBase_NonTermination_closure)
58
59 #define Czh_static_info           (&PrelBase_Czh_static_info)
60 #define Izh_static_info           (&PrelBase_Izh_static_info)
61 #define Fzh_static_info           (&PrelFloat_Fzh_static_info)
62 #define Dzh_static_info           (&PrelFloat_Dzh_static_info)
63 #define Azh_static_info           (&PrelAddr_Azh_static_info)
64 #define Wzh_static_info           (&PrelAddr_Wzh_static_info)
65 #define Czh_con_info              (&PrelBase_Czh_con_info)
66 #define Izh_con_info              (&PrelBase_Izh_con_info)
67 #define Fzh_con_info              (&PrelFloat_Fzh_con_info)
68 #define Dzh_con_info              (&PrelFloat_Dzh_con_info)
69 #define Azh_con_info              (&PrelAddr_Azh_con_info)
70 #define Wzh_con_info              (&PrelAddr_Wzh_con_info)
71 #define W64zh_con_info            (&PrelAddr_W64zh_con_info)
72 #define I64zh_con_info            (&PrelAddr_I64zh_con_info)
73 #define StablePtr_static_info     (&PrelStable_StablePtr_static_info)
74 #define StablePtr_con_info        (&PrelStable_StablePtr_con_info)
75
76 #else /* INTERPRETER */
77
78 /* We need indirections to the Prelude stuff, because we can't link
79  * these symbols statically.
80  */
81 extern const StgClosure *ind_True_closure;
82 extern const StgClosure *ind_False_closure;
83 extern const StgClosure *ind_unpackCString_closure;
84 extern const StgClosure *ind_runFinalizerBatch_closure;
85
86 extern const StgClosure *ind_stackOverflow_closure;
87 extern const StgClosure *ind_heapOverflow_closure;
88 extern const StgClosure *ind_PutFullMVar_closure;
89 extern const StgClosure *ind_BlockedOnDeadMVar_closure;
90 extern const StgClosure *ind_NonTermination_closure;
91
92 extern const StgInfoTable *ind_Czh_static_info;
93 extern const StgInfoTable *ind_Izh_static_info;
94 extern const StgInfoTable *ind_Fzh_static_info;
95 extern const StgInfoTable *ind_Dzh_static_info;
96 extern const StgInfoTable *ind_Azh_static_info;
97 extern const StgInfoTable *ind_Wzh_static_info;
98 extern const StgInfoTable *ind_Czh_con_info;
99 extern const StgInfoTable *ind_Izh_con_info;
100 extern const StgInfoTable *ind_Fzh_con_info;
101 extern const StgInfoTable *ind_Dzh_con_info;
102 extern const StgInfoTable *ind_Azh_con_info;
103 extern const StgInfoTable *ind_Wzh_con_info;
104 extern const StgInfoTable *ind_I64zh_con_info;
105 extern const StgInfoTable *ind_W64zh_con_info;
106 extern const StgInfoTable *ind_StablePtr_static_info;
107 extern const StgInfoTable *ind_StablePtr_con_info;
108
109 #define True_closure           ind_True_closure
110 #define False_closure          ind_False_closure
111 #define unpackCString_closure  ind_unpackCString_closure
112 #define runFinalizerBatch_closure ind_runFinalizerBatch_closure
113
114 #define stackOverflow_closure  ind_stackOverflow_closure
115 #define heapOverflow_closure   ind_heapOverflow_closure
116 #define PutFullMVar_closure    ind_PutFullMVar_closure
117 #define BlockedOnDeadMVar_closure ind_BlockedOnDeadMVar_closure
118 #define NonTermination_closure ind_NonTermination_closure
119
120 #define Czh_static_info        ind_Czh_static_info
121 #define Izh_static_info        ind_Izh_static_info
122 #define Fzh_static_info        ind_Fzh_static_info
123 #define Dzh_static_info        ind_Dzh_static_info
124 #define Azh_static_info        ind_Azh_static_info
125 #define Wzh_static_info        ind_Wzh_static_info
126 #define Czh_con_info           ind_Czh_con_info
127 #define Izh_con_info           ind_Izh_con_info
128 #define Fzh_con_info           ind_Fzh_con_info
129 #define Dzh_con_info           ind_Dzh_con_info
130 #define Azh_con_info           ind_Azh_con_info
131 #define Wzh_con_info           ind_Wzh_con_info
132 #define W64zh_con_info         ind_W64zh_con_info
133 #define I64zh_con_info         ind_I64zh_con_info
134 #define StablePtr_static_info  ind_StablePtr_static_info
135 #define StablePtr_con_info     ind_StablePtr_con_info
136
137 #ifdef XMLAMBDA
138 /* The Inj constructor. Not present in combined mode or compiled code. */
139
140 extern const StgInfoTable *ind_Inj_con_info;
141 #define Inj_con_info           ind_Inj_con_info
142
143 #endif
144
145 #endif
146
147 void fixupRTStoPreludeRefs( void*(*)(char*) );
148
149 #endif /* PRELUDE_H */