diff options
| author | 2018-02-27 10:22:15 -0500 | |
|---|---|---|
| committer | 2018-03-01 19:03:53 -0500 | |
| commit | 827f8ca3c77ad0b7e667c64b5c983b3b3ffe8d7d (patch) | |
| tree | e557f60eddcd74f0ab380a81dd42749b3e46ef4e /src/core/loader/nso.cpp | |
| parent | FS: Implement MountSaveData and some of the IFile interface. (diff) | |
| download | yuzu-827f8ca3c77ad0b7e667c64b5c983b3b3ffe8d7d.tar.gz yuzu-827f8ca3c77ad0b7e667c64b5c983b3b3ffe8d7d.tar.xz yuzu-827f8ca3c77ad0b7e667c64b5c983b3b3ffe8d7d.zip | |
Kernel: Store the program id in the Process class instead of the CodeSet class.
There may be many CodeSets per Process, so it's wasteful and overcomplicated to store the program id in each of them.
Diffstat (limited to 'src/core/loader/nso.cpp')
| -rw-r--r-- | src/core/loader/nso.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 7f8d24dd6..00b5d1d49 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -92,7 +92,7 @@ static constexpr u32 PageAlignSize(u32 size) { | |||
| 92 | return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; | 92 | return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK; |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base, u64 tid) { | 95 | VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base) { |
| 96 | FileUtil::IOFile file(path, "rb"); | 96 | FileUtil::IOFile file(path, "rb"); |
| 97 | if (!file.IsOpen()) { | 97 | if (!file.IsOpen()) { |
| 98 | return {}; | 98 | return {}; |
| @@ -109,7 +109,7 @@ VAddr AppLoader_NSO::LoadModule(const std::string& path, VAddr load_base, u64 ti | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | // Build program image | 111 | // Build program image |
| 112 | Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create("", tid); | 112 | Kernel::SharedPtr<Kernel::CodeSet> codeset = Kernel::CodeSet::Create(""); |
| 113 | std::vector<u8> program_image; | 113 | std::vector<u8> program_image; |
| 114 | for (int i = 0; i < nso_header.segments.size(); ++i) { | 114 | for (int i = 0; i < nso_header.segments.size(); ++i) { |
| 115 | std::vector<u8> data = | 115 | std::vector<u8> data = |
| @@ -155,10 +155,10 @@ ResultStatus AppLoader_NSO::Load(Kernel::SharedPtr<Kernel::Process>& process) { | |||
| 155 | return ResultStatus::Error; | 155 | return ResultStatus::Error; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | process = Kernel::Process::Create("main"); | 158 | process = Kernel::Process::Create("main", 0); |
| 159 | 159 | ||
| 160 | // Load module | 160 | // Load module |
| 161 | LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR, 0); | 161 | LoadModule(filepath, Memory::PROCESS_IMAGE_VADDR); |
| 162 | LOG_DEBUG(Loader, "loaded module %s @ 0x%" PRIx64, filepath.c_str(), | 162 | LOG_DEBUG(Loader, "loaded module %s @ 0x%" PRIx64, filepath.c_str(), |
| 163 | Memory::PROCESS_IMAGE_VADDR); | 163 | Memory::PROCESS_IMAGE_VADDR); |
| 164 | 164 | ||