| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/nacl/loader/nonsfi/nonsfi_main.h" | 5 #include "components/nacl/loader/nonsfi/nonsfi_main.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/nacl/loader/nonsfi/elf_loader.h" | 9 #include "components/nacl/loader/nonsfi/elf_loader.h" |
| 10 #include "components/nacl/loader/nonsfi/irt/irt_interfaces.h" |
| 10 #include "native_client/src/include/elf_auxv.h" | 11 #include "native_client/src/include/elf_auxv.h" |
| 11 #include "native_client/src/include/nacl_macros.h" | 12 #include "native_client/src/include/nacl_macros.h" |
| 12 #include "native_client/src/public/secure_service.h" | 13 #include "native_client/src/public/secure_service.h" |
| 13 #include "native_client/src/shared/srpc/nacl_srpc.h" | 14 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 14 #include "native_client/src/trusted/desc/nacl_desc_base.h" | 15 #include "native_client/src/trusted/desc/nacl_desc_base.h" |
| 15 #include "native_client/src/trusted/desc/nacl_desc_imc.h" | 16 #include "native_client/src/trusted/desc/nacl_desc_imc.h" |
| 16 #include "native_client/src/trusted/desc/nrd_all_modules.h" | 17 #include "native_client/src/trusted/desc/nrd_all_modules.h" |
| 17 #include "native_client/src/trusted/desc/nrd_xfer.h" | 18 #include "native_client/src/trusted/desc/nrd_xfer.h" |
| 18 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" | 19 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" |
| 19 | 20 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 48 uintptr_t entry_point = image.entry_point(); | 49 uintptr_t entry_point = image.entry_point(); |
| 49 rpc->result = NACL_SRPC_RESULT_OK; | 50 rpc->result = NACL_SRPC_RESULT_OK; |
| 50 | 51 |
| 51 // Run for testing. TODO(hidehiko): Remove this. | 52 // Run for testing. TODO(hidehiko): Remove this. |
| 52 uintptr_t info[] = { | 53 uintptr_t info[] = { |
| 53 0, // Do not use fini. | 54 0, // Do not use fini. |
| 54 0, // envc. | 55 0, // envc. |
| 55 0, // argc. | 56 0, // argc. |
| 56 0, // Null terminate for argv. | 57 0, // Null terminate for argv. |
| 57 0, // Null terminate for envv. | 58 0, // Null terminate for envv. |
| 59 AT_SYSINFO, |
| 60 reinterpret_cast<uintptr_t>(&NaClIrtInterface), |
| 58 AT_NULL, | 61 AT_NULL, |
| 59 0, // Null terminate for auxv. | 62 0, // Null terminate for auxv. |
| 60 }; | 63 }; |
| 61 reinterpret_cast<void (*)(uintptr_t*)>(entry_point)(info); | 64 reinterpret_cast<void (*)(uintptr_t*)>(entry_point)(info); |
| 62 } | 65 } |
| 63 | 66 |
| 64 const static struct NaClSrpcHandlerDesc kNonSfiServiceHandlers[] = { | 67 const static struct NaClSrpcHandlerDesc kNonSfiServiceHandlers[] = { |
| 65 { NACL_SECURE_SERVICE_LOAD_MODULE, LoadModuleRpc, }, | 68 { NACL_SECURE_SERVICE_LOAD_MODULE, LoadModuleRpc, }, |
| 66 { static_cast<const char*>(NULL), static_cast<NaClSrpcMethod>(NULL), }, | 69 { static_cast<const char*>(NULL), static_cast<NaClSrpcMethod>(NULL), }, |
| 67 }; | 70 }; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 LOG(ERROR) << "MainStart: Failed to set up bootstrap channel."; | 161 LOG(ERROR) << "MainStart: Failed to set up bootstrap channel."; |
| 159 return; | 162 return; |
| 160 } | 163 } |
| 161 | 164 |
| 162 // Start the SRPC server loop. | 165 // Start the SRPC server loop. |
| 163 ServiceAccept(secure_port.get()); | 166 ServiceAccept(secure_port.get()); |
| 164 } | 167 } |
| 165 | 168 |
| 166 } // namespace nonsfi | 169 } // namespace nonsfi |
| 167 } // namespace nacl | 170 } // namespace nacl |
| OLD | NEW |