X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fmini-sparc.h;h=f2b3b41d7963a5ae2a0c8b4ac632d74813ef8af5;hb=7b09fdb83085b93df50f408e2fb00b385562917f;hp=0958fd728fc1a60ec34723ec2a15f9443a18c99a;hpb=987f8c63e214937c50dcb308149f7558a2cbba41;p=mono.git diff --git a/mono/mini/mini-sparc.h b/mono/mini/mini-sparc.h index 0958fd728fc..f2b3b41d796 100644 --- a/mono/mini/mini-sparc.h +++ b/mono/mini/mini-sparc.h @@ -2,23 +2,24 @@ #define __MONO_MINI_SPARC_H__ #include +#include #include +#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 */ @@ -48,12 +49,14 @@ #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 @@ -71,42 +74,25 @@ struct MonoLMF { gpointer ebp; }; -typedef struct MonoContext { - guint8 *ip; - gpointer *sp; - gpointer *fp; -} 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); -#define MONO_CONTEXT_SET_BP(ctx,ebp) do { (ctx)->fp = (gpointer*)(ebp); } while (0); -#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->sp = (gpointer*)(esp); } while (0); - -#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->ip)) -#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->fp)) -#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->sp)) - #define MONO_INIT_CONTEXT_FROM_FUNC(ctx,start_func) do { \ 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) -#ifndef __linux__ -/* - * Can't use sigaction on sparc/linux, since it doesn't support SA_SIGINFO. Instead, we - * have to use the obsolete sigcontext parameter: - * http://www.ussg.iu.edu/hypermail/linux/kernel/0110.3/1531.html. - */ +#define MONO_ARCH_INIT_TOP_LMF_ENTRY(lmf) do { (lmf)->ebp = -1; } while (0) + #define MONO_ARCH_USE_SIGACTION 1 -#endif #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 @@ -116,15 +102,19 @@ typedef struct MonoCompileArch { #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1 #define MONO_ARCH_EMULATE_FREM 1 #define MONO_ARCH_NEED_DIV_CHECK 1 -#define MONO_ARCH_ENABLE_EMIT_STATE_OPT 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 +#define MONO_ARCH_HAVE_TLS_INIT 1 + +void mono_arch_tls_init (void); #ifdef SPARCV9 #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS #endif +#define MONO_ARCH_THIS_AS_FIRST_ARG 1 + #ifndef __GNUC__ /* assume Sun compiler if not GCC */ static void * __builtin_return_address(int depth) @@ -172,7 +162,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);