| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 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 | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * be 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" |
| 14 #include "native_client/src/shared/platform/nacl_sync_checked.h" |
| 13 #include "native_client/src/shared/platform/nacl_threads.h" | 15 #include "native_client/src/shared/platform/nacl_threads.h" |
| 14 #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" |
| 15 #include "native_client/src/trusted/service_runtime/nacl_app.h" | 17 #include "native_client/src/trusted/service_runtime/nacl_app.h" |
| 16 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" | 18 #include "native_client/src/trusted/service_runtime/nacl_app_thread.h" |
| 17 #include "native_client/src/trusted/service_runtime/nacl_globals.h" | 19 #include "native_client/src/trusted/service_runtime/nacl_globals.h" |
| 18 | 20 |
| 19 struct NaClMutex nacl_thread_mu = {NULL}; | 21 struct NaClMutex nacl_thread_mu = {NULL}; |
| 20 | 22 |
| 21 struct NaClThreadContext *nacl_user[NACL_THREAD_MAX] = {NULL}; | 23 struct NaClThreadContext *nacl_user[NACL_THREAD_MAX] = {NULL}; |
| 22 struct NaClThreadContext *nacl_sys[NACL_THREAD_MAX] = {NULL}; | 24 struct NaClThreadContext *nacl_sys[NACL_THREAD_MAX] = {NULL}; |
| 23 struct NaClAppThread *nacl_thread[NACL_THREAD_MAX] = {NULL}; | 25 struct NaClAppThread *nacl_thread[NACL_THREAD_MAX] = {NULL}; |
| 24 | 26 |
| 25 /* | 27 /* |
| 26 * Hack for gdb. This records xlate_base in a place where (1) gdb can find it, | 28 * Hack for gdb. This records xlate_base in a place where (1) gdb can find it, |
| 27 * and (2) gdb doesn't need debug info (it just needs symbol info). | 29 * and (2) gdb doesn't need debug info (it just needs symbol info). |
| 28 */ | 30 */ |
| 29 uintptr_t nacl_global_xlate_base; | 31 uintptr_t nacl_global_xlate_base; |
| 30 | 32 |
| 31 void NaClGlobalModuleInit(void) { | 33 void NaClGlobalModuleInit(void) { |
| 32 NaClMutexCtor(&nacl_thread_mu); | 34 NaClXMutexCtor(&nacl_thread_mu); |
| 33 NaClInitGlobals(); | 35 NaClInitGlobals(); |
| 34 } | 36 } |
| 35 | 37 |
| 36 | 38 |
| 37 void NaClGlobalModuleFini(void) { | 39 void NaClGlobalModuleFini(void) { |
| 38 NaClMutexDtor(&nacl_thread_mu); | 40 NaClMutexDtor(&nacl_thread_mu); |
| 39 } | 41 } |
| OLD | NEW |