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

Unified Diff: src/trusted/service_runtime/arch/mips/nacl_switch_to_app_mips.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/arch/mips/nacl_switch_to_app_mips.c
diff --git a/src/trusted/service_runtime/arch/arm/nacl_switch_to_app_arm.c b/src/trusted/service_runtime/arch/mips/nacl_switch_to_app_mips.c
similarity index 79%
copy from src/trusted/service_runtime/arch/arm/nacl_switch_to_app_arm.c
copy to src/trusted/service_runtime/arch/mips/nacl_switch_to_app_mips.c
index 9a2f913f82105af85ebe669f4d14efbe75cfe0ed..fc750fe4a20aabc823867d8569dfe04387e8d87d 100644
--- a/src/trusted/service_runtime/arch/arm/nacl_switch_to_app_arm.c
+++ b/src/trusted/service_runtime/arch/mips/nacl_switch_to_app_mips.c
@@ -9,26 +9,27 @@
*/
#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/service_runtime/sel_ldr.h"
-#include "native_client/src/trusted/service_runtime/arch/arm/sel_rt.h"
+#include "native_client/src/trusted/service_runtime/arch/mips/sel_rt.h"
#include "native_client/src/trusted/service_runtime/nacl_app_thread.h"
#include "native_client/src/trusted/service_runtime/nacl_globals.h"
#include "native_client/src/trusted/service_runtime/nacl_switch_to_app.h"
+#include "native_client/src/trusted/service_runtime/sel_ldr.h"
void NaClInitSwitchToApp(struct NaClApp *nap) {
- /*
- * We don't need anything here. We might need it in future if e.g.
- * we start letting untrusted code use NEON extensions.
- */
+ /*
+ * We don't need anything here.
+ */
UNREFERENCED_PARAMETER(nap);
}
NORETURN void NaClStartThreadInApp(struct NaClAppThread *natp,
uint32_t new_prog_ctr) {
+ struct NaClApp *nap;
struct NaClThreadContext *context;
- natp->user.trusted_stack_ptr = NaClGetStackPtr() & ~0xf;
+ natp->user.trusted_stack_ptr = (NaClGetStackPtr() & ~0xf) + 4;
+ nap = natp->nap;
context = &natp->user;
context->new_prog_ctr = new_prog_ctr;
@@ -41,6 +42,14 @@ NORETURN void NaClStartThreadInApp(struct NaClAppThread *natp,
*/
context->sysret = context->stack_ptr;
+ /*
+ * Just to be sure that app does not spoil gp
+ */
+ context->global_ptr = NaClGetGlobalPtr();
+
+ /*
+ * context stored in $a0
+ */
NaClSwitch(context);
}
« no previous file with comments | « src/trusted/service_runtime/arch/mips/nacl_switch.S ('k') | src/trusted/service_runtime/arch/mips/nacl_syscall.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698