2 This is a parameterized header. It's supposed/ok to be included multiple times.
4 Input defines: (those to be defined by the includer file)
7 DECL_OFFSET(struct,field)
8 DECL_OFFSET2(struct,field,offset)
10 DECL_ALIGN2(name,alignment)
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
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
21 Environment defines (from config.h and CFLAGS):
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.
29 #undef HAS_CROSS_COMPILER_OFFSETS
30 #undef USED_CROSS_COMPILER_OFFSETS
32 #if !defined (MONO_GENERATING_OFFSETS) && defined (MONO_OFFSETS_FILE)
33 #include MONO_OFFSETS_FILE
36 #ifndef USED_CROSS_COMPILER_OFFSETS
54 #ifndef DISABLE_METADATA_OFFSETS
56 DECL_OFFSET(MonoObject
, vtable
)
57 DECL_OFFSET(MonoObject
, synchronisation
)
59 DECL_OFFSET(MonoClass
, interface_bitmap
)
60 DECL_OFFSET(MonoClass
, byval_arg
)
61 DECL_OFFSET(MonoClass
, cast_class
)
62 DECL_OFFSET(MonoClass
, element_class
)
63 DECL_OFFSET(MonoClass
, idepth
)
64 DECL_OFFSET(MonoClass
, instance_size
)
65 DECL_OFFSET(MonoClass
, interface_id
)
66 DECL_OFFSET(MonoClass
, max_interface_id
)
67 DECL_OFFSET(MonoClass
, parent
)
68 DECL_OFFSET(MonoClass
, rank
)
69 DECL_OFFSET(MonoClass
, sizes
)
70 DECL_OFFSET(MonoClass
, supertypes
)
72 DECL_OFFSET(MonoVTable
, klass
)
73 DECL_OFFSET(MonoVTable
, max_interface_id
)
74 DECL_OFFSET(MonoVTable
, interface_bitmap
)
75 DECL_OFFSET(MonoVTable
, vtable
)
76 DECL_OFFSET(MonoVTable
, rank
)
77 DECL_OFFSET(MonoVTable
, type
)
78 DECL_OFFSET(MonoVTable
, runtime_generic_context
)
80 DECL_OFFSET(MonoDomain
, stack_overflow_ex
)
82 DECL_OFFSET(MonoDelegate
, target
)
83 DECL_OFFSET(MonoDelegate
, method_ptr
)
84 DECL_OFFSET(MonoDelegate
, invoke_impl
)
85 DECL_OFFSET(MonoDelegate
, method
)
86 DECL_OFFSET(MonoDelegate
, method_code
)
87 DECL_OFFSET(MonoDelegate
, method_is_virtual
)
88 DECL_OFFSET(MonoDelegate
, extra_arg
)
90 DECL_OFFSET(MonoInternalThread
, tid
)
91 DECL_OFFSET(MonoInternalThread
, small_id
)
92 DECL_OFFSET(MonoInternalThread
, static_data
)
94 DECL_OFFSET(MonoMulticastDelegate
, delegates
)
96 DECL_OFFSET(MonoTransparentProxy
, rp
)
97 DECL_OFFSET(MonoTransparentProxy
, remote_class
)
98 DECL_OFFSET(MonoTransparentProxy
, custom_type_info
)
100 DECL_OFFSET(MonoRealProxy
, target_domain_id
)
101 DECL_OFFSET(MonoRealProxy
, context
)
102 DECL_OFFSET(MonoRealProxy
, unwrapped_server
)
104 DECL_OFFSET(MonoRemoteClass
, proxy_class
)
106 DECL_OFFSET(MonoArray
, vector
)
107 DECL_OFFSET(MonoArray
, max_length
)
108 DECL_OFFSET(MonoArray
, bounds
)
110 DECL_OFFSET(MonoArrayBounds
, lower_bound
)
111 DECL_OFFSET(MonoArrayBounds
, length
)
113 DECL_OFFSET(MonoSafeHandle
, handle
)
115 DECL_OFFSET(MonoHandleRef
, handle
)
117 DECL_OFFSET(MonoComInteropProxy
, com_object
)
119 DECL_OFFSET(MonoString
, length
)
120 DECL_OFFSET(MonoString
, chars
)
122 DECL_OFFSET(MonoException
, message
)
124 DECL_OFFSET(MonoTypedRef
, type
)
125 DECL_OFFSET(MonoTypedRef
, klass
)
126 DECL_OFFSET(MonoTypedRef
, value
)
129 DECL_OFFSET(MonoThreadsSync
, status
)
130 DECL_OFFSET(MonoThreadsSync
, nest
)
133 DECL_OFFSET(SgenClientThreadInfo
, in_critical_region
)
134 #ifndef HAVE_KW_THREAD
135 DECL_OFFSET(SgenThreadInfo
, tlab_next_addr
)
136 DECL_OFFSET(SgenThreadInfo
, tlab_temp_end
)
140 #endif //DISABLE METADATA OFFSETS
142 #ifndef DISABLE_JIT_OFFSETS
143 DECL_OFFSET(MonoLMF
, previous_lmf
)
145 DECL_OFFSET(MonoMethodRuntimeGenericContext
, class_vtable
)
147 DECL_OFFSET(MonoJitTlsData
, lmf
)
148 DECL_OFFSET(MonoJitTlsData
, class_cast_from
)
149 DECL_OFFSET(MonoJitTlsData
, class_cast_to
)
150 DECL_OFFSET(MonoJitTlsData
, handler_block_return_address
)
151 DECL_OFFSET(MonoJitTlsData
, restore_stack_prot
)
153 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo
, locals_size
)
154 DECL_OFFSET(MonoGSharedVtMethodRuntimeInfo
, entries
) //XXX more to fix here
156 DECL_OFFSET(MonoContinuation
, stack_used_size
)
157 DECL_OFFSET(MonoContinuation
, saved_stack
)
158 DECL_OFFSET(MonoContinuation
, return_sp
)
159 DECL_OFFSET(MonoContinuation
, lmf
)
160 DECL_OFFSET(MonoContinuation
, return_ip
)
162 DECL_OFFSET(MonoDelegateTrampInfo
, invoke_impl
)
163 DECL_OFFSET(MonoDelegateTrampInfo
, method_ptr
)
165 // Architecture-specific offsets
166 // -----------------------------
168 #if defined(TARGET_X86)
169 DECL_OFFSET(MonoContext
, eax
)
170 DECL_OFFSET(MonoContext
, ebx
)
171 DECL_OFFSET(MonoContext
, ecx
)
172 DECL_OFFSET(MonoContext
, edx
)
173 DECL_OFFSET(MonoContext
, edi
)
174 DECL_OFFSET(MonoContext
, esi
)
175 DECL_OFFSET(MonoContext
, esp
)
176 DECL_OFFSET(MonoContext
, ebp
)
177 DECL_OFFSET(MonoContext
, eip
)
179 DECL_OFFSET(MonoLMF
, method
)
180 DECL_OFFSET(MonoLMF
, lmf_addr
)
181 DECL_OFFSET(MonoLMF
, esp
)
182 DECL_OFFSET(MonoLMF
, ebx
)
183 DECL_OFFSET(MonoLMF
, edi
)
184 DECL_OFFSET(MonoLMF
, esi
)
185 DECL_OFFSET(MonoLMF
, ebp
)
186 DECL_OFFSET(MonoLMF
, eip
)
187 #elif defined(TARGET_AMD64)
188 DECL_OFFSET(MonoContext
, gregs
)
189 DECL_OFFSET(MonoContext
, fregs
)
191 DECL_OFFSET(MonoLMF
, rsp
)
192 DECL_OFFSET(MonoLMF
, rbp
)
193 DECL_OFFSET(MonoLMF
, rip
)
195 DECL_OFFSET(DynCallArgs
, res
)
197 DECL_OFFSET(MonoLMFTramp
, ctx
)
198 DECL_OFFSET(MonoLMFTramp
, lmf_addr
)
199 #elif defined(TARGET_ARM)
200 DECL_OFFSET(MonoLMF
, sp
)
201 DECL_OFFSET(MonoLMF
, fp
)
202 DECL_OFFSET(MonoLMF
, ip
)
203 DECL_OFFSET(MonoLMF
, iregs
)
204 DECL_OFFSET(MonoLMF
, fregs
)
205 #elif defined(TARGET_ARM64)
206 DECL_OFFSET(MonoLMF
, pc
)
207 DECL_OFFSET(MonoLMF
, gregs
)
208 DECL_OFFSET(DynCallArgs
, regs
)
209 DECL_OFFSET(DynCallArgs
, fpregs
)
210 DECL_OFFSET(DynCallArgs
, n_fpargs
)
211 DECL_OFFSET(DynCallArgs
, n_fpret
)
214 // Shared architecture offfsets
215 // ----------------------------
217 #if defined(TARGET_ARM) || defined(TARGET_ARM64)
218 DECL_OFFSET (MonoContext
, pc
)
219 DECL_OFFSET (MonoContext
, regs
)
220 DECL_OFFSET (MonoContext
, fregs
)
222 DECL_OFFSET(MonoLMF
, lmf_addr
)
224 DECL_OFFSET(SeqPointInfo
, ss_trigger_page
)
226 DECL_OFFSET(DynCallArgs
, res
)
227 DECL_OFFSET(DynCallArgs
, res2
)
230 #if defined(TARGET_ARM)
231 DECL_OFFSET(MonoLMF
, method
)
232 DECL_OFFSET(GSharedVtCallInfo
, stack_usage
)
233 DECL_OFFSET(GSharedVtCallInfo
, vret_arg_reg
)
234 DECL_OFFSET(GSharedVtCallInfo
, ret_marshal
)
235 DECL_OFFSET(GSharedVtCallInfo
, vret_slot
)
236 DECL_OFFSET(GSharedVtCallInfo
, gsharedvt_in
)
239 #if defined(TARGET_ARM64)
240 DECL_OFFSET(GSharedVtCallInfo
, stack_usage
)
241 DECL_OFFSET(GSharedVtCallInfo
, gsharedvt_in
)
242 DECL_OFFSET(GSharedVtCallInfo
, ret_marshal
)
243 DECL_OFFSET(GSharedVtCallInfo
, vret_slot
)
246 #if defined(TARGET_AMD64) || defined(TARGET_ARM64)
247 DECL_OFFSET(SeqPointInfo
, ss_tramp_addr
)
250 #if defined(TARGET_AMD64) || defined(TARGET_ARM) || defined(TARGET_ARM64)
251 DECL_OFFSET(SeqPointInfo
, bp_addrs
)
254 #endif //DISABLE_JIT_OFFSETS
256 #endif //USED_CROSS_COMPILER_OFFSETS
264 #undef USE_CROSS_COMPILE_OFFSETS