[runtime] Add a few missing object offsets for arm.
[mono.git] / mono / metadata / object-offsets.h
1 /*
2 This is a parameterized header. It's supposed/ok to be included multiple times.
3
4 Input defines: (those to be defined by the includer file)
5
6 Required:
7 DECL_OFFSET(struct,field)
8 DECL_OFFSET2(struct,field,offset)
9 DECL_ALIGN(name,type)
10 DECL_ALIGN2(name,alignment)
11
12 Optional:
13 USE_CROSS_COMPILE_OFFSETS - if defined, force the cross compiler offsets to be used, otherwise
14         they will only be used if MONO_CROSS_COMPILE is defined
15
16 Output defines:
17
18 HAS_CROSS_COMPILER_OFFSETS - if set, it means we found some cross offsets, it doesnt mean we'll use it.
19 USED_CROSS_COMPILER_OFFSETS - if set, it means we used the cross offsets
20
21 Environment defines (from config.h and CFLAGS):
22
23 MONO_GENERATING_OFFSETS - Set by an offsets generating tool to disable the usage of any (possibly non-existing) generated header.
24 MONO_OFFSETS_FILE - Name of the header file containing the offsets to be used.
25
26 */
27
28
29 #undef HAS_CROSS_COMPILER_OFFSETS
30 #undef USED_CROSS_COMPILER_OFFSETS
31
32 #if !defined (MONO_GENERATING_OFFSETS) && defined (MONO_OFFSETS_FILE)
33 #include MONO_OFFSETS_FILE
34 #endif
35
36 #ifndef USED_CROSS_COMPILER_OFFSETS
37
38 DECL_ALIGN(gint8)
39 DECL_ALIGN(gint16)
40 DECL_ALIGN(gint32)
41 DECL_ALIGN(gint64)
42 DECL_ALIGN(float)
43 DECL_ALIGN(double)
44 DECL_ALIGN(gpointer)
45
46 DECL_SIZE(gint8)
47 DECL_SIZE(gint16)
48 DECL_SIZE(gint32)
49 DECL_SIZE(gint64)
50 DECL_SIZE(float)
51 DECL_SIZE(double)
52 DECL_SIZE(gpointer)
53
54 #ifndef DISABLE_METADATA_OFFSETS
55 //object offsets
56 DECL_OFFSET(MonoObject, vtable)
57 DECL_OFFSET(MonoObject, synchronisation)
58
59 DECL_OFFSET(MonoObjectHandlePayload, __obj)
60
61 DECL_OFFSET(MonoClass, interface_bitmap)
62 DECL_OFFSET(MonoClass, byval_arg)
63 DECL_OFFSET(MonoClass, cast_class)
64 DECL_OFFSET(MonoClass, element_class)
65 DECL_OFFSET(MonoClass, idepth)
66 DECL_OFFSET(MonoClass, instance_size)
67 DECL_OFFSET(MonoClass, interface_id)
68 DECL_OFFSET(MonoClass, max_interface_id)
69 DECL_OFFSET(MonoClass, parent)
70 DECL_OFFSET(MonoClass, rank)
71 DECL_OFFSET(MonoClass, sizes)
72 DECL_OFFSET(MonoClass, supertypes)
73
74 DECL_OFFSET(MonoVTable, klass)
75 DECL_OFFSET(MonoVTable, max_interface_id)
76 DECL_OFFSET(MonoVTable, interface_bitmap)
77 DECL_OFFSET(MonoVTable, vtable)
78 DECL_OFFSET(MonoVTable, rank)
79 DECL_OFFSET(MonoVTable, initialized)
80 DECL_OFFSET(MonoVTable, type)
81 DECL_OFFSET(MonoVTable, runtime_generic_context)
82
83 DECL_OFFSET(MonoDomain, stack_overflow_ex)
84
85 DECL_OFFSET(MonoDelegate, target)
86 DECL_OFFSET(MonoDelegate, method_ptr)
87 DECL_OFFSET(MonoDelegate, invoke_impl)
88 DECL_OFFSET(MonoDelegate, method)
89 DECL_OFFSET(MonoDelegate, method_code)
90 DECL_OFFSET(MonoDelegate, method_is_virtual)
91 DECL_OFFSET(MonoDelegate, extra_arg)
92
93 DECL_OFFSET(MonoInternalThread, tid)
94 DECL_OFFSET(MonoInternalThread, small_id)
95 DECL_OFFSET(MonoInternalThread, static_data)
96 DECL_OFFSET(MonoInternalThread, last)
97
98 DECL_OFFSET(MonoMulticastDelegate, delegates)
99
100 DECL_OFFSET(MonoTransparentProxy, rp)
101 DECL_OFFSET(MonoTransparentProxy, remote_class)
102 DECL_OFFSET(MonoTransparentProxy, custom_type_info)
103
104 DECL_OFFSET(MonoRealProxy, target_domain_id)
105 DECL_OFFSET(MonoRealProxy, context)
106 DECL_OFFSET(MonoRealProxy, unwrapped_server)
107
108 DECL_OFFSET(MonoRemoteClass, proxy_class)
109
110 DECL_OFFSET(MonoArray, vector)
111 DECL_OFFSET(MonoArray, max_length)
112 DECL_OFFSET(MonoArray, bounds)
113
114 DECL_OFFSET(MonoArrayBounds, lower_bound)
115 DECL_OFFSET(MonoArrayBounds, length)
116
117 DECL_OFFSET(MonoSafeHandle, handle)
118
119 DECL_OFFSET(MonoHandleRef, handle)
120
121 DECL_OFFSET(MonoComInteropProxy, com_object)
122
123 DECL_OFFSET(MonoString, length)
124 DECL_OFFSET(MonoString, chars)
125
126 DECL_OFFSET(MonoException, message)
127
128 DECL_OFFSET(MonoTypedRef, type)
129 DECL_OFFSET(MonoTypedRef, klass)
130 DECL_OFFSET(MonoTypedRef, value)
131
132 //Internal structs
133 DECL_OFFSET(MonoThreadsSync, status)
134 DECL_OFFSET(MonoThreadsSync, nest)
135
136 #ifdef HAVE_SGEN_GC
137 DECL_OFFSET(SgenClientThreadInfo, in_critical_region)
138 DECL_OFFSET(SgenThreadInfo, tlab_next)
139 DECL_OFFSET(SgenThreadInfo, tlab_temp_end)
140 #endif
141
142 #endif //DISABLE METADATA OFFSETS
143
144 #ifndef DISABLE_JIT_OFFSETS
145 DECL_OFFSET(MonoLMF, previous_lmf)
146
147 DECL_OFFSET(MonoMethodRuntimeGenericContext, class_vtable)
148
149 DECL_OFFSET(MonoJitTlsData, lmf)
150 DECL_OFFSET(MonoJitTlsData, class_cast_from)
151 DECL_OFFSET(MonoJitTlsData, class_cast_to)
152 DECL_OFFSET(MonoJitTlsData, handler_block_return_address)
153 DECL_OFFSET(MonoJitTlsData, restore_stack_prot)
154
155 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, locals_size)
156 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, entries) //XXX more to fix here
157
158 DECL_OFFSET(MonoContinuation, stack_used_size)
159 DECL_OFFSET(MonoContinuation, saved_stack)
160 DECL_OFFSET(MonoContinuation, return_sp)
161 DECL_OFFSET(MonoContinuation, lmf)
162 DECL_OFFSET(MonoContinuation, return_ip)
163
164 DECL_OFFSET(MonoDelegateTrampInfo, invoke_impl)
165 DECL_OFFSET(MonoDelegateTrampInfo, method_ptr)
166
167 // Architecture-specific offsets
168 // -----------------------------
169
170 #if defined(TARGET_X86)
171 DECL_OFFSET(MonoContext, eax)
172 DECL_OFFSET(MonoContext, ebx)
173 DECL_OFFSET(MonoContext, ecx)
174 DECL_OFFSET(MonoContext, edx)
175 DECL_OFFSET(MonoContext, edi)
176 DECL_OFFSET(MonoContext, esi)
177 DECL_OFFSET(MonoContext, esp)
178 DECL_OFFSET(MonoContext, ebp)
179 DECL_OFFSET(MonoContext, eip)
180
181 DECL_OFFSET(MonoLMF, method)
182 DECL_OFFSET(MonoLMF, lmf_addr)
183 DECL_OFFSET(MonoLMF, esp)
184 DECL_OFFSET(MonoLMF, ebx)
185 DECL_OFFSET(MonoLMF, edi)
186 DECL_OFFSET(MonoLMF, esi)
187 DECL_OFFSET(MonoLMF, ebp)
188 DECL_OFFSET(MonoLMF, eip)
189 #elif defined(TARGET_AMD64)
190 DECL_OFFSET(MonoContext, gregs)
191 DECL_OFFSET(MonoContext, fregs)
192
193 DECL_OFFSET(MonoLMF, rsp)
194 DECL_OFFSET(MonoLMF, rbp)
195 DECL_OFFSET(MonoLMF, rip)
196
197 DECL_OFFSET(DynCallArgs, res)
198
199 DECL_OFFSET(MonoLMFTramp, ctx)
200 DECL_OFFSET(MonoLMFTramp, lmf_addr)
201 #elif defined(TARGET_ARM)
202 DECL_OFFSET(MonoLMF, sp)
203 DECL_OFFSET(MonoLMF, fp)
204 DECL_OFFSET(MonoLMF, ip)
205 DECL_OFFSET(MonoLMF, iregs)
206 DECL_OFFSET(MonoLMF, fregs)
207 DECL_OFFSET(DynCallArgs, fpregs)
208 DECL_OFFSET(DynCallArgs, has_fpregs)
209 DECL_OFFSET(SeqPointInfo, ss_tramp_addr)
210 #elif defined(TARGET_ARM64)
211 DECL_OFFSET(MonoLMF, pc)
212 DECL_OFFSET(MonoLMF, gregs)
213 DECL_OFFSET(DynCallArgs, regs)
214 DECL_OFFSET(DynCallArgs, fpregs)
215 DECL_OFFSET(DynCallArgs, n_fpargs)
216 DECL_OFFSET(DynCallArgs, n_fpret)
217 #endif
218
219 // Shared architecture offfsets
220 // ----------------------------
221
222 #if defined(TARGET_ARM) || defined(TARGET_ARM64)
223 DECL_OFFSET (MonoContext, pc)
224 DECL_OFFSET (MonoContext, regs)
225 DECL_OFFSET (MonoContext, fregs)
226
227 DECL_OFFSET(MonoLMF, lmf_addr)
228
229 DECL_OFFSET(SeqPointInfo, ss_trigger_page)
230
231 DECL_OFFSET(DynCallArgs, res)
232 DECL_OFFSET(DynCallArgs, res2)
233 #endif
234
235 #if defined(TARGET_ARM)
236 DECL_OFFSET(MonoLMF, method)
237 DECL_OFFSET(GSharedVtCallInfo, stack_usage)
238 DECL_OFFSET(GSharedVtCallInfo, vret_arg_reg)
239 DECL_OFFSET(GSharedVtCallInfo, ret_marshal)
240 DECL_OFFSET(GSharedVtCallInfo, vret_slot)
241 DECL_OFFSET(GSharedVtCallInfo, gsharedvt_in)
242 #endif
243
244 #if defined(TARGET_ARM64)
245 DECL_OFFSET (MonoContext, has_fregs)
246
247 DECL_OFFSET(GSharedVtCallInfo, stack_usage)
248 DECL_OFFSET(GSharedVtCallInfo, gsharedvt_in)
249 DECL_OFFSET(GSharedVtCallInfo, ret_marshal)
250 DECL_OFFSET(GSharedVtCallInfo, vret_slot)
251 #endif
252
253 #if defined(TARGET_AMD64) || defined(TARGET_ARM64)
254 DECL_OFFSET(SeqPointInfo, ss_tramp_addr)
255 #endif
256
257 #if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64)
258 DECL_OFFSET(SeqPointInfo, bp_addrs)
259 #endif
260
261 #endif //DISABLE_JIT_OFFSETS
262
263 #endif //USED_CROSS_COMPILER_OFFSETS
264
265 #undef DECL_OFFSET
266 #undef DECL_OFFSET2
267 #undef DECL_ALIGN
268 #undef DECL_ALIGN2
269 #undef DECL_SIZE
270 #undef DECL_SIZE2
271 #undef USE_CROSS_COMPILE_OFFSETS