3 * Copyright 2018 Microsoft
4 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 #ifndef __MONO_METADATA_ICALL_H__
7 #define __MONO_METADATA_ICALL_H__
9 #include "appdomain-icalls.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"
21 #include "mono-perfcounters.h"
22 #include "mono-route.h"
23 #include "object-forward.h"
24 #include "object-internals.h"
26 #include "reflection.h"
27 #include "security-core-clr.h"
28 #include "security-manager.h"
30 #include "string-icalls.h"
31 #include "threadpool-io.h"
32 #include "threadpool.h"
33 #include "mono/utils/mono-digest.h"
34 #include "mono/utils/mono-forward-internal.h"
38 #include "w32process.h"
39 #include "w32semaphore.h"
40 #include "w32socket.h"
42 /* From MonoProperty.cs */
45 PInfo_GetMethod
= 1 << 1,
46 PInfo_SetMethod
= 1 << 2,
47 PInfo_ReflectedType
= 1 << 3,
48 PInfo_DeclaringType
= 1 << 4,
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"
70 #undef HANDLES_REUSE_WRAPPER
72 #undef MONO_HANDLE_REGISTER_ICALL
75 // grep ICALL_EXPORT | sort | uniq
76 ICALL_EXPORT MonoArray
* ves_icall_System_Environment_GetEnvironmentVariableNames (void);
77 ICALL_EXPORT MonoArray
* ves_icall_System_Environment_GetLogicalDrives (void);
78 ICALL_EXPORT MonoAssemblyName
* ves_icall_System_Reflection_AssemblyName_GetNativeName (MonoAssembly
*);
79 ICALL_EXPORT MonoBoolean
ves_icall_RuntimeTypeHandle_is_subclass_of (MonoType
*, MonoType
*);
80 ICALL_EXPORT MonoBoolean
ves_icall_System_Buffer_BlockCopyInternal (MonoArray
*, gint32
, MonoArray
*, gint32
, gint32
);
81 ICALL_EXPORT MonoBoolean
ves_icall_System_Environment_GetIs64BitOperatingSystem (void);
82 ICALL_EXPORT MonoBoolean
ves_icall_System_Environment_get_HasShutdownStarted (void);
83 ICALL_EXPORT MonoBoolean
ves_icall_System_GCHandle_CheckCurrentDomain (guint32 gchandle
);
84 ICALL_EXPORT MonoBoolean
ves_icall_System_IO_DriveInfo_GetDiskFreeSpace (const gunichar2
*, gint32
, guint64
*, guint64
*, guint64
*, gint32
*);
85 ICALL_EXPORT MonoBoolean
ves_icall_System_Reflection_AssemblyName_ParseAssemblyName (const char*, MonoAssemblyName
*, MonoBoolean
*, MonoBoolean
* is_token_defined_arg
);
86 ICALL_EXPORT MonoBoolean
ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_SufficientExecutionStack (void);
87 ICALL_EXPORT MonoBoolean
ves_icall_System_Threading_Thread_YieldInternal (void);
88 ICALL_EXPORT MonoBoolean
ves_icall_System_ValueType_Equals (MonoObject
* this_obj
, MonoObject
* that
, MonoArray
** fields
);
89 ICALL_EXPORT MonoObject
* ves_icall_InternalExecute (MonoReflectionMethod
*, MonoObject
*, MonoArray
*, MonoArray
**);
90 ICALL_EXPORT MonoObject
* ves_icall_InternalInvoke (MonoReflectionMethod
*, MonoObject
*, MonoArray
*, MonoException
**);
91 ICALL_EXPORT MonoObject
* ves_icall_RuntimeFieldInfo_GetRawConstantValue (MonoReflectionField
* rfield
);
92 ICALL_EXPORT MonoObject
* ves_icall_RuntimeFieldInfo_GetValueInternal (MonoReflectionField
* field
, MonoObject
* obj
);
93 ICALL_EXPORT MonoObject
* ves_icall_property_info_get_default_value (MonoReflectionProperty
*);
94 ICALL_EXPORT MonoReflectionType
* ves_icall_Remoting_RealProxy_InternalGetProxyType (MonoTransparentProxy
*);
95 ICALL_EXPORT
void ves_icall_System_ArgIterator_Setup (MonoArgIterator
*, char*, char*);
96 ICALL_EXPORT MonoType
* ves_icall_System_ArgIterator_IntGetNextArgType (MonoArgIterator
*);
97 ICALL_EXPORT
void ves_icall_System_ArgIterator_IntGetNextArg (MonoArgIterator
*, MonoTypedRef
*);
98 ICALL_EXPORT
void ves_icall_System_ArgIterator_IntGetNextArgWithType (MonoArgIterator
*, MonoTypedRef
*, MonoType
*);
99 ICALL_EXPORT
double ves_icall_System_Math_Abs_double (double);
100 ICALL_EXPORT
double ves_icall_System_Math_Acos (double);
101 ICALL_EXPORT
double ves_icall_System_Math_Acosh (double);
102 ICALL_EXPORT
double ves_icall_System_Math_Asin (double);
103 ICALL_EXPORT
double ves_icall_System_Math_Asinh (double);
104 ICALL_EXPORT
double ves_icall_System_Math_Atan (double);
105 ICALL_EXPORT
double ves_icall_System_Math_Atan2 (double, double);
106 ICALL_EXPORT
double ves_icall_System_Math_Atanh (double);
107 ICALL_EXPORT
double ves_icall_System_Math_Cbrt (double);
108 ICALL_EXPORT
double ves_icall_System_Math_Ceiling (double);
109 ICALL_EXPORT
double ves_icall_System_Math_Cos (double);
110 ICALL_EXPORT
double ves_icall_System_Math_Cosh (double);
111 ICALL_EXPORT
double ves_icall_System_Math_Exp (double);
112 ICALL_EXPORT
double ves_icall_System_Math_FMod (double, double);
113 ICALL_EXPORT
double ves_icall_System_Math_Floor (double);
114 ICALL_EXPORT
double ves_icall_System_Math_Log (double);
115 ICALL_EXPORT
double ves_icall_System_Math_Log10 (double);
116 ICALL_EXPORT
double ves_icall_System_Math_ModF (double, double*);
117 ICALL_EXPORT
double ves_icall_System_Math_Pow (double, double);
118 ICALL_EXPORT
double ves_icall_System_Math_Round (double);
119 ICALL_EXPORT
double ves_icall_System_Math_Sin (double);
120 ICALL_EXPORT
double ves_icall_System_Math_Sinh (double);
121 ICALL_EXPORT
double ves_icall_System_Math_Sqrt (double);
122 ICALL_EXPORT
double ves_icall_System_Math_Tan (double);
123 ICALL_EXPORT
double ves_icall_System_Math_Tanh (double);
124 ICALL_EXPORT
float ves_icall_System_MathF_Acos (float);
125 ICALL_EXPORT
float ves_icall_System_MathF_Acosh (float);
126 ICALL_EXPORT
float ves_icall_System_MathF_Asin (float);
127 ICALL_EXPORT
float ves_icall_System_MathF_Asinh (float);
128 ICALL_EXPORT
float ves_icall_System_MathF_Atan (float);
129 ICALL_EXPORT
float ves_icall_System_MathF_Atan2 (float, float);
130 ICALL_EXPORT
float ves_icall_System_MathF_Atanh (float);
131 ICALL_EXPORT
float ves_icall_System_MathF_Cbrt (float);
132 ICALL_EXPORT
float ves_icall_System_MathF_Ceiling (float);
133 ICALL_EXPORT
float ves_icall_System_MathF_Cos (float);
134 ICALL_EXPORT
float ves_icall_System_MathF_Cosh (float);
135 ICALL_EXPORT
float ves_icall_System_MathF_Exp (float);
136 ICALL_EXPORT
float ves_icall_System_MathF_FMod (float, float);
137 ICALL_EXPORT
float ves_icall_System_MathF_Floor (float);
138 ICALL_EXPORT
float ves_icall_System_MathF_Log (float);
139 ICALL_EXPORT
float ves_icall_System_MathF_Log10 (float);
140 ICALL_EXPORT
float ves_icall_System_MathF_ModF (float, float*);
141 ICALL_EXPORT
float ves_icall_System_MathF_Pow (float, float);
142 ICALL_EXPORT
float ves_icall_System_MathF_Sin (float);
143 ICALL_EXPORT
float ves_icall_System_MathF_Sinh (float);
144 ICALL_EXPORT
float ves_icall_System_MathF_Sqrt (float);
145 ICALL_EXPORT
float ves_icall_System_MathF_Tan (float);
146 ICALL_EXPORT
float ves_icall_System_MathF_Tanh (float);
147 ICALL_EXPORT
float ves_icall_System_Math_Abs_single (float);
148 ICALL_EXPORT gint
ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetOffsetToStringData (void);
149 ICALL_EXPORT gint32
ves_icall_System_Buffer_ByteLengthInternal (MonoArray
*);
150 ICALL_EXPORT gint32
ves_icall_System_Environment_get_ProcessorCount (void);
151 ICALL_EXPORT gint32
ves_icall_System_Environment_get_TickCount (void);
152 ICALL_EXPORT gint32
ves_icall_System_ValueType_InternalGetHashCode (MonoObject
*, MonoArray
**);
153 ICALL_EXPORT gint64
ves_icall_System_DateTime_GetSystemTimeAsFileTime (void);
154 ICALL_EXPORT gint64
ves_icall_System_Diagnostics_Stopwatch_GetTimestamp (void);
155 ICALL_EXPORT gint64
ves_icall_System_GC_GetTotalMemory (MonoBoolean forceCollection
);
156 ICALL_EXPORT gint64
ves_icall_System_Threading_Timer_GetTimeMonotonic (void);
157 ICALL_EXPORT gint8
ves_icall_System_Buffer_GetByteInternal (MonoArray
*, gint32
);
158 ICALL_EXPORT gpointer
ves_icall_System_GCHandle_GetAddrOfPinnedObject (guint32 handle
);
159 ICALL_EXPORT
int ves_icall_Interop_Sys_DoubleToString (double, char*, char*, int);
160 ICALL_EXPORT
int ves_icall_System_Environment_get_Platform (void);
161 ICALL_EXPORT
int ves_icall_System_GC_GetCollectionCount (int);
162 ICALL_EXPORT
int ves_icall_System_GC_GetMaxGeneration (void);
163 ICALL_EXPORT gint64
ves_icall_System_GC_GetAllocatedBytesForCurrentThread (void);
164 ICALL_EXPORT
int ves_icall_System_Threading_Thread_SystemMaxStackSize (void);
165 ICALL_EXPORT
int ves_icall_get_method_attributes (MonoMethod
* method
);
166 ICALL_EXPORT
void ves_icall_Mono_Runtime_RegisterReportingForNativeLib (const char*, const char*);
167 ICALL_EXPORT
void ves_icall_System_Array_GetGenericValueImpl (MonoArray
*, guint32
, gpointer
);
168 ICALL_EXPORT
void ves_icall_System_Array_SetGenericValueImpl (MonoArray
*, guint32
, gpointer
);
169 ICALL_EXPORT
void ves_icall_System_Buffer_MemcpyInternal (gpointer dest
, gconstpointer src
, gint32 count
);
170 ICALL_EXPORT
void ves_icall_System_Buffer_SetByteInternal (MonoArray
*, gint32
, gint8
);
171 ICALL_EXPORT
void ves_icall_System_Environment_Exit (int);
172 ICALL_EXPORT
void ves_icall_System_GCHandle_FreeHandle (guint32 handle
);
173 ICALL_EXPORT
void ves_icall_System_GC_InternalCollect (int generation
);
174 ICALL_EXPORT
void ves_icall_System_GC_RecordPressure (gint64
);
175 ICALL_EXPORT
void ves_icall_System_GC_WaitForPendingFinalizers (void);
176 ICALL_EXPORT
void ves_icall_System_IO_LogcatTextWriter_Log (const char*, gint32
, const char*);
177 ICALL_EXPORT
void ves_icall_System_NumberFormatter_GetFormatterTables (guint64
const**, gint32
const**, gunichar2
const**, gunichar2
const**, gint64
const**, gint32
const**);
178 ICALL_EXPORT
void ves_icall_System_RuntimeFieldHandle_SetValueDirect (MonoReflectionField
*, MonoReflectionType
*, MonoTypedRef
*, MonoObject
*, MonoReflectionType
*);
179 ICALL_EXPORT
void ves_icall_System_Runtime_RuntimeImports_Memmove (guint8
*, guint8
*, guint
);
180 ICALL_EXPORT
void ves_icall_System_Runtime_RuntimeImports_Memmove_wbarrier (guint8
*, guint8
*, guint
, MonoType
*);
181 ICALL_EXPORT
void ves_icall_System_Runtime_RuntimeImports_ZeroMemory (guint8
*, guint
);
182 ICALL_EXPORT
void ves_icall_System_Runtime_RuntimeImports_ecvt_s(char*, size_t, double, int, int*, int*);
183 #if defined(ENABLE_MONODROID) || defined(ENABLE_MONOTOUCH)
184 ICALL_EXPORT gpointer
ves_icall_System_IO_Compression_DeflateStreamNative_CreateZStream (gint32 compress
, MonoBoolean gzip
, gpointer feeder
, gpointer data
);
185 ICALL_EXPORT gint32
ves_icall_System_IO_Compression_DeflateStreamNative_CloseZStream (gpointer stream
);
186 ICALL_EXPORT gint32
ves_icall_System_IO_Compression_DeflateStreamNative_Flush (gpointer stream
);
187 ICALL_EXPORT gint32
ves_icall_System_IO_Compression_DeflateStreamNative_ReadZStream (gpointer stream
, gpointer buffer
, gint32 length
);
188 ICALL_EXPORT gint32
ves_icall_System_IO_Compression_DeflateStreamNative_WriteZStream (gpointer stream
, gpointer buffer
, gint32 length
);
190 #if defined(ENABLE_MONODROID)
191 ICALL_EXPORT gint32
ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CreateNLSocket (void);
192 ICALL_EXPORT gint32
ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_ReadEvents (gpointer sock
, gpointer buffer
, gint32 count
, gint32 size
);
193 ICALL_EXPORT gint32
ves_icall_System_Net_NetworkInformation_LinuxNetworkChange_CloseNLSocket (gpointer sock
);
196 #endif // __MONO_METADATA_ICALL_H__