diff options
| author | Subv <subv2112@gmail.com> | 2016-11-19 20:40:04 -0500 |
|---|---|---|
| committer | Subv <subv2112@gmail.com> | 2016-11-19 20:40:04 -0500 |
| commit | d00d0d61e094f4aec7e3a1b82cd4e130fdccaa01 (patch) | |
| tree | 6b3257864d76a4cdd3d8bb9847e55a2a51ff7573 /src/core/hle/kernel | |
| parent | c728fccd9e11285b15ea7c8af27060bc48f23533 (diff) | |
Kernel/Loader: Grab the system mode from the NCCH ExHeader.
3dsx and elf files default to system mode 2 (96MB allocated to the application).
This allows Home Menu to boot without modifications.
Closes #1849
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 9e1795927c..0c8752670f 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -124,13 +124,11 @@ void HandleTable::Clear() { } /// Initialize the kernel -void Init() { +void Init(u32 system_mode) { ConfigMem::Init(); SharedPage::Init(); - // TODO(yuriks): The memory type parameter needs to be determined by the ExHeader field instead - // For now it defaults to the one with a largest allocation to the app - Kernel::MemoryInit(2); // Allocates 96MB to the application + Kernel::MemoryInit(system_mode); Kernel::ResourceLimitsInit(); Kernel::ThreadingInit(); diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 6b8dbecff9..231cf7b75a 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -286,8 +286,8 @@ private: extern HandleTable g_handle_table; -/// Initialize the kernel -void Init(); +/// Initialize the kernel with the specified system mode. +void Init(u32 system_mode); /// Shutdown the kernel void Shutdown(); |
