OLD | NEW |
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 #include <float.h> | 7 #include <float.h> |
8 | 8 |
9 #if NACL_WINDOWS | 9 #if NACL_WINDOWS |
10 /* | 10 /* |
11 * This header declares the _mm_getcsr function. | 11 * This header declares the _mm_getcsr function. |
12 */ | 12 */ |
13 #include <mmintrin.h> | 13 #include <mmintrin.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include "native_client/src/shared/platform/nacl_log.h" | 16 #include "native_client/src/shared/platform/nacl_log.h" |
17 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" | 17 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
18 #include "native_client/src/trusted/service_runtime/nacl_signal.h" | 18 #include "native_client/src/trusted/service_runtime/nacl_signal.h" |
19 #include "native_client/src/trusted/service_runtime/sel_ldr.h" | 19 #include "native_client/src/trusted/service_runtime/sel_ldr.h" |
20 #include "native_client/src/trusted/service_runtime/sel_rt.h" | 20 #include "native_client/src/trusted/service_runtime/sel_rt.h" |
21 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" | 21 #include "native_client/src/trusted/service_runtime/include/sys/errno.h" |
22 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h" | 22 #include "native_client/src/trusted/cpu_features/arch/x86/cpu_x86.h" |
23 | 23 |
24 | 24 |
25 uintptr_t NaClGetThreadCtxSp(struct NaClThreadContext *th_ctx) { | 25 uintptr_t NaClGetThreadCtxSp(struct NaClThreadContext *th_ctx) { |
26 return (uintptr_t) th_ctx->stack_ptr; | 26 return (uintptr_t) th_ctx->stack_ptr; |
27 } | 27 } |
28 | 28 |
29 | 29 |
30 void NaClSetThreadCtxSp(struct NaClThreadContext *th_ctx, uintptr_t sp) { | 30 void NaClSetThreadCtxSp(struct NaClThreadContext *th_ctx, uintptr_t sp) { |
31 th_ctx->stack_ptr = (uint32_t) sp; | 31 th_ctx->stack_ptr = (uint32_t) sp; |
32 } | 32 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 sig_ctx->edi = th_ctx->edi; | 146 sig_ctx->edi = th_ctx->edi; |
147 sig_ctx->prog_ctr = th_ctx->new_prog_ctr; | 147 sig_ctx->prog_ctr = th_ctx->new_prog_ctr; |
148 sig_ctx->flags = 0; | 148 sig_ctx->flags = 0; |
149 sig_ctx->cs = th_ctx->cs; | 149 sig_ctx->cs = th_ctx->cs; |
150 sig_ctx->ss = th_ctx->ss; | 150 sig_ctx->ss = th_ctx->ss; |
151 sig_ctx->ds = th_ctx->ds; | 151 sig_ctx->ds = th_ctx->ds; |
152 sig_ctx->es = th_ctx->es; | 152 sig_ctx->es = th_ctx->es; |
153 sig_ctx->fs = th_ctx->fs; | 153 sig_ctx->fs = th_ctx->fs; |
154 sig_ctx->gs = th_ctx->gs; | 154 sig_ctx->gs = th_ctx->gs; |
155 } | 155 } |
OLD | NEW |