[MSBuild] Fix minor assembly resolution issue
[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
22
23 #undef HAS_CROSS_COMPILER_OFFSETS
24 #undef USED_CROSS_COMPILER_OFFSETS
25
26 #ifdef ENABLE_EXTENSION_MODULE
27 #include "../../../mono-extensions/mono/metadata/object-offsets.h"
28 #endif
29
30
31 #ifndef USED_CROSS_COMPILER_OFFSETS
32
33 DECL_ALIGN(gint8)
34 DECL_ALIGN(gint16)
35 DECL_ALIGN(gint32)
36 DECL_ALIGN(gint64)
37 DECL_ALIGN(float)
38 DECL_ALIGN(double)
39 DECL_ALIGN(gpointer)
40
41 #ifndef DISABLE_METADATA_OFFSETS
42 //object offsets
43 DECL_OFFSET(MonoObject, vtable)
44 DECL_OFFSET(MonoObject, synchronisation)
45
46 DECL_OFFSET(MonoClass, interface_bitmap)
47 DECL_OFFSET(MonoClass, byval_arg)
48 DECL_OFFSET(MonoClass, cast_class)
49 DECL_OFFSET(MonoClass, element_class)
50 DECL_OFFSET(MonoClass, idepth)
51 DECL_OFFSET(MonoClass, instance_size)
52 DECL_OFFSET(MonoClass, interface_id)
53 DECL_OFFSET(MonoClass, max_interface_id)
54 DECL_OFFSET(MonoClass, parent)
55 DECL_OFFSET(MonoClass, rank)
56 DECL_OFFSET(MonoClass, sizes)
57 DECL_OFFSET(MonoClass, supertypes)
58
59 DECL_OFFSET(MonoVTable, klass)
60 DECL_OFFSET(MonoVTable, max_interface_id)
61 DECL_OFFSET(MonoVTable, interface_bitmap)
62 DECL_OFFSET(MonoVTable, vtable)
63 DECL_OFFSET(MonoVTable, rank)
64 DECL_OFFSET(MonoVTable, type)
65 DECL_OFFSET(MonoVTable, runtime_generic_context)
66
67 DECL_OFFSET(MonoDomain, stack_overflow_ex)
68
69 DECL_OFFSET(MonoDelegate, target)
70 DECL_OFFSET(MonoDelegate, method_ptr)
71 DECL_OFFSET(MonoDelegate, invoke_impl)
72 DECL_OFFSET(MonoDelegate, method)
73 DECL_OFFSET(MonoDelegate, method_code)
74
75 DECL_OFFSET(MonoInternalThread, tid)
76 DECL_OFFSET(MonoInternalThread, small_id)
77 DECL_OFFSET(MonoInternalThread, static_data)
78
79 DECL_OFFSET(MonoMulticastDelegate, delegates)
80
81 DECL_OFFSET(MonoTransparentProxy, rp)
82 DECL_OFFSET(MonoTransparentProxy, remote_class)
83 DECL_OFFSET(MonoTransparentProxy, custom_type_info)
84
85 DECL_OFFSET(MonoRealProxy, target_domain_id)
86 DECL_OFFSET(MonoRealProxy, context)
87 DECL_OFFSET(MonoRealProxy, unwrapped_server)
88
89 DECL_OFFSET(MonoRemoteClass, proxy_class)
90
91 DECL_OFFSET(MonoArray, vector)
92 DECL_OFFSET(MonoArray, max_length)
93 DECL_OFFSET(MonoArray, bounds)
94
95 DECL_OFFSET(MonoArrayBounds, lower_bound)
96 DECL_OFFSET(MonoArrayBounds, length)
97
98 DECL_OFFSET(MonoSafeHandle, handle)
99
100 DECL_OFFSET(MonoHandleRef, handle)
101
102 DECL_OFFSET(MonoComInteropProxy, com_object)
103
104 DECL_OFFSET(MonoString, length)
105 DECL_OFFSET(MonoString, chars)
106
107 DECL_OFFSET(MonoException, message)
108
109 DECL_OFFSET(MonoTypedRef, type)
110 DECL_OFFSET(MonoTypedRef, klass)
111 DECL_OFFSET(MonoTypedRef, value)
112
113 //Internal structs
114 DECL_OFFSET(MonoThreadsSync, status)
115 DECL_OFFSET(MonoThreadsSync, nest)
116
117 #if defined (HAVE_SGEN_GC) && !defined (HAVE_KW_THREAD)
118 DECL_OFFSET(SgenThreadInfo, tlab_next_addr)
119 DECL_OFFSET(SgenThreadInfo, tlab_temp_end)
120 #endif
121
122 #endif //DISABLE METADATA OFFSETS
123
124 #ifndef DISABLE_JIT_OFFSETS
125 DECL_OFFSET(MonoLMF, previous_lmf)
126
127 DECL_OFFSET(MonoMethodRuntimeGenericContext, class_vtable)
128
129 DECL_OFFSET(MonoJitTlsData, lmf)
130 DECL_OFFSET(MonoJitTlsData, class_cast_from)
131 DECL_OFFSET(MonoJitTlsData, class_cast_to)
132 DECL_OFFSET(MonoJitTlsData, handler_block_return_address)
133 DECL_OFFSET(MonoJitTlsData, restore_stack_prot)
134
135 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, locals_size)
136 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo, entries) //XXX more to fix here
137
138 DECL_OFFSET(MonoContinuation, stack_used_size)
139 DECL_OFFSET(MonoContinuation, saved_stack)
140 DECL_OFFSET(MonoContinuation, return_sp)
141 DECL_OFFSET(MonoContinuation, lmf)
142 DECL_OFFSET(MonoContinuation, return_ip)
143
144 DECL_OFFSET(MonoDelegateTrampInfo, invoke_impl)
145 DECL_OFFSET(MonoDelegateTrampInfo, method_ptr)
146
147 // Architecture-specific offsets
148 // -----------------------------
149
150 #if defined(TARGET_X86)
151 DECL_OFFSET(MonoContext, eax)
152 DECL_OFFSET(MonoContext, ebx)
153 DECL_OFFSET(MonoContext, ecx)
154 DECL_OFFSET(MonoContext, edx)
155 DECL_OFFSET(MonoContext, edi)
156 DECL_OFFSET(MonoContext, esi)
157 DECL_OFFSET(MonoContext, esp)
158 DECL_OFFSET(MonoContext, ebp)
159 DECL_OFFSET(MonoContext, eip)
160
161 DECL_OFFSET(MonoLMF, method)
162 DECL_OFFSET(MonoLMF, lmf_addr)
163 DECL_OFFSET(MonoLMF, esp)
164 DECL_OFFSET(MonoLMF, ebx)
165 DECL_OFFSET(MonoLMF, edi)
166 DECL_OFFSET(MonoLMF, esi)
167 DECL_OFFSET(MonoLMF, ebp)
168 DECL_OFFSET(MonoLMF, eip)
169 #elif defined(TARGET_AMD64)
170 DECL_OFFSET(MonoContext, rax)
171 DECL_OFFSET(MonoContext, rcx)
172 DECL_OFFSET(MonoContext, rdx)
173 DECL_OFFSET(MonoContext, rbx)
174 DECL_OFFSET(MonoContext, rbp)
175 DECL_OFFSET(MonoContext, rsi)
176 DECL_OFFSET(MonoContext, rdi)
177 DECL_OFFSET(MonoContext, rsp)
178 DECL_OFFSET(MonoContext, r8)
179 DECL_OFFSET(MonoContext, r9)
180 DECL_OFFSET(MonoContext, r10)
181 DECL_OFFSET(MonoContext, r11)
182 DECL_OFFSET(MonoContext, r12)
183 DECL_OFFSET(MonoContext, r13)
184 DECL_OFFSET(MonoContext, r14)
185 DECL_OFFSET(MonoContext, r15)
186 DECL_OFFSET(MonoContext, rip)
187
188 #ifdef TARGET_WIN32
189 DECL_OFFSET(MonoLMF, lmf_addr)
190 #endif
191
192 DECL_OFFSET(MonoLMF, rsp)
193 DECL_OFFSET(MonoLMF, rbp)
194 DECL_OFFSET(MonoLMF, rip)
195
196 DECL_OFFSET(DynCallArgs, res)
197
198 DECL_OFFSET(MonoLMFTramp, regs)
199 DECL_OFFSET(MonoLMFTramp, lmf_addr)
200 #elif defined(TARGET_ARM)
201 DECL_OFFSET(MonoLMF, sp)
202 DECL_OFFSET(MonoLMF, fp)
203 DECL_OFFSET(MonoLMF, ip)
204 DECL_OFFSET(MonoLMF, iregs)
205 DECL_OFFSET(MonoLMF, fregs)
206 #elif defined(TARGET_ARM64)
207 DECL_OFFSET(MonoLMF, pc)
208 DECL_OFFSET(MonoLMF, gregs)
209 DECL_OFFSET(DynCallArgs, fpregs)
210 DECL_OFFSET(DynCallArgs, n_fpargs)
211 DECL_OFFSET(DynCallArgs, n_fpret)
212 #endif
213
214 // Shared architecture offfsets
215 // ----------------------------
216
217 #if defined(TARGET_ARM) || defined(TARGET_ARM64)
218 DECL_OFFSET (MonoContext, pc)
219 DECL_OFFSET (MonoContext, regs)
220 DECL_OFFSET (MonoContext, fregs)
221
222 DECL_OFFSET(MonoLMF, lmf_addr)
223
224 DECL_OFFSET(SeqPointInfo, ss_trigger_page)
225
226 DECL_OFFSET(DynCallArgs, res)
227 DECL_OFFSET(DynCallArgs, res2)
228 #endif
229
230 #if defined(TARGET_ARM)
231 DECL_OFFSET(MonoLMF, method)
232 #endif
233
234 #if defined(TARGET_AMD64) || defined(TARGET_ARM64)
235 DECL_OFFSET(SeqPointInfo, ss_tramp_addr)
236 #endif
237
238 #if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64)
239 DECL_OFFSET(SeqPointInfo, bp_addrs)
240 #endif
241
242 #endif //DISABLE_JIT_OFFSETS
243
244 #endif //USED_CROSS_COMPILER_OFFSETS
245
246 #undef DECL_OFFSET
247 #undef DECL_OFFSET2
248 #undef DECL_ALIGN
249 #undef DECL_ALIGN2
250 #undef USE_CROSS_COMPILE_OFFSETS