mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-09 22:56:35 +00:00
pm: Update for 7.0.0
This commit is contained in:
parent
a3adb70a04
commit
4e99eaa590
3 changed files with 17 additions and 1 deletions
|
@ -122,6 +122,9 @@ void ResourceLimitUtils::InitializeLimits() {
|
|||
memcpy(&g_resource_limits, &g_resource_limits_deprecated, sizeof(g_resource_limits));
|
||||
}
|
||||
|
||||
/* 7.0.0+: Nintendo restricts the number of system threads here, from 0x260 -> 0x60. */
|
||||
/* We will not do this. */
|
||||
|
||||
if (kernelAbove600()) {
|
||||
/* NOTE: 5 is a fake type, official code does not do this. */
|
||||
/* This is done for ease of backwards compatibility. */
|
||||
|
|
|
@ -104,3 +104,10 @@ Result ShellService::GetApplicationProcessId(Out<u64> pid) {
|
|||
Result ShellService::BoostSystemMemoryResourceLimit(u64 sysmem_size) {
|
||||
return ResourceLimitUtils::BoostSystemMemoryResourceLimit(sysmem_size);
|
||||
}
|
||||
|
||||
Result ShellService::BoostSystemThreadsResourceLimit() {
|
||||
/* Starting in 7.0.0, Nintendo reduces the number of system threads from 0x260 to 0x60, */
|
||||
/* Until this command is called to double that amount to 0xC0. */
|
||||
/* We will simply not reduce the number of system threads available for no reason. */
|
||||
return 0x0;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,9 @@ enum ShellCmd_5X {
|
|||
Shell_Cmd_5X_GetProcessEventType = 4,
|
||||
Shell_Cmd_5X_NotifyBootFinished = 5,
|
||||
Shell_Cmd_5X_GetApplicationProcessId = 6,
|
||||
Shell_Cmd_5X_BoostSystemMemoryResourceLimit = 7
|
||||
Shell_Cmd_5X_BoostSystemMemoryResourceLimit = 7,
|
||||
|
||||
Shell_Cmd_BoostSystemThreadsResourceLimit = 8
|
||||
};
|
||||
|
||||
class ShellService final : public IServiceObject {
|
||||
|
@ -59,6 +61,7 @@ class ShellService final : public IServiceObject {
|
|||
void NotifyBootFinished();
|
||||
Result GetApplicationProcessId(Out<u64> pid);
|
||||
Result BoostSystemMemoryResourceLimit(u64 sysmem_size);
|
||||
Result BoostSystemThreadsResourceLimit();
|
||||
public:
|
||||
DEFINE_SERVICE_DISPATCH_TABLE {
|
||||
/* 1.0.0-4.0.0 */
|
||||
|
@ -84,5 +87,8 @@ class ShellService final : public IServiceObject {
|
|||
MakeServiceCommandMeta<Shell_Cmd_5X_NotifyBootFinished, &ShellService::NotifyBootFinished, FirmwareVersion_500>(),
|
||||
MakeServiceCommandMeta<Shell_Cmd_5X_GetApplicationProcessId, &ShellService::GetApplicationProcessId, FirmwareVersion_500>(),
|
||||
MakeServiceCommandMeta<Shell_Cmd_5X_BoostSystemMemoryResourceLimit, &ShellService::BoostSystemMemoryResourceLimit, FirmwareVersion_500>(),
|
||||
|
||||
/* 7.0.0-* */
|
||||
MakeServiceCommandMeta<Shell_Cmd_BoostSystemThreadsResourceLimit, &ShellService::BoostSystemThreadsResourceLimit, FirmwareVersion_700>(),
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue