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 "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/nacl_tls.h" | 14 #include "native_client/src/trusted/service_runtime/nacl_tls.h" |
15 | 15 |
16 static int32_t TestSyscall(struct NaClAppThread *natp) { | 16 static int32_t TestSyscall(struct NaClAppThread *natp) { |
17 g_nacl_syscall_thread_capture_fault_addr = | 17 g_nacl_syscall_thread_capture_fault_addr = |
18 (uintptr_t) &NaClSyscallThreadCaptureFault; | 18 (uintptr_t) &NaClSyscallThreadCaptureFault; |
19 | 19 |
20 NaClCopyDropLock(natp->nap); | 20 NaClCopyDropLock(natp->nap); |
21 | 21 |
22 NaClTlsSetIdx(0); | 22 NaClTlsSetCurrentThread(NULL); |
23 | 23 |
24 return 0; | 24 return 0; |
25 } | 25 } |
26 | 26 |
27 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) { | 27 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) { |
28 UNREFERENCED_PARAMETER(nap); | 28 UNREFERENCED_PARAMETER(nap); |
29 | 29 |
30 NaClAddSyscall(NACL_sys_test_syscall_1, TestSyscall); | 30 NaClAddSyscall(NACL_sys_test_syscall_1, TestSyscall); |
31 } | 31 } |
OLD | NEW |