X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=mono%2Fmini%2Ftramp-mips.c;h=e90e0a3121bfe39db750792f3c8c235d5be678f0;hb=8170bf67b1e630a8eb7d3fa0cb7c191c38f5c663;hp=aac6eb016e92593c01e5e1583f9c08434ae6a375;hpb=c251b192a55c255f278c9b9ad2ec949264a36526;p=mono.git diff --git a/mono/mini/tramp-mips.c b/mono/mini/tramp-mips.c index aac6eb016e9..e90e0a3121b 100644 --- a/mono/mini/tramp-mips.c +++ b/mono/mini/tramp-mips.c @@ -109,7 +109,9 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, mgreg_t *regs, guint8 *a * STACK would be 444 for 32 bit darwin */ -#define STACK (4*IREG_SIZE + 8 + sizeof(MonoLMF) + 32) +#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) + +#define STACK (int)(ALIGN_TO(4*IREG_SIZE + 8 + sizeof(MonoLMF) + 32, 8)) void mono_arch_nullify_plt_entry (guint8 *code, mgreg_t *regs) @@ -185,9 +187,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Now we'll create in 'buf' the MIPS trampoline code. This is the trampoline code common to all methods */ - + code = buf = mono_global_codeman_reserve (max_code_len); - + /* Allocate the stack frame, and save the return address */ mips_addiu (code, mips_sp, mips_sp, -STACK); mips_sw (code, mips_ra, mips_sp, STACK + MIPS_RET_ADDR_OFFSET);