#define MONO_ARCH_FPSTACK_SIZE 0
/* Parameters used by the register allocator */
-#define MONO_ARCH_HAS_XP_LOCAL_REGALLOC
/* On Mips, for regpairs, the lower-numbered reg is most significant
* This is true in both big and little endian
*/
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define RET_REG1 mips_v0
+#define RET_REG2 mips_v1
+#else
+#define RET_REG1 mips_v1
+#define RET_REG2 mips_v0
+#endif
+
#define MONO_ARCH_INST_SREG2_MASK(ins) (0)
#define MONO_ARCH_INST_IS_REGPAIR(desc) ((desc) == 'V' || (desc) == 'l')
-#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (((desc) == 'l') ? ((hreg1) + 1) : (((desc) == 'V') ? ((hreg1) - 1) : -1))
+#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (((desc) == 'l') ? ((hreg1) + 1) : (((desc) == 'V') ? RET_REG2 : -1))
#define MONO_ARCH_INST_IS_FLOAT(desc) ((desc == 'f') || (desc == 'g'))
// This define is called to get specific dest register as defined
// by md file (letter after "dest"). Overwise return -1
-#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == '0') ? mips_zero : (((desc) == 'a') ? mips_at : ((((desc) == 'v')) ? mips_v0 : (((desc) == 'V') ? mips_v1 : (((desc) == 'g') ? mips_f0 : -1)))))
+#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == '0') ? mips_zero : (((desc) == 'a') ? mips_at : ((((desc) == 'v')) ? mips_v0 : (((desc) == 'V') ? RET_REG1 : (((desc) == 'g') ? mips_f0 : -1)))))
#define MONO_ARCH_FRAME_ALIGNMENT 8
void mips_patch (guint32 *code, guint32 target);
+#define MIPS_LMF_MAGIC1 0xa5a5a5a5
+#define MIPS_LMF_MAGIC2 0xc3c3c3c3
+
struct MonoLMF {
gpointer previous_lmf;
gpointer lmf_addr;
gulong eip;
gulong iregs [MONO_SAVED_GREGS];
gfloat fregs [MONO_SAVED_FREGS];
- gulong pad;
+ gulong magic;
};
/* we define our own structure and we'll copy the data
#define MIPS_NUM_REG_FPARGS (MIPS_LAST_FPARG_REG-MIPS_FIRST_FPARG_REG+1)
/* we have the stack pointer, not the base pointer in sigcontext */
-#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->sc_pc = (int)ip; } while (0);
-#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->sc_regs[mips_sp] = (int)bp; } while (0);
-#define MONO_CONTEXT_SET_SP(ctx,sp) do { (ctx)->sc_regs[mips_sp] = (int)sp; } while (0);
+#define MONO_CONTEXT_SET_IP(ctx,ip) do { (ctx)->sc_pc = (int)(ip); } while (0);
+#define MONO_CONTEXT_SET_BP(ctx,bp) do { (ctx)->sc_regs[mips_fp] = (int)(bp); } while (0);
+#define MONO_CONTEXT_SET_SP(ctx,sp) do { (ctx)->sc_regs[mips_sp] = (int)(sp); } while (0);
#define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->sc_pc))
-#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->sc_regs[mips_sp]))
+#define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->sc_regs[mips_fp]))
#define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->sc_regs[mips_sp]))
typedef struct {
MONO_CONTEXT_SET_BP ((ctx), sp + (-imm)); \
ra = *(guint32 *)(sp + (-imm) + MIPS_RET_ADDR_OFFSET); \
MONO_CONTEXT_SET_IP ((ctx),ra); \
+ MONO_CONTEXT_SET_SP ((ctx), MONO_CONTEXT_GET_BP (ctx)); \
} while (0)
-#if 1
-#define mono_find_jit_info mono_arch_find_jit_info
-#define CUSTOM_STACK_WALK
-#endif
-
/* re-attaches with gdb - sometimes causes executable to hang */
#undef HAVE_BACKTRACE_SYMBOLS
-#undef CUSTOM_EXCEPTION_HANDLING
+#undef DEBUG_EXCEPTIONS
#define MONO_ZERO_REG mips_zero