mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-17 17:36:44 +00:00
kern: simplify KProcess max memory calculation
This commit is contained in:
parent
e200dfb48c
commit
52bc54205b
1 changed files with 2 additions and 12 deletions
|
@ -220,18 +220,8 @@ namespace ams::kern {
|
||||||
m_running_thread_switch_counts[i] = 0;
|
m_running_thread_switch_counts[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set max memory based on address space type. */
|
/* Set max memory. */
|
||||||
switch ((params.flags & ams::svc::CreateProcessFlag_AddressSpaceMask)) {
|
|
||||||
case ams::svc::CreateProcessFlag_AddressSpace32Bit:
|
|
||||||
case ams::svc::CreateProcessFlag_AddressSpace64BitDeprecated:
|
|
||||||
case ams::svc::CreateProcessFlag_AddressSpace64Bit:
|
|
||||||
m_max_process_memory = m_page_table.GetHeapRegionSize();
|
m_max_process_memory = m_page_table.GetHeapRegionSize();
|
||||||
break;
|
|
||||||
case ams::svc::CreateProcessFlag_AddressSpace32BitWithoutAlias:
|
|
||||||
m_max_process_memory = m_page_table.GetHeapRegionSize() + m_page_table.GetAliasRegionSize();
|
|
||||||
break;
|
|
||||||
MESOSPHERE_UNREACHABLE_DEFAULT_CASE();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Generate random entropy. */
|
/* Generate random entropy. */
|
||||||
KSystemControl::GenerateRandom(m_entropy, util::size(m_entropy));
|
KSystemControl::GenerateRandom(m_entropy, util::size(m_entropy));
|
||||||
|
|
Loading…
Reference in a new issue