| Index: src/trusted/service_runtime/arch/mips/sel_rt.c
|
| diff --git a/src/trusted/service_runtime/arch/arm/sel_rt.c b/src/trusted/service_runtime/arch/mips/sel_rt.c
|
| similarity index 57%
|
| copy from src/trusted/service_runtime/arch/arm/sel_rt.c
|
| copy to src/trusted/service_runtime/arch/mips/sel_rt.c
|
| index 37851e66cf66e866a237d4f30600353271c183f8..37e0d7e68eb46e79c57e08746e9b5102a5c4a69d 100644
|
| --- a/src/trusted/service_runtime/arch/arm/sel_rt.c
|
| +++ b/src/trusted/service_runtime/arch/mips/sel_rt.c
|
| @@ -1,7 +1,7 @@
|
| /*
|
| - * Copyright (c) 2012 The Native Client Authors. All rights reserved.
|
| - * Use of this source code is governed by a BSD-style license that can be
|
| - * found in the LICENSE file.
|
| + * Copyright 2012 The Native Client Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can
|
| + * be found in the LICENSE file.
|
| */
|
|
|
| /*
|
| @@ -11,7 +11,7 @@
|
| #include "native_client/src/trusted/service_runtime/nacl_signal.h"
|
| #include "native_client/src/trusted/service_runtime/sel_ldr.h"
|
| #include "native_client/src/trusted/service_runtime/sel_rt.h"
|
| -#include "native_client/src/trusted/service_runtime/arch/arm/sel_ldr_arm.h"
|
| +#include "native_client/src/trusted/service_runtime/arch/mips/sel_ldr_mips.h"
|
|
|
| void NaClInitGlobals() {
|
| NaClLog(2, "NaClInitGlobals\n");
|
| @@ -27,7 +27,7 @@ int NaClThreadContextCtor(struct NaClThreadContext *ntcp,
|
| /*
|
| * This is set by NaClTlsAllocate before we get here, so don't wipe it.
|
| */
|
| - uint32_t r9 = ntcp->r9;
|
| + uint32_t t8 = ntcp->t8;
|
|
|
| UNREFERENCED_PARAMETER(nap);
|
|
|
| @@ -41,13 +41,7 @@ int NaClThreadContextCtor(struct NaClThreadContext *ntcp,
|
| ntcp->stack_ptr = stack_ptr;
|
| ntcp->prog_ctr = prog_ctr;
|
| ntcp->tls_idx = tls_idx;
|
| - ntcp->r9 = r9;
|
| -
|
| - /*
|
| - * Save the system's state of the FPSCR so we can restore
|
| - * the same state when returning to trusted code.
|
| - */
|
| - __asm__ __volatile__("fmrx %0, fpscr" : "=r" (ntcp->sys_fpscr));
|
| + ntcp->t8 = t8;
|
|
|
| NaClLog(4, "user.tls_idx: 0x%08"NACL_PRIxNACL_REG"\n", tls_idx);
|
| NaClLog(4, "user.stack_ptr: 0x%08"NACL_PRIxNACL_REG"\n", ntcp->stack_ptr);
|
| @@ -66,23 +60,38 @@ void NaClSetThreadCtxSp(struct NaClThreadContext *th_ctx, uintptr_t sp) {
|
| th_ctx->stack_ptr = (uint32_t) sp;
|
| }
|
|
|
| -
|
| void NaClThreadContextToSignalContext(const struct NaClThreadContext *th_ctx,
|
| struct NaClSignalContext *sig_ctx) {
|
| - sig_ctx->r0 = 0;
|
| - sig_ctx->r1 = 0;
|
| - sig_ctx->r2 = 0;
|
| - sig_ctx->r3 = 0;
|
| - sig_ctx->r4 = th_ctx->r4;
|
| - sig_ctx->r5 = th_ctx->r5;
|
| - sig_ctx->r6 = th_ctx->r6;
|
| - sig_ctx->r7 = th_ctx->r7;
|
| - sig_ctx->r8 = th_ctx->r8;
|
| - sig_ctx->r9 = th_ctx->r9;
|
| - sig_ctx->r10 = th_ctx->r10;
|
| - sig_ctx->r11 = th_ctx->fp;
|
| - sig_ctx->r12 = 0;
|
| - sig_ctx->stack_ptr = th_ctx->stack_ptr;
|
| - sig_ctx->lr = 0;
|
| - sig_ctx->prog_ctr = th_ctx->new_prog_ctr;
|
| + sig_ctx->zero = 0;
|
| + sig_ctx->at = 0;
|
| + sig_ctx->v0 = 0;
|
| + sig_ctx->v1 = 0;
|
| + sig_ctx->a0 = 0;
|
| + sig_ctx->a1 = 0;
|
| + sig_ctx->a2 = 0;
|
| + sig_ctx->a3 = 0;
|
| + sig_ctx->t0 = 0;
|
| + sig_ctx->t1 = 0;
|
| + sig_ctx->t2 = 0;
|
| + sig_ctx->t3 = 0;
|
| + sig_ctx->t4 = 0;
|
| + sig_ctx->t5 = 0;
|
| + sig_ctx->t6 = NACL_CONTROL_FLOW_MASK;
|
| + sig_ctx->t7 = NACL_DATA_FLOW_MASK;
|
| + sig_ctx->s0 = th_ctx->s0;
|
| + sig_ctx->s1 = th_ctx->s1;
|
| + sig_ctx->s2 = th_ctx->s2;
|
| + sig_ctx->s3 = th_ctx->s3;
|
| + sig_ctx->s4 = th_ctx->s4;
|
| + sig_ctx->s5 = th_ctx->s5;
|
| + sig_ctx->s6 = th_ctx->s6;
|
| + sig_ctx->s7 = th_ctx->s7;
|
| + sig_ctx->t8 = th_ctx->t8;
|
| + sig_ctx->t9 = 0;
|
| + sig_ctx->k0 = 0;
|
| + sig_ctx->k1 = 0;
|
| + sig_ctx->global_ptr = th_ctx->global_ptr;
|
| + sig_ctx->stack_ptr = th_ctx->stack_ptr;
|
| + sig_ctx->frame_ptr = th_ctx->frame_ptr;
|
| + sig_ctx->return_addr = th_ctx->prog_ctr;
|
| }
|
|
|