kern: support null resource limit in KSecureSystemResource

This commit is contained in:
Michael Scire 2025-04-30 20:24:22 -07:00 committed by SciresM
parent 2e204ccbaf
commit 86e4bed056
2 changed files with 15 additions and 6 deletions

View file

@ -94,7 +94,11 @@ namespace ams::kern {
static void PostDestroy(uintptr_t arg) { MESOSPHERE_UNUSED(arg); /* ... */ }
ALWAYS_INLINE size_t CalculateRequiredSecureMemorySize() const {
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
if (m_resource_limit != nullptr) {
return CalculateRequiredSecureMemorySize(m_resource_size, m_resource_pool);
} else {
return 0;
}
}
ALWAYS_INLINE size_t GetSize() const { return m_resource_size; }