Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: src/trusted/service_runtime/linux/nacl_bootstrap.c

Issue 10919162: [MIPS] Implementation of sel_ldr for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Rebase (Saturday morning). Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/linux/nacl_bootstrap.c
diff --git a/src/trusted/service_runtime/linux/nacl_bootstrap.c b/src/trusted/service_runtime/linux/nacl_bootstrap.c
index 6a7537769c324f180cdf12d5e3cccfa63a1c573f..01b0676c9242923bca8f0d8b26ad1642c4655400 100644
--- a/src/trusted/service_runtime/linux/nacl_bootstrap.c
+++ b/src/trusted/service_runtime/linux/nacl_bootstrap.c
@@ -264,6 +264,8 @@ static ElfW(Addr) load_elf_file(const char *filename,
case EM_X86_64:
#elif defined(__arm__)
case EM_ARM:
+#elif defined(__mips__)
+ case EM_MIPS:
#else
# error "Don't know the e_machine value for this architecture!"
#endif
@@ -667,6 +669,24 @@ asm(".pushsection \".text\",\"ax\",%progbits\n"
"blx r0\n" /* Jump to the entry point. */
".popsection"
);
+#elif defined(__mips__)
+asm(".pushsection \".text\",\"ax\",%progbits\n"
+ ".globl _start\n"
+ ".type _start,@function\n"
+ "_start:\n"
+ ".set noreorder\n"
+ "addiu $fp, $zero, 0\n"
+ "addiu $ra, $zero, 0\n"
+ "addiu $s8, $sp, 0\n" /* Save starting SP in s8. */
+ "addiu $a0, $sp, 0\n"
+ "addiu $sp, $sp, -16\n"
+ "jal do_load\n"
+ "nop\n"
+ "addiu $sp, $s8, 0\n" /* Restore the saved SP. */
+ "jr $v0\n" /* Jump to the entry point. */
+ "nop\n"
+ ".popsection"
+ );
#else
# error "Need stack-preserving _start code for this architecture!"
#endif
« no previous file with comments | « src/trusted/service_runtime/linux/mips/sel_segments.c ('k') | src/trusted/service_runtime/linux/nacl_bootstrap.x » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698