summaryrefslogtreecommitdiffstats
path: root/src/core/loader/nro.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-10-10 05:56:20 +0200
committerbunnei <bunneidev@gmail.com>2017-10-10 05:56:20 +0200
commitb1d5db1cf60344b6b081c9d03cb6ccc3264326cd (patch)
treefde377c4ba3c0f92c032e6f5ec8627aae37270ef /src/core/loader/nro.cpp
parentloader: Various improvements for NSO/NRO loaders. (diff)
parentMerge pull request #2996 from MerryMage/split-travis (diff)
downloadyuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.gz
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.bz2
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.lz
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.xz
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.zst
yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.zip
Diffstat (limited to '')
-rw-r--r--src/core/loader/nro.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/loader/nro.cpp b/src/core/loader/nro.cpp
index 753e7e08b..24c2c55a9 100644
--- a/src/core/loader/nro.cpp
+++ b/src/core/loader/nro.cpp
@@ -132,7 +132,7 @@ bool AppLoader_NRO::LoadNro(const std::string& path, VAddr load_base) {
return true;
}
-ResultStatus AppLoader_NRO::Load() {
+ResultStatus AppLoader_NRO::Load(Kernel::SharedPtr<Kernel::Process>& process) {
if (is_loaded) {
return ResultStatus::ErrorAlreadyLoaded;
}
@@ -142,16 +142,16 @@ ResultStatus AppLoader_NRO::Load() {
// Load and relocate "main" and "sdk" NSO
static constexpr VAddr base_addr{Memory::PROCESS_IMAGE_VADDR};
- Kernel::g_current_process = Kernel::Process::Create("main");
+ process = Kernel::Process::Create("main");
if (!LoadNro(filepath, base_addr)) {
return ResultStatus::ErrorInvalidFormat;
}
- Kernel::g_current_process->svc_access_mask.set();
- Kernel::g_current_process->address_mappings = default_address_mappings;
- Kernel::g_current_process->resource_limit =
+ process->svc_access_mask.set();
+ process->address_mappings = default_address_mappings;
+ process->resource_limit =
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
- Kernel::g_current_process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE);
+ process->Run(base_addr, 48, Kernel::DEFAULT_STACK_SIZE);
ResolveImports();