Bump kernel version for 3DSX (#5446)

This commit is contained in:
Weiyi Wang 2020-09-30 21:54:42 -04:00 committed by GitHub
parent ff9c3b0531
commit 1032b60d9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 17 deletions

View File

@ -145,6 +145,22 @@ void Process::ParseKernelCaps(const u32* kernel_caps, std::size_t len) {
} }
} }
void Process::Set3dsxKernelCaps() {
svc_access_mask.set();
address_mappings = {
{0x1FF50000, 0x8000, true}, // part of DSP RAM
{0x1FF70000, 0x8000, true}, // part of DSP RAM
{0x1F000000, 0x600000, false}, // entire VRAM
};
// Similar to Rosalina, we set kernel version to a recent one.
// This is 11.2.0, to be consistent with core/hle/kernel/config_mem.cpp
// TODO: refactor kernel version out so it is configurable and consistent
// among all relevant places.
kernel_version = 0x234;
}
void Process::Run(s32 main_thread_priority, u32 stack_size) { void Process::Run(s32 main_thread_priority, u32 stack_size) {
memory_region = kernel.GetMemoryRegion(flags.memory_region); memory_region = kernel.GetMemoryRegion(flags.memory_region);

View File

@ -190,6 +190,11 @@ public:
*/ */
void ParseKernelCaps(const u32* kernel_caps, std::size_t len); void ParseKernelCaps(const u32* kernel_caps, std::size_t len);
/**
* Set up the default kernel capability for 3DSX.
*/
void Set3dsxKernelCaps();
/** /**
* Applies address space changes and launches the process main thread. * Applies address space changes and launches the process main thread.
*/ */

View File

@ -268,8 +268,7 @@ ResultStatus AppLoader_THREEDSX::Load(std::shared_ptr<Kernel::Process>& process)
codeset->name = filename; codeset->name = filename;
process = Core::System::GetInstance().Kernel().CreateProcess(std::move(codeset)); process = Core::System::GetInstance().Kernel().CreateProcess(std::move(codeset));
process->svc_access_mask.set(); process->Set3dsxKernelCaps();
process->address_mappings = default_address_mappings;
// Attach the default resource limit (APPLICATION) to the process // Attach the default resource limit (APPLICATION) to the process
process->resource_limit = Core::System::GetInstance().Kernel().ResourceLimit().GetForCategory( process->resource_limit = Core::System::GetInstance().Kernel().ResourceLimit().GetForCategory(

View File

@ -396,8 +396,7 @@ ResultStatus AppLoader_ELF::Load(std::shared_ptr<Kernel::Process>& process) {
codeset->name = filename; codeset->name = filename;
process = Core::System::GetInstance().Kernel().CreateProcess(std::move(codeset)); process = Core::System::GetInstance().Kernel().CreateProcess(std::move(codeset));
process->svc_access_mask.set(); process->Set3dsxKernelCaps();
process->address_mappings = default_address_mappings;
// Attach the default resource limit (APPLICATION) to the process // Attach the default resource limit (APPLICATION) to the process
process->resource_limit = Core::System::GetInstance().Kernel().ResourceLimit().GetForCategory( process->resource_limit = Core::System::GetInstance().Kernel().ResourceLimit().GetForCategory(

View File

@ -15,12 +15,6 @@
namespace Loader { namespace Loader {
const std::initializer_list<Kernel::AddressMapping> default_address_mappings = {
{0x1FF50000, 0x8000, true}, // part of DSP RAM
{0x1FF70000, 0x8000, true}, // part of DSP RAM
{0x1F000000, 0x600000, false}, // entire VRAM
};
FileType IdentifyFile(FileUtil::IOFile& file) { FileType IdentifyFile(FileUtil::IOFile& file) {
FileType type; FileType type;

View File

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <algorithm> #include <algorithm>
#include <initializer_list>
#include <memory> #include <memory>
#include <optional> #include <optional>
#include <string> #include <string>
@ -237,12 +236,6 @@ protected:
bool is_loaded = false; bool is_loaded = false;
}; };
/**
* Common address mappings found in most games, used for binary formats that don't have this
* information.
*/
extern const std::initializer_list<Kernel::AddressMapping> default_address_mappings;
/** /**
* Identifies a bootable file and return a suitable loader * Identifies a bootable file and return a suitable loader
* @param filename String filename of bootable file * @param filename String filename of bootable file