Fix ifndef include guard in icall-decl.h. (#18055)
[mono-project.git] / mono / metadata / icall-decl.h
blob763dfb1893b93159c4f0aab0df5046537a264a76
1 /**
2 * \file
3 * Copyright 2018 Microsoft
4 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
5 */
6 #ifndef __MONO_METADATA_ICALL_DECL_H__
7 #define __MONO_METADATA_ICALL_DECL_H__
9 #include "appdomain-icalls.h"
10 #include "class.h"
11 #include "console-io.h"
12 #include "environment.h"
13 #include "file-mmap.h"
14 #include "filewatcher.h"
15 #include "gc-internals.h"
16 #include "handle-decl.h"
17 #include "handle.h"
18 #include "locales.h"
19 #include "marshal.h"
20 #include "monitor.h"
21 #include "mono-perfcounters.h"
22 #include "object-forward.h"
23 #include "object-internals.h"
24 #include "rand.h"
25 #include "reflection.h"
26 #include "security-core-clr.h"
27 #include "security-manager.h"
28 #include "security.h"
29 #include "string-icalls.h"
30 #include "threadpool-io.h"
31 #include "threadpool.h"
32 #include "mono/utils/mono-digest.h"
33 #include "mono/utils/mono-forward-internal.h"
34 #include "w32event.h"
35 #include "w32file.h"
36 #include "w32mutex.h"
37 #include "w32process.h"
38 #include "w32semaphore.h"
39 #include "w32socket.h"
40 #include "mono/utils/mono-proclib.h"
42 /* From MonoProperty.cs */
43 typedef enum {
44 PInfo_Attributes = 1,
45 PInfo_GetMethod = 1 << 1,
46 PInfo_SetMethod = 1 << 2,
47 PInfo_ReflectedType = 1 << 3,
48 PInfo_DeclaringType = 1 << 4,
49 PInfo_Name = 1 << 5
50 } PInfo;
52 #include "icall-table.h"
54 #define NOHANDLES(inner) inner
55 #define HANDLES_REUSE_WRAPPER(...) /* nothing */
57 // Generate prototypes for coop icall wrappers and coop icalls.
58 #define MONO_HANDLE_REGISTER_ICALL(func, ret, nargs, argtypes) \
59 MONO_HANDLE_DECLARE (,,func ## _impl, ret, nargs, argtypes); \
60 MONO_HANDLE_REGISTER_ICALL_DECLARE_RAW (func, ret, nargs, argtypes);
61 #define ICALL_TYPE(id, name, first) /* nothing */
62 #define ICALL(id, name, func) /* nothing */
63 #define HANDLES(id, name, func, ret, nargs, argtypes) \
64 MONO_HANDLE_DECLARE_RAW (id, name, func, ret, nargs, argtypes); \
65 MONO_HANDLE_DECLARE (id, name, func, ret, nargs, argtypes);
66 #include "icall-def.h"
67 #undef ICALL_TYPE
68 #undef ICALL
69 #undef HANDLES
70 #undef HANDLES_REUSE_WRAPPER
71 #undef NOHANDLES
72 #undef MONO_HANDLE_REGISTER_ICALL
74 // This is sorted.
75 // grep ICALL_EXPORT | sort | uniq
76 ICALL_EXPORT MonoAssemblyName* ves_icall_System_Reflection_AssemblyName_GetNativeName (MonoAssembly*);
77 ICALL_EXPORT MonoBoolean ves_icall_RuntimeTypeHandle_is_subclass_of (MonoType*, MonoType*);
78 ICALL_EXPORT MonoBoolean ves_icall_System_Environment_GetIs64BitOperatingSystem (void);
79 ICALL_EXPORT MonoBoolean ves_icall_System_Environment_get_HasShutdownStarted (void);
80 ICALL_EXPORT MonoBoolean ves_icall_System_GCHandle_CheckCurrentDomain (guint32 gchandle);
81 ICALL_EXPORT MonoBoolean ves_icall_System_IO_DriveInfo_GetDiskFreeSpace (const gunichar2*, gint32, guint64*, guint64*, guint64*, gint32*);
82 ICALL_EXPORT MonoBoolean ves_icall_System_Reflection_AssemblyName_ParseAssemblyName (const char*, MonoAssemblyName*, MonoBoolean*, MonoBoolean* is_token_defined_arg);
83 ICALL_EXPORT MonoBoolean ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack (void);
84 ICALL_EXPORT MonoBoolean ves_icall_System_Threading_Thread_YieldInternal (void);
85 ICALL_EXPORT void ves_icall_System_ArgIterator_Setup (MonoArgIterator*, char*, char*);
86 ICALL_EXPORT MonoType* ves_icall_System_ArgIterator_IntGetNextArgType (MonoArgIterator*);
87 ICALL_EXPORT void ves_icall_System_ArgIterator_IntGetNextArg (MonoArgIterator*, MonoTypedRef*);
88 ICALL_EXPORT void ves_icall_System_ArgIterator_IntGetNextArgWithType (MonoArgIterator*, MonoTypedRef*, MonoType*);
89 ICALL_EXPORT double ves_icall_System_Math_Abs_double (double);
90 ICALL_EXPORT double ves_icall_System_Math_Acos (double);
91 ICALL_EXPORT double ves_icall_System_Math_Acosh (double);
92 ICALL_EXPORT double ves_icall_System_Math_Asin (double);
93 ICALL_EXPORT double ves_icall_System_Math_Asinh (double);
94 ICALL_EXPORT double ves_icall_System_Math_Atan (double);
95 ICALL_EXPORT double ves_icall_System_Math_Atan2 (double, double);
96 ICALL_EXPORT double ves_icall_System_Math_Atanh (double);
97 ICALL_EXPORT double ves_icall_System_Math_Cbrt (double);
98 ICALL_EXPORT double ves_icall_System_Math_Ceiling (double);
99 ICALL_EXPORT double ves_icall_System_Math_Cos (double);
100 ICALL_EXPORT double ves_icall_System_Math_Cosh (double);
101 ICALL_EXPORT double ves_icall_System_Math_Exp (double);
102 ICALL_EXPORT double ves_icall_System_Math_FMod (double, double);
103 ICALL_EXPORT double ves_icall_System_Math_Floor (double);
104 ICALL_EXPORT double ves_icall_System_Math_Log (double);
105 ICALL_EXPORT double ves_icall_System_Math_Log10 (double);
106 ICALL_EXPORT double ves_icall_System_Math_ModF (double, double*);
107 ICALL_EXPORT double ves_icall_System_Math_Pow (double, double);
108 ICALL_EXPORT double ves_icall_System_Math_Round (double);
109 ICALL_EXPORT double ves_icall_System_Math_Sin (double);
110 ICALL_EXPORT double ves_icall_System_Math_Sinh (double);
111 ICALL_EXPORT double ves_icall_System_Math_Sqrt (double);
112 ICALL_EXPORT double ves_icall_System_Math_Tan (double);
113 ICALL_EXPORT double ves_icall_System_Math_Tanh (double);
114 ICALL_EXPORT float ves_icall_System_MathF_Acos (float);
115 ICALL_EXPORT float ves_icall_System_MathF_Acosh (float);
116 ICALL_EXPORT float ves_icall_System_MathF_Asin (float);
117 ICALL_EXPORT float ves_icall_System_MathF_Asinh (float);
118 ICALL_EXPORT float ves_icall_System_MathF_Atan (float);
119 ICALL_EXPORT float ves_icall_System_MathF_Atan2 (float, float);
120 ICALL_EXPORT float ves_icall_System_MathF_Atanh (float);
121 ICALL_EXPORT float ves_icall_System_MathF_Cbrt (float);
122 ICALL_EXPORT float ves_icall_System_MathF_Ceiling (float);
123 ICALL_EXPORT float ves_icall_System_MathF_Cos (float);
124 ICALL_EXPORT float ves_icall_System_MathF_Cosh (float);
125 ICALL_EXPORT float ves_icall_System_MathF_Exp (float);
126 ICALL_EXPORT float ves_icall_System_MathF_FMod (float, float);
127 ICALL_EXPORT float ves_icall_System_MathF_Floor (float);
128 ICALL_EXPORT float ves_icall_System_MathF_Log (float);
129 ICALL_EXPORT float ves_icall_System_MathF_Log10 (float);
130 ICALL_EXPORT float ves_icall_System_MathF_ModF (float, float*);
131 ICALL_EXPORT float ves_icall_System_MathF_Pow (float, float);
132 ICALL_EXPORT float ves_icall_System_MathF_Sin (float);
133 ICALL_EXPORT float ves_icall_System_MathF_Sinh (float);
134 ICALL_EXPORT float ves_icall_System_MathF_Sqrt (float);
135 ICALL_EXPORT float ves_icall_System_MathF_Tan (float);
136 ICALL_EXPORT float ves_icall_System_MathF_Tanh (float);
137 ICALL_EXPORT float ves_icall_System_Math_Abs_single (float);
138 #if ENABLE_NETCORE
139 ICALL_EXPORT gint32 ves_icall_System_Math_ILogB (double);
140 ICALL_EXPORT double ves_icall_System_Math_Log2 (double);
141 ICALL_EXPORT double ves_icall_System_Math_ScaleB (double, gint32);
142 ICALL_EXPORT double ves_icall_System_Math_FusedMultiplyAdd (double, double, double);
143 ICALL_EXPORT gint32 ves_icall_System_MathF_ILogB (float);
144 ICALL_EXPORT float ves_icall_System_MathF_Log2 (float);
145 ICALL_EXPORT float ves_icall_System_MathF_ScaleB (float, gint32);
146 ICALL_EXPORT float ves_icall_System_MathF_FusedMultiplyAdd (float, float, float);
147 #endif
148 ICALL_EXPORT gint ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData (void);
149 ICALL_EXPORT gint32 ves_icall_System_Environment_get_ProcessorCount (void);
150 ICALL_EXPORT gint32 ves_icall_System_Environment_get_TickCount (void);
151 #if ENABLE_NETCORE
152 ICALL_EXPORT gint64 ves_icall_System_Environment_get_TickCount64 (void);
153 #endif
154 ICALL_EXPORT gint64 ves_icall_System_DateTime_GetSystemTimeAsFileTime (void);
155 ICALL_EXPORT gint64 ves_icall_System_Diagnostics_Process_GetProcessData (int, gint32, MonoProcessError*);
156 ICALL_EXPORT gint64 ves_icall_System_Diagnostics_Stopwatch_GetTimestamp (void);
157 ICALL_EXPORT gint64 ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection);
158 ICALL_EXPORT gint64 ves_icall_System_Threading_Timer_GetTimeMonotonic (void);
159 ICALL_EXPORT gpointer ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle);
160 ICALL_EXPORT int ves_icall_Interop_Sys_DoubleToString (double, char*, char*, int);
161 ICALL_EXPORT int ves_icall_System_Environment_get_Platform (void);
162 ICALL_EXPORT int ves_icall_System_GC_GetCollectionCount (int);
163 ICALL_EXPORT int ves_icall_System_GC_GetMaxGeneration (void);
164 ICALL_EXPORT gint64 ves_icall_System_GC_GetAllocatedBytesForCurrentThread (void);
165 ICALL_EXPORT int ves_icall_System_Threading_Thread_SystemMaxStackSize (void);
166 ICALL_EXPORT int ves_icall_get_method_attributes (MonoMethod* method);
167 ICALL_EXPORT void ves_icall_Mono_Runtime_RegisterReportingForNativeLib (const char*, const char*);
168 ICALL_EXPORT void ves_icall_Mono_Runtime_RegisterReportingForAllNativeLibs (void);
169 ICALL_EXPORT void ves_icall_System_Array_GetGenericValue_icall (MonoArray**, guint32, gpointer);
170 ICALL_EXPORT void ves_icall_System_Array_SetGenericValue_icall (MonoArray**, guint32, gpointer);
171 ICALL_EXPORT void ves_icall_System_Buffer_MemcpyInternal (gpointer dest, gconstpointer src, gint32 count);
172 ICALL_EXPORT void ves_icall_System_Environment_Exit (int);
173 ICALL_EXPORT void ves_icall_System_GCHandle_FreeHandle (guint32 handle);
174 ICALL_EXPORT void ves_icall_System_GC_InternalCollect (int generation);
175 ICALL_EXPORT void ves_icall_System_GC_RecordPressure (gint64);
176 ICALL_EXPORT void ves_icall_System_GC_WaitForPendingFinalizers (void);
177 ICALL_EXPORT void ves_icall_System_GC_GetGCMemoryInfo (gint64*, gint64*, gint64*, gint64*, gint64*);
178 #if !ENABLE_NETCORE
179 ICALL_EXPORT void ves_icall_System_IO_LogcatTextWriter_Log (const char*, gint32, const char*);
180 #endif
181 ICALL_EXPORT void ves_icall_System_NumberFormatter_GetFormatterTables (guint64 const**, gint32 const**, gunichar2 const**, gunichar2 const**, gint64 const**, gint32 const**);
182 #if ENABLE_NETCORE
183 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_Memmove (guint8*, guint8*, size_t);
184 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_RhBulkMoveWithWriteBarrier (guint8*, guint8*, size_t);
185 #else
186 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_Memmove (guint8*, guint8*, guint);
187 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier (guint8*, guint8*, guint, MonoType*);
188 #endif
189 #if ENABLE_NETCORE
190 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8*, size_t);
191 #else
192 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8*, guint);
193 #endif
194 ICALL_EXPORT void ves_icall_System_Runtime_RuntimeImports_ecvt_s(char*, size_t, double, int, int*, int*);
195 #if defined(ENABLE_MONODROID) || defined(ENABLE_MONOTOUCH) || defined(TARGET_WASM)
196 ICALL_EXPORT gpointer ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress, MonoBoolean gzip, gpointer feeder, gpointer data);
197 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream);
198 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_Flush (gpointer stream);
199 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream, gpointer buffer, gint32 length);
200 ICALL_EXPORT gint32 ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream, gpointer buffer, gint32 length);
201 #endif
202 #if defined(ENABLE_MONODROID)
203 ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CreateNLSocket (void);
204 ICALL_EXPORT gint32 ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_ReadEvents (gpointer sock, gpointer buffer, gint32 count, gint32 size);
205 ICALL_EXPORT gpointer ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CloseNLSocket (gpointer sock);
206 #endif
208 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_CloseProcess (gpointer handle);
209 ICALL_EXPORT gpointer ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcess (void);
210 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_GetCurrentProcessId (void);
211 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetExitCodeProcess (gpointer handle, gint32 *exitcode);
212 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_GetPriorityClass (gpointer handle);
213 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetProcessTimes (gpointer handle, gint64 *creation_time, gint64 *exit_time, gint64 *kernel_time, gint64 *user_time);
214 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_GetProcessWorkingSetSize (gpointer handle, gsize *min, gsize *max);
215 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetPriorityClass (gpointer handle, gint32 priorityClass);
216 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_SetProcessWorkingSetSize (gpointer handle, gsize min, gsize max);
217 ICALL_EXPORT MonoBoolean ves_icall_Microsoft_Win32_NativeMethods_TerminateProcess (gpointer handle, gint32 exitcode);
218 ICALL_EXPORT gint32 ves_icall_Microsoft_Win32_NativeMethods_WaitForInputIdle (gpointer handle, gint32 milliseconds);
219 ICALL_EXPORT MonoBoolean ves_icall_Mono_TlsProviderFactory_IsBtlsSupported (void);
220 ICALL_EXPORT void ves_icall_Mono_Runtime_AnnotateMicrosoftTelemetry (const char *key, const char *value);
221 ICALL_EXPORT void ves_icall_Mono_Runtime_DisableMicrosoftTelemetry (void);
222 ICALL_EXPORT int ves_icall_Mono_Runtime_CheckCrashReportingLog (const char *directory, MonoBoolean clear);
223 ICALL_EXPORT void ves_icall_Mono_Runtime_EnableCrashReportingLog (const char *directory);
224 ICALL_EXPORT void ves_icall_System_Array_InternalCreate (MonoArray *volatile* result, MonoType* type, gint32 rank, gint32* pLengths, gint32* pLowerBounds);
225 ICALL_EXPORT MonoBoolean ves_icall_System_Array_CanChangePrimitive (MonoReflectionType *volatile* ref_src_type_handle, MonoReflectionType *volatile* ref_dst_type_handle, MonoBoolean reliable);
226 ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsAttached_internal (void);
227 ICALL_EXPORT MonoBoolean ves_icall_System_Diagnostics_Debugger_IsLogging (void);
228 ICALL_EXPORT void ves_icall_System_Diagnostics_Debugger_Log (int level, MonoString *volatile* category, MonoString *volatile* message);
229 ICALL_EXPORT void ves_icall_Mono_RuntimeGPtrArrayHandle_GPtrArrayFree (GPtrArray *ptr_array);
230 ICALL_EXPORT void ves_icall_Mono_RuntimeMarshal_FreeAssemblyName (MonoAssemblyName *aname, MonoBoolean free_struct);
231 ICALL_EXPORT void ves_icall_Mono_SafeStringMarshal_GFree (void *c_str);
232 ICALL_EXPORT char* ves_icall_Mono_SafeStringMarshal_StringToUtf8 (MonoString *volatile* s);
233 ICALL_EXPORT MonoType* ves_icall_Mono_RuntimeClassHandle_GetTypeFromClass (MonoClass *klass);
234 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_CanSecure (const gunichar2*);
235 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsMachineProtected (const gunichar2*);
236 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_IsUserProtected (const gunichar2*);
237 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectMachine (const gunichar2*);
238 ICALL_EXPORT MonoBoolean ves_icall_Mono_Security_Cryptography_KeyPairPersistence_ProtectUser (const gunichar2*);
240 #endif // __MONO_METADATA_ICALL_DECL_H__