Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / mini-wasm.h
1 #ifndef __MONO_MINI_WASM_H__
2 #define __MONO_MINI_WASM_H__
3
4 #include <mono/utils/mono-sigcontext.h>
5 #include <mono/utils/mono-context.h>
6
7 #define MONO_ARCH_CPU_SPEC mono_wasm_desc
8
9 #define MONO_ARCH_HAVE_INIT_LMF_EXT 1
10
11 #define MONO_MAX_IREGS 1
12 #define MONO_MAX_FREGS 1
13
14 #define WASM_REG_0 0
15
16
17 struct MonoLMF {
18         /* 
19          * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and
20          * the other fields are not valid.
21          */
22         gpointer previous_lmf;
23         gpointer lmf_addr;
24
25         /* This is only set in trampoline LMF frames */
26         MonoMethod *method;
27
28         gboolean top_entry;
29 };
30
31 typedef struct {
32         int dummy;
33 } MonoCompileArch;
34
35 #define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf) do { (lmf)->top_entry = TRUE; } while (0)
36
37 #define MONO_CONTEXT_SET_LLVM_EXC_REG(ctx, exc) do { (ctx)->llvm_exc_reg = (gsize)exc; } while (0)
38
39 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do {        \
40                 MONO_CONTEXT_SET_IP ((ctx), (start_func));      \
41                 MONO_CONTEXT_SET_BP ((ctx), (0));       \
42                 MONO_CONTEXT_SET_SP ((ctx), (0));       \
43         } while (0)
44
45
46 #define MONO_ARCH_VTABLE_REG WASM_REG_0
47 #define MONO_ARCH_IMT_REG WASM_REG_0
48 #define MONO_ARCH_RGCTX_REG WASM_REG_0
49
50 #endif /* __MONO_MINI_WASM_H__ */