diff options
| author | Jyun-Yan You <jyyou@cs.nctu.edu.tw> | 2013-05-21 11:58:08 +0800 |
|---|---|---|
| committer | Jyun-Yan You <jyyou@cs.nctu.edu.tw> | 2013-05-21 11:58:30 +0800 |
| commit | d86a32bbb2ff79232bf3edc0f475062f45b6ea90 (patch) | |
| tree | 964199611d195b2a10ff45d59614cd6c0804756a /src/rt/arch/mips/context.cpp | |
| parent | 6c0a4693c94ffbb5601b59d0c82c7785d347107d (diff) | |
| download | rust-d86a32bbb2ff79232bf3edc0f475062f45b6ea90.tar.gz rust-d86a32bbb2ff79232bf3edc0f475062f45b6ea90.zip | |
fix mips stack alignment
Diffstat (limited to 'src/rt/arch/mips/context.cpp')
| -rw-r--r-- | src/rt/arch/mips/context.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rt/arch/mips/context.cpp b/src/rt/arch/mips/context.cpp index 7347a92e98b..e1e5776bc1a 100644 --- a/src/rt/arch/mips/context.cpp +++ b/src/rt/arch/mips/context.cpp @@ -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; |
