fix mips stack alignment

This commit is contained in:
Jyun-Yan You 2013-05-21 11:58:08 +08:00
parent 6c0a4693c9
commit d86a32bbb2
2 changed files with 7 additions and 3 deletions

View file

@ -34,9 +34,11 @@ void context::call(void *f, void *arg, void *stack)
// set up the stack
uint32_t *sp = (uint32_t *)stack;
//sp = align_down(sp);
sp = align_down(sp);
// The final return address. 0 indicates the bottom of the stack
*--sp = 0;
// sp of mips o32 is 8-byte aligned
sp -= 2;
*sp = 0;
regs.data[4] = (uint32_t)arg;
regs.data[29] = (uint32_t)sp;