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 /* | 7 /* |
8 * NaCl Server Runtime global scoped objects for handling global resources. | 8 * NaCl Server Runtime global scoped objects for handling global resources. |
9 */ | 9 */ |
10 | 10 |
11 #include "native_client/src/shared/platform/nacl_interruptible_mutex.h" | 11 #include "native_client/src/shared/platform/nacl_interruptible_mutex.h" |
12 #include "native_client/src/shared/platform/nacl_log.h" | 12 #include "native_client/src/shared/platform/nacl_log.h" |
13 #include "native_client/src/shared/platform/nacl_sync.h" | 13 #include "native_client/src/shared/platform/nacl_sync.h" |
14 #include "native_client/src/shared/platform/nacl_sync_checked.h" | 14 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
15 #include "native_client/src/shared/platform/nacl_threads.h" | 15 #include "native_client/src/shared/platform/nacl_threads.h" |
16 #include "native_client/src/trusted/service_runtime/arch/sel_ldr_arch.h" | 16 #include "native_client/src/trusted/service_runtime/arch/sel_ldr_arch.h" |
17 #include "native_client/src/trusted/service_runtime/nacl_app.h" | 17 #include "native_client/src/trusted/service_runtime/nacl_app.h" |
18 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" | 18 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
19 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 19 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
20 | 20 |
| 21 #if NACL_OSX |
| 22 #include "native_client/src/trusted/service_runtime/osx/mach_thread_map.h" |
| 23 #endif |
| 24 |
21 struct NaClThreadContext *nacl_user[NACL_THREAD_MAX] = {NULL}; | 25 struct NaClThreadContext *nacl_user[NACL_THREAD_MAX] = {NULL}; |
22 #if NACL_WINDOWS | 26 #if NACL_WINDOWS |
23 uint32_t nacl_thread_ids[NACL_THREAD_MAX] = {0}; | 27 uint32_t nacl_thread_ids[NACL_THREAD_MAX] = {0}; |
24 #endif | 28 #endif |
25 | 29 |
26 /* | 30 /* |
27 * Hack for gdb. This records xlate_base in a place where (1) gdb can find it, | 31 * Hack for gdb. This records xlate_base in a place where (1) gdb can find it, |
28 * and (2) gdb doesn't need debug info (it just needs symbol info). | 32 * and (2) gdb doesn't need debug info (it just needs symbol info). |
29 */ | 33 */ |
30 uintptr_t nacl_global_xlate_base; | 34 uintptr_t nacl_global_xlate_base; |
31 | 35 |
32 void NaClGlobalModuleInit(void) { | 36 void NaClGlobalModuleInit(void) { |
33 NaClInitGlobals(); | 37 NaClInitGlobals(); |
| 38 |
| 39 #if NACL_OSX |
| 40 NaClInitMachThreadMap(); |
| 41 #endif |
34 } | 42 } |
35 | 43 |
36 | 44 |
37 void NaClGlobalModuleFini(void) { | 45 void NaClGlobalModuleFini(void) { |
38 } | 46 } |
OLD | NEW |