From 0b41ecaa18dbcb9a02d67169028b6a1a12426317 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 7 Sep 2023 01:27:56 +0300 Subject: [PATCH] Fix Resource Limit max commit size --- include/memory.hpp | 2 ++ src/core/kernel/resource_limits.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/memory.hpp b/include/memory.hpp index 06b0c54f..94d821ff 100644 --- a/include/memory.hpp +++ b/include/memory.hpp @@ -224,6 +224,8 @@ public: return fcramApplicationSize; } + u32 getTotalAppFcramSize() { return fcramApplicationSize; } + enum class BatteryLevel { Empty = 0, AlmostEmpty, OneBar, TwoBars, ThreeBars, FourBars }; diff --git a/src/core/kernel/resource_limits.cpp b/src/core/kernel/resource_limits.cpp index 014787c7..f6f89fb4 100644 --- a/src/core/kernel/resource_limits.cpp +++ b/src/core/kernel/resource_limits.cpp @@ -88,7 +88,7 @@ s32 Kernel::getCurrentResourceValue(const KernelObject* limit, u32 resourceName) u32 Kernel::getMaxForResource(const KernelObject* limit, u32 resourceName) { switch (resourceName) { - case ResourceType::Commit: return appResourceLimits.maxCommit; + case ResourceType::Commit: return mem.getTotalAppFcramSize(); case ResourceType::Thread: return appResourceLimits.maxThreads; default: Helpers::panic("Attempted to get the max of unknown kernel resource: %d\n", resourceName); }