X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftramp-mips.c;h=e90e0a3121bfe39db750792f3c8c235d5be678f0;hb=b0e9fb6f6f4791e9c7684c2e9af17f9929ff6564;hp=aac6eb016e92593c01e5e1583f9c08434ae6a375;hpb=4e422a7b3528fa60bf3a173a74463bbdd8961ef5;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);