Merge pull request #3140 from esdrubal/syscall_details
[mono-project.git] / mono / mini / mini-ia64.h
blobbcb30ead561a6eca9a86a91aacca174989697d5c
1 #ifndef __MONO_MINI_IA64_H__
2 #define __MONO_MINI_IA64_H__
4 #include <glib.h>
6 #include <mono/arch/ia64/ia64-codegen.h>
7 #include <mono/utils/mono-context.h>
9 #define MONO_ARCH_CPU_SPEC ia64_desc
11 /* FIXME: regset -> 128 bits ! */
13 #define MONO_MAX_IREGS 128
14 #define MONO_MAX_FREGS 128
16 /* Parameters used by the register allocator */
18 /* r8..r11, r14..r29 */
19 #define MONO_ARCH_CALLEE_REGS ((regmask_t)(0xf00UL) | (regmask_t)(0x3fffc000UL))
21 /* f6..f15, f34..f127 */
22 /* FIXME: Use the upper 64 bits as well */
23 #define MONO_ARCH_CALLEE_FREGS ((regmask_t)(0xfffffffc00000000UL) | ((regmask_t)(0x3ffUL) << 6))
25 #define MONO_ARCH_CALLEE_SAVED_REGS ~(MONO_ARCH_CALLEE_REGS)
27 #define MONO_ARCH_CALLEE_SAVED_FREGS 0
29 #define MONO_ARCH_USE_FPSTACK FALSE
30 #define MONO_ARCH_FPSTACK_SIZE 0
32 #define MONO_ARCH_INST_FIXED_REG(desc) ((desc == 'r') ? IA64_R8 : ((desc == 'g') ? 8 : -1))
33 #define MONO_ARCH_INST_IS_FLOAT(desc) ((desc == 'f') || (desc == 'g'))
34 #define MONO_ARCH_INST_SREG2_MASK(ins) (0)
35 #define MONO_ARCH_INST_IS_REGPAIR(desc) FALSE
36 #define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (-1)
38 #define MONO_ARCH_IS_GLOBAL_IREG(reg) (is_hard_ireg (reg) && ((reg) >= cfg->arch.reg_local0) && ((reg) < cfg->arch.reg_out0))
40 #define MONO_ARCH_FRAME_ALIGNMENT 16
42 #define MONO_ARCH_CODE_ALIGNMENT 16
44 #define MONO_ARCH_SIGNAL_STACK_SIZE SIGSTKSZ
46 struct MonoLMF {
49 typedef struct MonoCompileArch {
50 gint32 stack_alloc_size;
51 gint32 lmf_offset;
52 gint32 localloc_offset;
53 gint32 n_out_regs;
54 gint32 reg_in0;
55 gint32 reg_local0;
56 gint32 reg_out0;
57 gint32 reg_saved_ar_pfs;
58 gint32 reg_saved_b0;
59 gint32 reg_saved_sp;
60 gint32 reg_fp;
61 gint32 reg_saved_return_val;
62 guint32 prolog_end_offset, epilog_begin_offset, epilog_end_offset;
63 void *ret_var_addr_local;
64 unw_dyn_region_info_t *r_pro, *r_epilog;
65 void *last_bb;
66 Ia64CodegenState code;
67 gboolean omit_fp;
68 GHashTable *branch_targets;
69 } MonoCompileArch;
71 #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do { \
72 MONO_INIT_CONTEXT_FROM_CURRENT (ctx); \
73 } while (0)
75 #define MONO_INIT_CONTEXT_FROM_CURRENT(ctx) do { \
76 int res; \
77 res = unw_getcontext (&unw_ctx); \
78 g_assert (res == 0); \
79 res = unw_init_local (&(ctx)->cursor, &unw_ctx); \
80 g_assert (res == 0); \
81 } while (0)
83 /* This is ia64 only */
84 #define MONO_CONTEXT_SET_FUNC(ctx, func) MONO_CONTEXT_SET_IP ((ctx), ((gpointer*)(func))[0])
86 #define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf)
88 #define MONO_ARCH_CONTEXT_DEF unw_context_t unw_ctx;
90 #define MONO_ARCH_USE_SIGACTION 1
92 #ifdef HAVE_WORKING_SIGALTSTACK
93 /*#define MONO_ARCH_SIGSEGV_ON_ALTSTACK*/
94 #endif
96 unw_dyn_region_info_t* mono_ia64_create_unwind_region (Ia64CodegenState *code);
98 #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS 1
99 #define MONO_ARCH_NO_EMULATE_MUL_IMM 1
100 #define MONO_ARCH_NO_EMULATE_MUL 1
102 #define MONO_ARCH_EMULATE_CONV_R8_UN 1
103 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1
104 #define MONO_ARCH_EMULATE_FREM 1
105 #define MONO_ARCH_EMULATE_MUL_DIV 1
106 #define MONO_ARCH_NEED_DIV_CHECK 1
108 #define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1
110 #define MONO_ARCH_HAVE_INVALIDATE_METHOD 1
111 #define MONO_ARCH_HAVE_SAVE_UNWIND_INFO 1
112 #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1
114 #endif /* __MONO_MINI_IA64_H__ */