[project @ 2000-03-16 17:27:12 by simonmar]
[ghc-hetmet.git] / ghc / rts / Prelude.h
1 /* -----------------------------------------------------------------------------
2  * $Id: Prelude.h,v 1.5 2000/03/16 17:27:13 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_static_closure;
19 extern DLL_IMPORT const StgClosure PrelBase_False_static_closure;
20 extern DLL_IMPORT const StgClosure PrelPack_unpackCString_closure;
21 extern DLL_IMPORT const StgClosure PrelException_stackOverflow_closure;
22 extern DLL_IMPORT const StgClosure PrelException_heapOverflow_closure;
23 extern const StgClosure PrelMain_mainIO_closure;
24
25 extern DLL_IMPORT const StgClosure PrelException_PutFullMVar_static_closure;
26 extern DLL_IMPORT const StgClosure PrelException_BlockedOnDeadMVar_static_closure;
27 extern DLL_IMPORT const StgClosure PrelException_NonTermination_static_closure;
28
29 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_static_info;
30 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_static_info;
31 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_static_info;
32 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_static_info;
33 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_static_info;
34 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_static_info;
35 extern DLL_IMPORT const StgInfoTable PrelBase_Czh_con_info;
36 extern DLL_IMPORT const StgInfoTable PrelBase_Izh_con_info;
37 extern DLL_IMPORT const StgInfoTable PrelFloat_Fzh_con_info;
38 extern DLL_IMPORT const StgInfoTable PrelFloat_Dzh_con_info;
39 extern DLL_IMPORT const StgInfoTable PrelAddr_Azh_con_info;
40 extern DLL_IMPORT const StgInfoTable PrelAddr_Wzh_con_info;
41 extern DLL_IMPORT const StgInfoTable PrelAddr_I64zh_con_info;
42 extern DLL_IMPORT const StgInfoTable PrelAddr_W64zh_con_info;
43 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_static_info;
44 extern DLL_IMPORT const StgInfoTable PrelStable_StablePtr_con_info;
45
46 #define True_closure           (&PrelBase_True_static_closure)
47 #define False_closure          (&PrelBase_False_static_closure)
48 #define stackOverflow_closure  (&PrelException_stackOverflow_closure)
49 #define heapOverflow_closure   (&PrelException_heapOverflow_closure)
50 #define PutFullMVar_closure    (&PrelException_PutFullMVar_static_closure)
51 #define BlockedOnDeadMVar_closure (&PrelException_BlockedOnDeadMVar_static_closure)
52 #define NonTermination_closure (&PrelException_NonTermination_static_closure)
53 #define Czh_static_info        (&PrelBase_Czh_static_info)
54 #define Izh_static_info        (&PrelBase_Izh_static_info)
55 #define Fzh_static_info        (&PrelFloat_Fzh_static_info)
56 #define Dzh_static_info        (&PrelFloat_Dzh_static_info)
57 #define Azh_static_info        (&PrelAddr_Azh_static_info)
58 #define Wzh_static_info        (&PrelAddr_Wzh_static_info)
59 #define Czh_con_info           (&PrelBase_Czh_con_info)
60 #define Izh_con_info           (&PrelBase_Izh_con_info)
61 #define Fzh_con_info           (&PrelFloat_Fzh_con_info)
62 #define Dzh_con_info           (&PrelFloat_Dzh_con_info)
63 #define Azh_con_info           (&PrelAddr_Azh_con_info)
64 #define Wzh_con_info           (&PrelAddr_Wzh_con_info)
65 #define W64zh_con_info         (&PrelAddr_W64zh_con_info)
66 #define I64zh_con_info         (&PrelAddr_I64zh_con_info)
67 #define StablePtr_static_info  (&PrelStable_StablePtr_static_info)
68 #define StablePtr_con_info     (&PrelStable_StablePtr_con_info)
69 #define mainIO_closure         (&PrelMain_mainIO_closure)
70 #define unpackCString_closure  (&PrelPack_unpackCString_closure)
71
72 #else /* INTERPRETER */
73
74 /* We need indirections to the Prelude stuff, because we can't link
75  * these symbols statically.
76  */
77 extern const StgClosure *ind_True_static_closure;
78 extern const StgClosure *ind_False_static_closure;
79 extern const StgClosure *ind_unpackCString_closure;
80 extern const StgClosure *ind_stackOverflow_closure;
81 extern const StgClosure *ind_heapOverflow_closure;
82 extern const StgClosure *ind_PutFullMVar_static_closure;
83 extern const StgClosure *ind_BlockedOnDeadMVar_static_closure;
84 extern const StgClosure *ind_NonTermination_static_closure;
85
86 extern const StgInfoTable *ind_Czh_static_info;
87 extern const StgInfoTable *ind_Izh_static_info;
88 extern const StgInfoTable *ind_Fzh_static_info;
89 extern const StgInfoTable *ind_Dzh_static_info;
90 extern const StgInfoTable *ind_Azh_static_info;
91 extern const StgInfoTable *ind_Wzh_static_info;
92 extern const StgInfoTable *ind_Czh_con_info;
93 extern const StgInfoTable *ind_Izh_con_info;
94 extern const StgInfoTable *ind_Fzh_con_info;
95 extern const StgInfoTable *ind_Dzh_con_info;
96 extern const StgInfoTable *ind_Azh_con_info;
97 extern const StgInfoTable *ind_Wzh_con_info;
98 extern const StgInfoTable *ind_I64zh_con_info;
99 extern const StgInfoTable *ind_W64zh_con_info;
100 extern const StgInfoTable *ind_StablePtr_static_info;
101 extern const StgInfoTable *ind_StablePtr_con_info;
102
103 #define True_closure           ind_True_static_closure
104 #define False_closure          ind_False_static_closure
105 #define stackOverflow_closure  ind_stackOverflow_closure
106 #define heapOverflow_closure   ind_heapOverflow_closure
107 #define PutFullMVar_closure    ind_PutFullMVar_static_closure
108 #define BlockedOnDeadMVar_closure ind_BlockedOnDeadMVar_static_closure
109 #define NonTermination_closure ind_NonTermination_static_closure
110 #define Czh_static_info        ind_Czh_static_info
111 #define Izh_static_info        ind_Izh_static_info
112 #define Fzh_static_info        ind_Fzh_static_info
113 #define Dzh_static_info        ind_Dzh_static_info
114 #define Azh_static_info        ind_Azh_static_info
115 #define Wzh_static_info        ind_Wzh_static_info
116 #define Czh_con_info           ind_Czh_con_info
117 #define Izh_con_info           ind_Izh_con_info
118 #define Fzh_con_info           ind_Fzh_con_info
119 #define Dzh_con_info           ind_Dzh_con_info
120 #define Azh_con_info           ind_Azh_con_info
121 #define Wzh_con_info           ind_Wzh_con_info
122 #define W64zh_con_info         ind_W64zh_con_info
123 #define I64zh_con_info         ind_I64zh_con_info
124 #define StablePtr_static_info  ind_StablePtr_static_info
125 #define StablePtr_con_info     ind_StablePtr_con_info
126 #define unpackCString_closure  ind_unpackCString_closure
127
128 #endif
129
130 void fixupRTStoPreludeRefs( void*(*)(char*) );
131
132 #endif /* PRELUDE_H */