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 Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
9 * | 9 * |
10 * This loader can only process NaCl object files as produced using | 10 * This loader can only process NaCl object files as produced using |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #define NACL_SERVICE_ADDRESS_DESCRIPTOR 4 | 54 #define NACL_SERVICE_ADDRESS_DESCRIPTOR 4 |
55 | 55 |
56 #define NACL_DEFAULT_ALLOC_MAX (32 << 20) /* total brk and mmap allocs */ | 56 #define NACL_DEFAULT_ALLOC_MAX (32 << 20) /* total brk and mmap allocs */ |
57 #define NACL_DEFAULT_STACK_MAX (16 << 20) /* main thread stack */ | 57 #define NACL_DEFAULT_STACK_MAX (16 << 20) /* main thread stack */ |
58 | 58 |
59 #define NACL_SANDBOX_CHROOT_FD "SBX_D" | 59 #define NACL_SANDBOX_CHROOT_FD "SBX_D" |
60 | 60 |
61 struct NaClAppThread; | 61 struct NaClAppThread; |
62 struct NaClDesc; /* see native_client/src/trusted/desc/nacl_desc_base.h */ | 62 struct NaClDesc; /* see native_client/src/trusted/desc/nacl_desc_base.h */ |
63 struct NaClDynamicRegion; | 63 struct NaClDynamicRegion; |
| 64 struct NaClManifestProxy; |
64 struct NaClSecureService; | 65 struct NaClSecureService; |
65 struct NaClSecureReverseService; | 66 struct NaClSecureReverseService; |
| 67 struct NaClThreadInterface; /* see sel_ldr_thread_interface.h */ |
66 | 68 |
67 struct NaClDebugCallbacks { | 69 struct NaClDebugCallbacks { |
68 void (*thread_create_hook)(struct NaClAppThread *natp); | 70 void (*thread_create_hook)(struct NaClAppThread *natp); |
69 void (*thread_exit_hook)(struct NaClAppThread *natp); | 71 void (*thread_exit_hook)(struct NaClAppThread *natp); |
70 void (*process_exit_hook)(int exit_status); | 72 void (*process_exit_hook)(int exit_status); |
71 }; | 73 }; |
72 | 74 |
73 struct NaClApp { | 75 struct NaClApp { |
74 /* | 76 /* |
75 * public, user settable prior to app start. | 77 * public, user settable prior to app start. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 int threads_launching; | 196 int threads_launching; |
195 | 197 |
196 /* | 198 /* |
197 * Name service must launch after mu, cv, vm_hole_may_exit, | 199 * Name service must launch after mu, cv, vm_hole_may_exit, |
198 * threads_launching are initialized. | 200 * threads_launching are initialized. |
199 */ | 201 */ |
200 struct NaClNameService *name_service; /* default name server */ | 202 struct NaClNameService *name_service; /* default name server */ |
201 struct NaClDesc *name_service_conn_cap; | 203 struct NaClDesc *name_service_conn_cap; |
202 | 204 |
203 struct NaClSecureService *secure_service; | 205 struct NaClSecureService *secure_service; |
| 206 struct NaClThread reverse_setup_thread; |
| 207 /* used only during setup, thread dtors before exiting */ |
| 208 struct NaClManifestProxy *manifest_proxy; |
204 struct NaClSecureReverseClient *reverse_client; | 209 struct NaClSecureReverseClient *reverse_client; |
205 int reverse_channel_initialized; | 210 int reverse_channel_initialized; |
206 NaClSrpcChannel reverse_channel; | 211 NaClSrpcChannel reverse_channel; |
207 | 212 |
208 NaClErrorCode module_load_status; | 213 NaClErrorCode module_load_status; |
209 int module_may_start; | 214 int module_may_start; |
210 | 215 |
211 /* | 216 /* |
212 * runtime info below, thread state, etc; initialized only when app | 217 * runtime info below, thread state, etc; initialized only when app |
213 * is run. Mutex mu protects access to mem_map and other member | 218 * is run. Mutex mu protects access to mem_map and other member |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 uintptr_t NaClAppVmmapFindMapSpace(struct NaClApp *nap, | 518 uintptr_t NaClAppVmmapFindMapSpace(struct NaClApp *nap, |
514 int num_pages); | 519 int num_pages); |
515 | 520 |
516 void NaClCreateServiceSocket(struct NaClApp *nap); | 521 void NaClCreateServiceSocket(struct NaClApp *nap); |
517 | 522 |
518 void NaClSendServiceAddressTo(struct NaClApp *nap, | 523 void NaClSendServiceAddressTo(struct NaClApp *nap, |
519 int desc); | 524 int desc); |
520 | 525 |
521 void NaClSecureCommandChannel(struct NaClApp *nap); | 526 void NaClSecureCommandChannel(struct NaClApp *nap); |
522 | 527 |
| 528 int NaClSecureReverseClientInsertHandler( |
| 529 struct NaClSecureReverseClient *self, |
| 530 void (*handler)( |
| 531 void *handler_state, |
| 532 struct NaClThreadInterface *thread_if, |
| 533 struct NaClDesc *new_conn), |
| 534 void *handler_state) NACL_WUR; |
| 535 |
523 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR; | 536 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR; |
524 | 537 |
525 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR; | 538 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR; |
526 | 539 |
527 void NaClFillMemoryRegionWithHalt(void *start, size_t size); | 540 void NaClFillMemoryRegionWithHalt(void *start, size_t size); |
528 | 541 |
529 void NaClFillTrampolineRegion(struct NaClApp *nap); | 542 void NaClFillTrampolineRegion(struct NaClApp *nap); |
530 | 543 |
531 void NaClFillEndOfTextRegion(struct NaClApp *nap); | 544 void NaClFillEndOfTextRegion(struct NaClApp *nap); |
532 | 545 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 601 |
589 void NaClVmHoleWaitToStartThread(struct NaClApp *nap); | 602 void NaClVmHoleWaitToStartThread(struct NaClApp *nap); |
590 | 603 |
591 void NaClVmHoleThreadStackIsSafe(struct NaClApp *nap); | 604 void NaClVmHoleThreadStackIsSafe(struct NaClApp *nap); |
592 | 605 |
593 void NaClGdbHook(struct NaClApp const *nap); | 606 void NaClGdbHook(struct NaClApp const *nap); |
594 | 607 |
595 EXTERN_C_END | 608 EXTERN_C_END |
596 | 609 |
597 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */ | 610 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */ |
OLD | NEW |