Replace hashing function for string keys implementation with xxhash
[ghc.git] / rts / Prelude.h
1 /* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2005
4 *
5 * Prelude identifiers that we sometimes need to refer to in the RTS.
6 *
7 * ---------------------------------------------------------------------------*/
8
9 #pragma once
10
11 /* These definitions are required by the RTS .cmm files too, so we
12 * need declarations that we can #include into the generated .hc files.
13 */
14 #if IN_STG_CODE
15 #define PRELUDE_INFO(i) extern W_(i)[]
16 #define PRELUDE_CLOSURE(i) extern W_(i)[]
17 #else
18 #define PRELUDE_INFO(i) extern const StgInfoTable DLL_IMPORT_DATA_VARNAME(i)
19 #define PRELUDE_CLOSURE(i) extern StgClosure DLL_IMPORT_DATA_VARNAME(i)
20 #endif
21
22 /* Define canonical names so we can abstract away from the actual
23 * modules these names are defined in.
24 */
25
26 PRELUDE_CLOSURE(ghczmprim_GHCziTuple_Z0T_closure);
27 PRELUDE_CLOSURE(ghczmprim_GHCziTypes_True_closure);
28 PRELUDE_CLOSURE(ghczmprim_GHCziTypes_False_closure);
29 PRELUDE_CLOSURE(base_GHCziPack_unpackCString_closure);
30 PRELUDE_CLOSURE(base_GHCziWeak_runFinalizzerBatch_closure);
31
32 #if defined(IN_STG_CODE)
33 extern W_ ZCMain_main_closure[];
34 #else
35 extern StgClosure ZCMain_main_closure;
36 #endif
37
38 PRELUDE_CLOSURE(base_GHCziIOziException_stackOverflow_closure);
39 PRELUDE_CLOSURE(base_GHCziIOziException_heapOverflow_closure);
40 PRELUDE_CLOSURE(base_GHCziIOziException_allocationLimitExceeded_closure);
41 PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure);
42 PRELUDE_CLOSURE(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure);
43 PRELUDE_CLOSURE(base_GHCziIOziException_cannotCompactFunction_closure);
44 PRELUDE_CLOSURE(base_GHCziIOziException_cannotCompactPinned_closure);
45 PRELUDE_CLOSURE(base_GHCziIOziException_cannotCompactMutable_closure);
46 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nonTermination_closure);
47 PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
48 PRELUDE_CLOSURE(base_GHCziEventziThread_blockedOnBadFD_closure);
49
50 PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
51 PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
52 PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure);
53 PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlersPtr_closure);
54
55 PRELUDE_CLOSURE(base_GHCziTopHandler_flushStdHandles_closure);
56 PRELUDE_CLOSURE(base_GHCziTopHandler_runMainIO_closure);
57
58 PRELUDE_INFO(ghczmprim_GHCziTypes_Czh_con_info);
59 PRELUDE_INFO(ghczmprim_GHCziTypes_Izh_con_info);
60 PRELUDE_INFO(ghczmprim_GHCziTypes_Fzh_con_info);
61 PRELUDE_INFO(ghczmprim_GHCziTypes_Dzh_con_info);
62 PRELUDE_INFO(ghczmprim_GHCziTypes_Wzh_con_info);
63
64 PRELUDE_INFO(base_GHCziPtr_Ptr_con_info);
65 PRELUDE_INFO(base_GHCziPtr_FunPtr_con_info);
66 PRELUDE_INFO(base_GHCziInt_I8zh_con_info);
67 PRELUDE_INFO(base_GHCziInt_I16zh_con_info);
68 PRELUDE_INFO(base_GHCziInt_I32zh_con_info);
69 PRELUDE_INFO(base_GHCziInt_I64zh_con_info);
70 PRELUDE_INFO(base_GHCziWord_W8zh_con_info);
71 PRELUDE_INFO(base_GHCziWord_W16zh_con_info);
72 PRELUDE_INFO(base_GHCziWord_W32zh_con_info);
73 PRELUDE_INFO(base_GHCziWord_W64zh_con_info);
74 PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
75
76 #define Unit_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTuple_Z0T_closure)
77 #define True_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_True_closure)
78 #define False_closure DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_False_closure)
79 #define unpackCString_closure DLL_IMPORT_DATA_REF(base_GHCziPack_unpackCString_closure)
80 #define runFinalizerBatch_closure DLL_IMPORT_DATA_REF(base_GHCziWeak_runFinalizzerBatch_closure)
81 #define mainIO_closure (&ZCMain_main_closure)
82
83 #define runSparks_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
84 #define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
85 #define ioManagerCapabilitiesChanged_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure)
86 #define runHandlersPtr_closure DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlersPtr_closure)
87
88 #define flushStdHandles_closure DLL_IMPORT_DATA_REF(base_GHCziTopHandler_flushStdHandles_closure)
89 #define runMainIO_closure DLL_IMPORT_DATA_REF(base_GHCziTopHandler_runMainIO_closure)
90
91 #define stackOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_stackOverflow_closure)
92 #define heapOverflow_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_heapOverflow_closure)
93 #define allocationLimitExceeded_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_allocationLimitExceeded_closure)
94 #define blockedIndefinitelyOnMVar_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnMVar_closure)
95 #define blockedIndefinitelyOnSTM_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_blockedIndefinitelyOnSTM_closure)
96 #define cannotCompactFunction_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_cannotCompactFunction_closure)
97 #define cannotCompactPinned_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_cannotCompactPinned_closure)
98 #define cannotCompactMutable_closure DLL_IMPORT_DATA_REF(base_GHCziIOziException_cannotCompactMutable_closure)
99 #define nonTermination_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nonTermination_closure)
100 #define nestedAtomically_closure DLL_IMPORT_DATA_REF(base_ControlziExceptionziBase_nestedAtomically_closure)
101 #define blockedOnBadFD_closure DLL_IMPORT_DATA_REF(base_GHCziEventziThread_blockedOnBadFD_closure)
102
103 #define Czh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Czh_con_info)
104 #define Izh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Izh_con_info)
105 #define Fzh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Fzh_con_info)
106 #define Dzh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Dzh_con_info)
107 #define Wzh_con_info DLL_IMPORT_DATA_REF(ghczmprim_GHCziTypes_Wzh_con_info)
108 #define W8zh_con_info DLL_IMPORT_DATA_REF(base_GHCziWord_W8zh_con_info)
109 #define W16zh_con_info DLL_IMPORT_DATA_REF(base_GHCziWord_W16zh_con_info)
110 #define W32zh_con_info DLL_IMPORT_DATA_REF(base_GHCziWord_W32zh_con_info)
111 #define W64zh_con_info DLL_IMPORT_DATA_REF(base_GHCziWord_W64zh_con_info)
112 #define I8zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I8zh_con_info)
113 #define I16zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I16zh_con_info)
114 #define I32zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I32zh_con_info)
115 #define I64zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
116 #define I64zh_con_info DLL_IMPORT_DATA_REF(base_GHCziInt_I64zh_con_info)
117 #define Ptr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtr_Ptr_con_info)
118 #define FunPtr_con_info DLL_IMPORT_DATA_REF(base_GHCziPtr_FunPtr_con_info)
119 #define StablePtr_static_info DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_static_info)
120 #define StablePtr_con_info DLL_IMPORT_DATA_REF(base_GHCziStable_StablePtr_con_info)