2010-03-30 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / mini / mini-sparc.h
index 63c3e16d8b38e0ecc7e667fa1e798d8bea3a9187..3f3eefd6ab9ce3f8ca65500a1eb9d88914c9ce68 100644 (file)
@@ -5,20 +5,20 @@
 
 #include <glib.h>
 
+#define MONO_ARCH_CPU_SPEC sparc_desc
+
 #define MONO_MAX_IREGS 32
 #define MONO_MAX_FREGS 32
 
 /* Parameters used by the register allocator */
 
-#define MONO_ARCH_HAS_XP_LOCAL_REGALLOC
-
 /* 
  * Use %o0..%o5 as local registers, plus %l7 since we need an extra register for
  * holding the sreg1 in call instructions.
  */
 #define MONO_ARCH_CALLEE_REGS ((1 << sparc_o0) | (1 << sparc_o1) | (1 << sparc_o2) | (1 << sparc_o3) | (1 << sparc_o4) | (1 << sparc_o5) | (1 << sparc_l7))
 
-#define MONO_ARCH_CALLEE_SAVED_REGS (~MONO_ARCH_CALLEE_REGS)
+#define MONO_ARCH_CALLEE_SAVED_REGS ((~MONO_ARCH_CALLEE_REGS) & ~(1 << sparc_g1))
 
 #ifdef SPARCV9
 /* Use %d34..%d62 as the double precision floating point local registers */
 #define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (((desc == 'l') ? sparc_o0 : (desc == 'L' ? (hreg1 + 1) : -1)))
 #endif
 
-
-#define MONO_ARCH_FRAME_ALIGNMENT (sizeof (gpointer) * 2)
+#if SIZEOF_VOID_P == 8
+#define MONO_ARCH_FRAME_ALIGNMENT 16
+#else
+#define MONO_ARCH_FRAME_ALIGNMENT 8
+#endif
 
 #define MONO_ARCH_CODE_ALIGNMENT 32
 
-#define MONO_ARCH_BASEREG sparc_fp
 #define MONO_ARCH_RETREG1 sparc_i0
 
 #ifdef SPARCV9
@@ -80,6 +82,7 @@ typedef struct MonoContext {
 typedef struct MonoCompileArch {
        gint32 lmf_offset;
        gint32 localloc_offset;
+       void *float_spill_slot;
 } MonoCompileArch;
 
 #define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0); 
@@ -94,12 +97,13 @@ typedef struct MonoCompileArch {
                mono_arch_flush_register_windows ();    \
                MONO_CONTEXT_SET_IP ((ctx), (start_func));      \
                MONO_CONTEXT_SET_BP ((ctx), __builtin_frame_address (0));       \
+               MONO_CONTEXT_SET_SP ((ctx), __builtin_frame_address (0));       \
        } while (0)
 
 #define MONO_ARCH_USE_SIGACTION 1
 
 #ifdef HAVE_WORKING_SIGALTSTACK
-#define MONO_ARCH_SIGSEGV_ON_ALTSTACK
+/*#define MONO_ARCH_SIGSEGV_ON_ALTSTACK*/
 #endif
 
 #define MONO_ARCH_EMULATE_FCONV_TO_I8   1
@@ -110,8 +114,9 @@ typedef struct MonoCompileArch {
 #define MONO_ARCH_EMULATE_FREM 1
 #define MONO_ARCH_NEED_DIV_CHECK 1
 #define MONO_ARCH_HAVE_THROW_CORLIB_EXCEPTION 1
-#define MONO_ARCH_HAVE_CREATE_TRAMPOLINE_FROM_TOKEN 1
-#define MONO_ARCH_HAVE_CREATE_SPECIFIC_TRAMPOLINE 1
+#define MONO_ARCH_HAVE_IMT 1
+#define MONO_ARCH_IMT_REG sparc_g1
+#define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1
 
 #ifdef SPARCV9
 #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS
@@ -164,7 +169,7 @@ static void * __builtin_frame_address(int depth)
 
 gboolean mono_sparc_is_virtual_call (guint32 *code);
 
-gpointer* mono_sparc_get_vcall_slot_addr (guint32 *code, gpointer *regs);
+gpointer* mono_sparc_get_vcall_slot_addr (guint32 *code, mgreg_t *regs);
 
 void mono_sparc_flushw (void);