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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 void (*handler)( | 546 void (*handler)( |
547 void *handler_state, | 547 void *handler_state, |
548 struct NaClThreadInterface *thread_if, | 548 struct NaClThreadInterface *thread_if, |
549 struct NaClDesc *new_conn), | 549 struct NaClDesc *new_conn), |
550 void *handler_state) NACL_WUR; | 550 void *handler_state) NACL_WUR; |
551 | 551 |
552 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR; | 552 NaClErrorCode NaClWaitForLoadModuleStatus(struct NaClApp *nap) NACL_WUR; |
553 | 553 |
554 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR; | 554 NaClErrorCode NaClWaitForStartModuleCommand(struct NaClApp *nap) NACL_WUR; |
555 | 555 |
| 556 /* |
| 557 * NaClBlockIfCommandChannelExists is used during error exit. If |
| 558 * there is a secure command channel, we sent an RPC reply with the |
| 559 * reason that the nexe was rejected. If we exit immediately, that |
| 560 * reply may still be in-flight and the various channel closure (esp |
| 561 * reverse channels, if those were set up) may be detected first by |
| 562 * the controlling process on the other end of the command channel or |
| 563 * reverse channel. When channel closure wins the race against the |
| 564 * RPC reply, it would result in a crash being reported, rather than |
| 565 * the error code carried in the RPC reply. We want to ensure that |
| 566 * the RPC reply to get processed. Instead of allowing the service |
| 567 * runtime process to exit, we block the main thread and wait for the |
| 568 * hard-shutdown on the command channel or command channel closure. |
| 569 * |
| 570 * If there is no command channel, NaClBlockIfCommandChannelExists |
| 571 * just returns immediately. |
| 572 */ |
| 573 void NaClBlockIfCommandChannelExists(struct NaClApp *nap); |
| 574 |
556 void NaClFillMemoryRegionWithHalt(void *start, size_t size); | 575 void NaClFillMemoryRegionWithHalt(void *start, size_t size); |
557 | 576 |
558 void NaClFillTrampolineRegion(struct NaClApp *nap); | 577 void NaClFillTrampolineRegion(struct NaClApp *nap); |
559 | 578 |
560 void NaClFillEndOfTextRegion(struct NaClApp *nap); | 579 void NaClFillEndOfTextRegion(struct NaClApp *nap); |
561 | 580 |
562 #if (NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 \ | 581 #if (NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 \ |
563 && NACL_BUILD_SUBARCH == 32 && __PIC__) | 582 && NACL_BUILD_SUBARCH == 32 && __PIC__) |
564 | 583 |
565 int NaClMakePcrelThunk(struct NaClApp *nap); | 584 int NaClMakePcrelThunk(struct NaClApp *nap); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 | 643 |
625 void NaClVmHoleWaitToStartThread(struct NaClApp *nap); | 644 void NaClVmHoleWaitToStartThread(struct NaClApp *nap); |
626 | 645 |
627 void NaClVmHoleThreadStackIsSafe(struct NaClApp *nap); | 646 void NaClVmHoleThreadStackIsSafe(struct NaClApp *nap); |
628 | 647 |
629 void NaClGdbHook(struct NaClApp const *nap); | 648 void NaClGdbHook(struct NaClApp const *nap); |
630 | 649 |
631 EXTERN_C_END | 650 EXTERN_C_END |
632 | 651 |
633 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */ | 652 #endif /* NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_SEL_LDR_H_ */ |
OLD | NEW |