From 5d46038c5cd91504b00b76660212a3a28b244f38 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 19 Nov 2018 12:54:06 -0500 Subject: kernel/resource_limit: Clean up interface Cleans out the citra/3DS-specific implementation details that don't apply to the Switch. Sets the stage for implementing ResourceLimit instances properly. While we're at it, remove the erroneous checks within CreateThread() and SetThreadPriority(). While these are indeed checked in some capacity, they are not checked via a ResourceLimit instance. In the process of moving out Citra-specifics, this also replaces the system ResourceLimit instance's values with ones from the Switch. --- src/core/hle/kernel/svc.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/core/hle/kernel/svc.cpp') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 75dbfc31d..9904605cd 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -736,13 +736,6 @@ static ResultCode SetThreadPriority(Handle handle, u32 priority) { const auto* const current_process = Core::CurrentProcess(); - // Note: The kernel uses the current process's resource limit instead of - // the one from the thread owner's resource limit. - const ResourceLimit& resource_limit = current_process->GetResourceLimit(); - if (resource_limit.GetMaxResourceValue(ResourceType::Priority) > priority) { - return ERR_INVALID_THREAD_PRIORITY; - } - SharedPtr thread = current_process->GetHandleTable().Get(handle); if (!thread) { return ERR_INVALID_HANDLE; @@ -885,10 +878,6 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V } auto* const current_process = Core::CurrentProcess(); - const ResourceLimit& resource_limit = current_process->GetResourceLimit(); - if (resource_limit.GetMaxResourceValue(ResourceType::Priority) > priority) { - return ERR_INVALID_THREAD_PRIORITY; - } if (processor_id == THREADPROCESSORID_DEFAULT) { // Set the target CPU to the one specified in the process' exheader. -- cgit v1.2.3