mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-24 07:40:26 +01:00
kern: simplify KProcess max memory calculation
This commit is contained in:
parent
743634c3fd
commit
00716576cd
@ -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 New Issue
Block a user