| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The Native Client Authors. All rights reserved. | 2 * Copyright 2009 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 |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * Gather ye all module initializations and finalizations here. | 8 * Gather ye all module initializations and finalizations here. |
| 9 */ | 9 */ |
| 10 #include "native_client/src/shared/srpc/nacl_srpc.h" | 10 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 11 #include "native_client/src/trusted/debug_stub/debug_stub.h" | 11 #include "native_client/src/trusted/debug_stub/debug_stub.h" |
| 12 #include "native_client/src/trusted/desc/nrd_all_modules.h" | 12 #include "native_client/src/trusted/desc/nrd_all_modules.h" |
| 13 #include "native_client/src/trusted/handle_pass/ldr_handle.h" | 13 #include "native_client/src/trusted/handle_pass/ldr_handle.h" |
| 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_signal.h" | 15 #include "native_client/src/trusted/service_runtime/nacl_signal.h" |
| 16 #include "native_client/src/trusted/service_runtime/nacl_syscall_handlers.h" | 16 #include "native_client/src/trusted/service_runtime/nacl_syscall_handlers.h" |
| 17 #include "native_client/src/trusted/service_runtime/nacl_thread_nice.h" | 17 #include "native_client/src/trusted/service_runtime/nacl_thread_nice.h" |
| 18 #include "native_client/src/trusted/service_runtime/nacl_tls.h" | 18 #include "native_client/src/trusted/service_runtime/nacl_tls.h" |
| 19 | 19 |
| 20 //#define NACL_DEBUG_STUB 1 | |
| 21 | 20 |
| 22 void NaClAllModulesInit(void) { | 21 void NaClAllModulesInit(void) { |
| 23 #ifdef NACL_DEBUG_STUB | 22 #ifdef NACL_DEBUG_STUB |
| 24 NaClDebugStubInit(); | 23 NaClDebugStubInit(); |
| 25 #endif | 24 #endif |
| 26 NaClNrdAllModulesInit(); | 25 NaClNrdAllModulesInit(); |
| 27 NaClGlobalModuleInit(); /* various global variables */ | 26 NaClGlobalModuleInit(); /* various global variables */ |
| 28 NaClSrpcModuleInit(); | 27 NaClSrpcModuleInit(); |
| 29 NaClTlsInit(); | 28 NaClTlsInit(); |
| 30 NaClSyscallTableInit(); | 29 NaClSyscallTableInit(); |
| 31 NaClThreadNiceInit(); | 30 NaClThreadNiceInit(); |
| 32 #if NACL_WINDOWS && !defined(NACL_STANDALONE) | 31 #if NACL_WINDOWS && !defined(NACL_STANDALONE) |
| 33 NaClHandlePassLdrInit(); | 32 NaClHandlePassLdrInit(); |
| 34 #endif | 33 #endif |
| 35 NaClSignalHandlerInit(); | 34 NaClSignalHandlerInit(); |
| 36 } | 35 } |
| 37 | 36 |
| 38 | 37 |
| 39 void NaClAllModulesFini(void) { | 38 void NaClAllModulesFini(void) { |
| 40 NaClSignalHandlerFini(); | 39 NaClSignalHandlerFini(); |
| 41 NaClTlsFini(); | 40 NaClTlsFini(); |
| 42 NaClSrpcModuleFini(); | 41 NaClSrpcModuleFini(); |
| 43 NaClGlobalModuleFini(); | 42 NaClGlobalModuleFini(); |
| 44 NaClNrdAllModulesFini(); | 43 NaClNrdAllModulesFini(); |
| 45 #ifdef NACL_DEBUG_STUB | 44 #ifdef NACL_DEBUG_STUB |
| 46 NaClDebugStubFini(); | 45 NaClDebugStubFini(); |
| 47 #endif | 46 #endif |
| 48 } | 47 } |
| OLD | NEW |