Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: src/trusted/service_runtime/sel_ldr_standard.c

Issue 891603002: Removes the name service from the service runtime (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 Simple/secure ELF loader (NaCl SEL). 8 * NaCl Simple/secure ELF loader (NaCl SEL).
9 */ 9 */
10 10
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return addr < nap->static_text_end; 477 return addr < nap->static_text_end;
478 } 478 }
479 479
480 int NaClAppLaunchServiceThreads(struct NaClApp *nap) { 480 int NaClAppLaunchServiceThreads(struct NaClApp *nap) {
481 struct NaClKernelService *kernel_service = NULL; 481 struct NaClKernelService *kernel_service = NULL;
482 int rv = 0; 482 int rv = 0;
483 483
484 NaClLog(4, "NaClAppLaunchServiceThreads: Entered, nap 0x%"NACL_PRIxPTR"\n", 484 NaClLog(4, "NaClAppLaunchServiceThreads: Entered, nap 0x%"NACL_PRIxPTR"\n",
485 (uintptr_t) nap); 485 (uintptr_t) nap);
486 486
487 NaClNameServiceLaunch(nap->name_service);
488
489 if (LOAD_OK != NaClWaitForStartModuleCommand(nap)) { 487 if (LOAD_OK != NaClWaitForStartModuleCommand(nap)) {
490 return rv; 488 return rv;
491 } 489 }
492 490
493 NaClXMutexLock(&nap->mu); 491 NaClXMutexLock(&nap->mu);
494 if (NULL == nap->runtime_host_interface) { 492 if (NULL == nap->runtime_host_interface) {
495 nap->runtime_host_interface = malloc(sizeof *nap->runtime_host_interface); 493 nap->runtime_host_interface = malloc(sizeof *nap->runtime_host_interface);
496 if (NULL == nap->runtime_host_interface || 494 if (NULL == nap->runtime_host_interface ||
497 !NaClRuntimeHostInterfaceCtor_protected(nap->runtime_host_interface)) { 495 !NaClRuntimeHostInterfaceCtor_protected(nap->runtime_host_interface)) {
498 NaClLog(LOG_ERROR, "NaClAppLaunchServiceThreads:" 496 NaClLog(LOG_ERROR, "NaClAppLaunchServiceThreads:"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 533
536 NaClXMutexLock(&nap->mu); 534 NaClXMutexLock(&nap->mu);
537 CHECK(NULL == nap->kernel_service); 535 CHECK(NULL == nap->kernel_service);
538 536
539 nap->kernel_service = kernel_service; 537 nap->kernel_service = kernel_service;
540 kernel_service = NULL; 538 kernel_service = NULL;
541 NaClXMutexUnlock(&nap->mu); 539 NaClXMutexUnlock(&nap->mu);
542 rv = 1; 540 rv = 1;
543 541
544 done: 542 done:
545 NaClXMutexLock(&nap->mu);
546 if (NULL != nap->kernel_service) {
Mark Seaborn 2015/02/01 00:40:53 You or I can remove nap->kernel_service in a follo
Petr Hosek 2015/02/01 01:16:05 Yes, I was planning to do that in a separate chang
547 NaClLog(3,
548 ("NaClAppLaunchServiceThreads: adding kernel service to"
549 " name service\n"));
550 (*NACL_VTBL(NaClNameService, nap->name_service)->
551 CreateDescEntry)(nap->name_service,
552 "KernelService", NACL_ABI_O_RDWR,
553 NaClDescRef(nap->kernel_service->base.bound_and_cap[1]));
554 }
555 NaClXMutexUnlock(&nap->mu);
556
557 /* 543 /*
558 * Single exit path. 544 * Single exit path.
559 * 545 *
560 * Error cleanup invariant. No service thread should be running 546 * Error cleanup invariant. No service thread should be running
561 * (modulo asynchronous shutdown). Automatic variables refer to 547 * (modulo asynchronous shutdown). Automatic variables refer to
562 * fully constructed objects if non-NULL, and when ownership is 548 * fully constructed objects if non-NULL, and when ownership is
563 * transferred to the NaClApp object the corresponding automatic 549 * transferred to the NaClApp object the corresponding automatic
564 * variable is set to NULL. 550 * variable is set to NULL.
565 */ 551 */
566 NaClRefCountSafeUnref((struct NaClRefCount *) kernel_service); 552 NaClRefCountSafeUnref((struct NaClRefCount *) kernel_service);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 NaClSysToUserStackAddr(nap, sys_stack_ptr), 851 NaClSysToUserStackAddr(nap, sys_stack_ptr),
866 user_tls1, 852 user_tls1,
867 user_tls2)) { 853 user_tls2)) {
868 NaClLog(LOG_WARNING, 854 NaClLog(LOG_WARNING,
869 ("NaClCreateAdditionalThread: could not allocate thread." 855 ("NaClCreateAdditionalThread: could not allocate thread."
870 " Returning EAGAIN per POSIX specs.\n")); 856 " Returning EAGAIN per POSIX specs.\n"));
871 return -NACL_ABI_EAGAIN; 857 return -NACL_ABI_EAGAIN;
872 } 858 }
873 return 0; 859 return 0;
874 } 860 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698