Merge remote-tracking branch 'upstream/master' into nx
# Conflicts: # src/core/CMakeLists.txt # src/core/arm/dynarmic/arm_dynarmic.cpp # src/core/arm/dyncom/arm_dyncom.cpp # src/core/hle/kernel/process.cpp # src/core/hle/kernel/thread.cpp # src/core/hle/kernel/thread.h # src/core/hle/kernel/vm_manager.cpp # src/core/loader/3dsx.cpp # src/core/loader/elf.cpp # src/core/loader/ncch.cpp # src/core/memory.cpp # src/core/memory.h # src/core/memory_setup.h
This commit is contained in:
@ -91,8 +91,8 @@ static u32 TranslateAddr(u32 addr, const THREEloadinfo* loadinfo, u32* offsets)
|
||||
return loadinfo->seg_addrs[2] + addr - offsets[1];
|
||||
}
|
||||
|
||||
using Kernel::SharedPtr;
|
||||
using Kernel::CodeSet;
|
||||
using Kernel::SharedPtr;
|
||||
|
||||
static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr,
|
||||
SharedPtr<CodeSet>* out_codeset) {
|
||||
@ -255,7 +255,7 @@ FileType AppLoader_THREEDSX::IdentifyType(FileUtil::IOFile& file) {
|
||||
return FileType::Error;
|
||||
}
|
||||
|
||||
ResultStatus AppLoader_THREEDSX::Load() {
|
||||
ResultStatus AppLoader_THREEDSX::Load(Kernel::SharedPtr<Kernel::Process>& process) {
|
||||
if (is_loaded)
|
||||
return ResultStatus::ErrorAlreadyLoaded;
|
||||
|
||||
@ -267,19 +267,17 @@ ResultStatus AppLoader_THREEDSX::Load() {
|
||||
return ResultStatus::Error;
|
||||
codeset->name = filename;
|
||||
|
||||
Kernel::g_current_process = Kernel::Process::Create("main");
|
||||
Kernel::g_current_process->LoadModule(codeset, codeset->entrypoint);
|
||||
Kernel::g_current_process->svc_access_mask.set();
|
||||
Kernel::g_current_process->address_mappings = default_address_mappings;
|
||||
process = Kernel::Process::Create("main");
|
||||
process->LoadModule(codeset, codeset->entrypoint);
|
||||
process->svc_access_mask.set();
|
||||
process->address_mappings = default_address_mappings;
|
||||
|
||||
// Attach the default resource limit (APPLICATION) to the process
|
||||
Kernel::g_current_process->resource_limit =
|
||||
process->resource_limit =
|
||||
Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION);
|
||||
process->Run(codeset->entrypoint, 48, Kernel::DEFAULT_STACK_SIZE);
|
||||
|
||||
Kernel::g_current_process->Run(codeset->entrypoint, 48, Kernel::DEFAULT_STACK_SIZE);
|
||||
|
||||
Service::FS::RegisterArchiveType(std::make_unique<FileSys::ArchiveFactory_SelfNCCH>(*this),
|
||||
Service::FS::ArchiveIdCode::SelfNCCH);
|
||||
Service::FS::RegisterSelfNCCH(*this);
|
||||
|
||||
is_loaded = true;
|
||||
return ResultStatus::Success;
|
||||
|
Reference in New Issue
Block a user