| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 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 /* | 7 /* |
| 8 * NaCl Server Runtime user thread state. | 8 * NaCl Server Runtime user thread state. |
| 9 */ | 9 */ |
| 10 #include "native_client/src/shared/platform/nacl_check.h" | 10 #include "native_client/src/shared/platform/nacl_check.h" |
| 11 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 11 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
| 12 #include "native_client/src/trusted/service_runtime/nacl_desc_effector_ldr.h" | 12 #include "native_client/src/trusted/service_runtime/nacl_desc_effector_ldr.h" |
| 13 | 13 |
| 14 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 14 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
| 15 #include "native_client/src/trusted/service_runtime/nacl_oop_debugger_hooks.h" |
| 15 #include "native_client/src/trusted/service_runtime/nacl_tls.h" | 16 #include "native_client/src/trusted/service_runtime/nacl_tls.h" |
| 16 #include "native_client/src/trusted/service_runtime/nacl_switch_to_app.h" | 17 #include "native_client/src/trusted/service_runtime/nacl_switch_to_app.h" |
| 17 #include "native_client/src/trusted/service_runtime/nacl_stack_safety.h" | 18 #include "native_client/src/trusted/service_runtime/nacl_stack_safety.h" |
| 18 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" | 19 #include "native_client/src/trusted/service_runtime/nacl_syscall_common.h" |
| 19 | 20 |
| 20 | 21 |
| 21 void WINAPI NaClThreadLauncher(void *state) { | 22 void WINAPI NaClThreadLauncher(void *state) { |
| 22 struct NaClAppThread *natp = (struct NaClAppThread *) state; | 23 struct NaClAppThread *natp = (struct NaClAppThread *) state; |
| 23 NaClLog(4, "NaClThreadLauncher: entered\n"); | 24 NaClLog(4, "NaClThreadLauncher: entered\n"); |
| 24 | 25 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 45 | 46 |
| 46 NaClStackSafetyNowOnUntrustedStack(); /* real soon now! */ | 47 NaClStackSafetyNowOnUntrustedStack(); /* real soon now! */ |
| 47 | 48 |
| 48 /* | 49 /* |
| 49 * Notify the debug stub, that a new thread is availible. | 50 * Notify the debug stub, that a new thread is availible. |
| 50 */ | 51 */ |
| 51 if (NULL != natp->nap->debug_stub_callbacks) { | 52 if (NULL != natp->nap->debug_stub_callbacks) { |
| 52 natp->nap->debug_stub_callbacks->thread_create_hook(natp); | 53 natp->nap->debug_stub_callbacks->thread_create_hook(natp); |
| 53 } | 54 } |
| 54 | 55 |
| 56 NaClOopDebuggerThreadCreateHook(natp); |
| 57 |
| 55 NaClStartThreadInApp(natp, natp->user.prog_ctr); | 58 NaClStartThreadInApp(natp, natp->user.prog_ctr); |
| 56 } | 59 } |
| 57 | 60 |
| 58 int NaClAppThreadCtor(struct NaClAppThread *natp, | 61 int NaClAppThreadCtor(struct NaClAppThread *natp, |
| 59 struct NaClApp *nap, | 62 struct NaClApp *nap, |
| 60 uintptr_t usr_entry, | 63 uintptr_t usr_entry, |
| 61 uintptr_t usr_stack_ptr, | 64 uintptr_t usr_stack_ptr, |
| 62 uint32_t tls_idx, | 65 uint32_t tls_idx, |
| 63 uintptr_t sys_tdb) { | 66 uintptr_t sys_tdb) { |
| 64 int rv; | 67 int rv; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 return 0; | 186 return 0; |
| 184 } | 187 } |
| 185 | 188 |
| 186 return NaClAppThreadCtor(natp, | 189 return NaClAppThreadCtor(natp, |
| 187 nap, | 190 nap, |
| 188 usr_entry, | 191 usr_entry, |
| 189 usr_stack_ptr, | 192 usr_stack_ptr, |
| 190 tls_idx, | 193 tls_idx, |
| 191 sys_tdb_base); | 194 sys_tdb_base); |
| 192 } | 195 } |
| OLD | NEW |