kern: implement SvcUnmapMemory, more of SvcGetInfo

This commit is contained in:
Michael Scire committed 2020-07-10 11:55:33 -07:00
1 parent faad5609b9
commit 1a0696f8a3
14 files changed
+231 -37

No files matched your search

@@ -34,6 +34,10 @@ namespace ams::kern::svc {
case ams::svc::InfoType_AslrRegionSize:
case ams::svc::InfoType_StackRegionAddress:
case ams::svc::InfoType_StackRegionSize:
case ams::svc::InfoType_ProgramId:
case ams::svc::InfoType_InitialProcessIdRange:
case ams::svc::InfoType_UserExceptionContextAddress:
case ams::svc::InfoType_TotalNonSystemMemorySize:
{
/* These info types don't support non-zero subtypes. */
R_UNLESS(info_subtype == 0, svc::ResultInvalidCombination());
@@ -67,6 +71,18 @@ namespace ams::kern::svc {
case ams::svc::InfoType_StackRegionSize:
*out = process->GetPageTable().GetStackRegionSize();
break;
case ams::svc::InfoType_ProgramId:
*out = process->GetProgramId();
break;
case ams::svc::InfoType_InitialProcessIdRange:
/* TODO: Detect exactly 4.0.0 target firmware, do the right thing. */
return svc::ResultInvalidEnumValue();
case ams::svc::InfoType_UserExceptionContextAddress:
*out = GetInteger(process->GetProcessLocalRegionAddress());
break;
case ams::svc::InfoType_TotalNonSystemMemorySize:
*out = process->GetTotalNonSystemUserPhysicalMemorySize();
break;
MESOSPHERE_UNREACHABLE_DEFAULT_CASE();
}
}