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