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

Side by Side Diff: src/trusted/service_runtime/arch/mips/nacl_switch_to_app_mips.c

Issue 11151031: [MIPS] Update SConstruct to use new MIPS toolchain. (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Created 8 years, 2 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 unified diff | Download patch
« no previous file with comments | « SConstruct ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * NaCl Service Runtime, C-level context switch code. 8 * NaCl Service Runtime, C-level context switch code.
9 */ 9 */
10 10
11 #include "native_client/src/shared/platform/nacl_check.h" 11 #include "native_client/src/shared/platform/nacl_check.h"
12 #include "native_client/src/trusted/service_runtime/arch/mips/sel_rt.h" 12 #include "native_client/src/trusted/service_runtime/arch/mips/sel_rt.h"
13 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" 13 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h"
14 #include "native_client/src/trusted/service_runtime/nacl_globals.h" 14 #include "native_client/src/trusted/service_runtime/nacl_globals.h"
15 #include "native_client/src/trusted/service_runtime/nacl_switch_to_app.h" 15 #include "native_client/src/trusted/service_runtime/nacl_switch_to_app.h"
16 #include "native_client/src/trusted/service_runtime/sel_ldr.h" 16 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
17 17
18 void NaClInitSwitchToApp(struct NaClApp *nap) { 18 void NaClInitSwitchToApp(struct NaClApp *nap) {
19 /* 19 /*
20 * We don't need anything here. 20 * We don't need anything here.
21 */ 21 */
22 UNREFERENCED_PARAMETER(nap); 22 UNREFERENCED_PARAMETER(nap);
23 } 23 }
24 24
25 NORETURN void NaClStartThreadInApp(struct NaClAppThread *natp, 25 NORETURN void NaClStartThreadInApp(struct NaClAppThread *natp,
26 uint32_t new_prog_ctr) { 26 uint32_t new_prog_ctr) {
27 struct NaClApp *nap;
28 struct NaClThreadContext *context; 27 struct NaClThreadContext *context;
29 28
30 natp->user.trusted_stack_ptr = (NaClGetStackPtr() & ~0xf) + 4; 29 natp->user.trusted_stack_ptr = (NaClGetStackPtr() & ~0xf) + 4;
31 30
32 nap = natp->nap;
33 context = &natp->user; 31 context = &natp->user;
34 context->new_prog_ctr = new_prog_ctr; 32 context->new_prog_ctr = new_prog_ctr;
35 33
36 /* 34 /*
37 * At startup this is not the return value, but the first argument. 35 * At startup this is not the return value, but the first argument.
38 * In the initial thread, it gets the pointer to the information 36 * In the initial thread, it gets the pointer to the information
39 * block on the stack. Additional threads do not expect anything in 37 * block on the stack. Additional threads do not expect anything in
40 * particular in the first argument register, so we don't bother to 38 * particular in the first argument register, so we don't bother to
41 * conditionalize this. 39 * conditionalize this.
42 */ 40 */
43 context->sysret = context->stack_ptr; 41 context->sysret = context->stack_ptr;
44 42
45 /* 43 /*
46 * Just to be sure that app does not spoil gp 44 * Just to be sure that app does not spoil gp
47 */ 45 */
48 context->global_ptr = NaClGetGlobalPtr(); 46 context->global_ptr = NaClGetGlobalPtr();
49 47
50 /* 48 /*
51 * context stored in $a0 49 * context stored in $a0
52 */ 50 */
53 NaClSwitch(context); 51 NaClSwitch(context);
54 } 52 }
55 53
56 /* 54 /*
57 * syscall return 55 * syscall return
58 */ 56 */
59 NORETURN void NaClSwitchToApp(struct NaClAppThread *natp) { 57 NORETURN void NaClSwitchToApp(struct NaClAppThread *natp) {
60 NaClSwitch(&natp->user); 58 NaClSwitch(&natp->user);
61 } 59 }
OLDNEW
« no previous file with comments | « SConstruct ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698