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

Side by Side Diff: tests/thread_capture/arch/x86_32/thread_capture_test_injection.c

Issue 11864002: Move CPU features into its own static library. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Address bsy's comments by not building x86 target when host isn't x86. This is how things are curre… Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/validator_x86/ncval.c ('k') | tools/coverage_helper.py » ('j') | 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 #include "native_client/tests/thread_capture/thread_capture_test_injection.h" 7 #include "native_client/tests/thread_capture/thread_capture_test_injection.h"
8 8
9 #include "native_client/src/include/portability.h" 9 #include "native_client/src/include/portability.h"
10 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h " 10 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h "
11 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" 11 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h"
12 #include "native_client/src/trusted/service_runtime/nacl_copy.h" 12 #include "native_client/src/trusted/service_runtime/nacl_copy.h"
13 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" 13 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h"
14 #include "native_client/src/trusted/service_runtime/sel_ldr.h" 14 #include "native_client/src/trusted/service_runtime/sel_ldr.h"
15 #include "native_client/src/trusted/service_runtime/sel_rt.h" 15 #include "native_client/src/trusted/service_runtime/sel_rt.h"
16 #include "native_client/src/trusted/validator/x86/nacl_cpuid.h" 16 #include "native_client/src/trusted/cpu_features/arch/x86/cpu_x86.h"
17 17
18 static int32_t TestSyscall(struct NaClAppThread *natp) { 18 static int32_t TestSyscall(struct NaClAppThread *natp) {
19 /* TODO(mcgrathr): Use a safe cast here. */ 19 /* TODO(mcgrathr): Use a safe cast here. */
20 NaClCPUFeaturesX86 *features = (NaClCPUFeaturesX86 *) natp->nap->cpu_features; 20 NaClCPUFeaturesX86 *features = (NaClCPUFeaturesX86 *) natp->nap->cpu_features;
21 if (NaClGetCPUFeatureX86(features, NaClCPUFeatureX86_SSE)) { 21 if (NaClGetCPUFeatureX86(features, NaClCPUFeatureX86_SSE)) {
22 g_nacl_syscall_thread_capture_fault_addr = 22 g_nacl_syscall_thread_capture_fault_addr =
23 (uintptr_t) &NaClSyscallThreadCaptureFaultSSE; 23 (uintptr_t) &NaClSyscallThreadCaptureFaultSSE;
24 } else { 24 } else {
25 g_nacl_syscall_thread_capture_fault_addr = 25 g_nacl_syscall_thread_capture_fault_addr =
26 (uintptr_t) &NaClSyscallThreadCaptureFaultNoSSE; 26 (uintptr_t) &NaClSyscallThreadCaptureFaultNoSSE;
27 } 27 }
28 28
29 NaClCopyInDropLock(natp->nap); 29 NaClCopyInDropLock(natp->nap);
30 30
31 natp->user.gs = natp->user.trusted_gs; 31 natp->user.gs = natp->user.trusted_gs;
32 32
33 return 0; 33 return 0;
34 } 34 }
35 35
36 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) { 36 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) {
37 UNREFERENCED_PARAMETER(nap); 37 UNREFERENCED_PARAMETER(nap);
38 38
39 NaClAddSyscall(NACL_sys_test_syscall_1, TestSyscall); 39 NaClAddSyscall(NACL_sys_test_syscall_1, TestSyscall);
40 } 40 }
OLDNEW
« no previous file with comments | « src/trusted/validator_x86/ncval.c ('k') | tools/coverage_helper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698