summaryrefslogtreecommitdiff
path: root/lib/csu/mips/crt.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csu/mips/crt.h')
-rw-r--r--lib/csu/mips/crt.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/csu/mips/crt.h b/lib/csu/mips/crt.h
index 1d967b73ffe4..4dac617c239f 100644
--- a/lib/csu/mips/crt.h
+++ b/lib/csu/mips/crt.h
@@ -34,10 +34,14 @@
"bal 1f \n" \
"nop \n" \
"1: \n" \
- ".cpload $ra \n" \
+ ".cpload $ra \n" \
+ "addu $sp, $sp, -8 \n" \
".set reorder \n" \
+ ".cprestore 4 \n" \
".local " __STRING(func) "\n" \
- "jal " __STRING(func)
+ "jal " __STRING(func) "\n" \
+ "nop \n" \
+ "addu $sp, $sp, 8 \n"
#else
#define INIT_CALL_SEQ(func) \
".set noreorder \n" \
@@ -48,6 +52,7 @@
".cpsetup $ra, $v0, 1b \n" \
".local " __STRING(func) "\n" \
"jal " __STRING(func)
+ "nop \n" \
#endif
#endif