mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -04:00
kern/os: support CreateProcessFlag_EnableAliasRegionExtraSize
This commit is contained in:
parent
8cacb07d5f
commit
5e63792a67
10 changed files with 68 additions and 33 deletions
|
@ -106,6 +106,9 @@ namespace ams::kern::svc {
|
|||
*out = 0;
|
||||
}
|
||||
break;
|
||||
case ams::svc::InfoType_AliasRegionExtraSize:
|
||||
*out = process->GetPageTable().GetAliasRegionExtraSize();
|
||||
break;
|
||||
MESOSPHERE_UNREACHABLE_DEFAULT_CASE();
|
||||
}
|
||||
|
||||
|
@ -134,6 +137,7 @@ namespace ams::kern::svc {
|
|||
case ams::svc::InfoType_UsedNonSystemMemorySize:
|
||||
case ams::svc::InfoType_IsApplication:
|
||||
case ams::svc::InfoType_FreeThreadCount:
|
||||
case ams::svc::InfoType_AliasRegionExtraSize:
|
||||
{
|
||||
/* These info types don't support non-zero subtypes. */
|
||||
R_UNLESS(info_subtype == 0, svc::ResultInvalidCombination());
|
||||
|
|
|
@ -162,6 +162,18 @@ namespace ams::kern::svc {
|
|||
/* Check that the number of extra resource pages is >= 0. */
|
||||
R_UNLESS(params.system_resource_num_pages >= 0, svc::ResultInvalidSize());
|
||||
|
||||
/* Validate that the alias region extra size is allowed, if enabled. */
|
||||
if (params.flags & ams::svc::CreateProcessFlag_EnableAliasRegionExtraSize) {
|
||||
/* Check that we have a 64-bit address space. */
|
||||
R_UNLESS((params.flags & ams::svc::CreateProcessFlag_AddressSpaceMask) == ams::svc::CreateProcessFlag_AddressSpace64Bit, svc::ResultInvalidState());
|
||||
|
||||
/* Check that the system resource page count is non-zero. */
|
||||
R_UNLESS(params.system_resource_num_pages > 0, svc::ResultInvalidState());
|
||||
|
||||
/* Check that debug mode is enabled. */
|
||||
R_UNLESS(KTargetSystem::IsDebugMode(), svc::ResultInvalidState());
|
||||
}
|
||||
|
||||
/* Convert to sizes. */
|
||||
const size_t code_num_pages = params.code_num_pages;
|
||||
const size_t system_resource_num_pages = params.system_resource_num_pages;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue