OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2013 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/trusted/service_runtime/include/bits/nacl_syscalls.h
" | 9 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h
" |
10 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" | 10 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
11 #include "native_client/src/trusted/service_runtime/nacl_copy.h" | 11 #include "native_client/src/trusted/service_runtime/nacl_copy.h" |
12 #include "native_client/src/trusted/service_runtime/nacl_syscall_register.h" | 12 #include "native_client/src/trusted/service_runtime/nacl_syscall_register.h" |
13 #include "native_client/src/trusted/service_runtime/nacl_tls.h" | 13 #include "native_client/src/trusted/service_runtime/nacl_tls.h" |
14 | 14 |
15 static int32_t TestSyscall(struct NaClAppThread *natp) { | 15 static int32_t TestSyscall(struct NaClAppThread *natp) { |
16 UNREFERENCED_PARAMETER(natp); | 16 UNREFERENCED_PARAMETER(natp); |
17 | 17 |
18 g_nacl_syscall_thread_capture_fault_addr = | 18 g_nacl_syscall_thread_capture_fault_addr = |
19 (uintptr_t) &NaClSyscallThreadCaptureFault; | 19 (uintptr_t) &NaClSyscallThreadCaptureFault; |
20 | 20 |
21 NaClTlsSetCurrentThread(NULL); | 21 natp->user.guard_token++; |
22 | 22 |
23 return 0; | 23 return 0; |
24 } | 24 } |
25 | 25 |
26 NACL_DEFINE_SYSCALL_0(TestSyscall) | 26 NACL_DEFINE_SYSCALL_0(TestSyscall) |
27 | 27 |
28 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) { | 28 void NaClInjectThreadCaptureSyscall(struct NaClApp *nap) { |
29 NACL_REGISTER_SYSCALL(nap, TestSyscall, NACL_sys_test_syscall_1); | 29 NACL_REGISTER_SYSCALL(nap, TestSyscall, NACL_sys_test_syscall_1); |
30 } | 30 } |
OLD | NEW |