ams: centralize system thread definitions
This commit is contained in:
@@ -34,8 +34,6 @@ namespace ams::erpt::srv {
|
||||
constexpr inline size_t ErrorReportContextSessions = 10;
|
||||
constexpr inline size_t ErrorReportMaxSessions = ErrorReportReportSessions + ErrorReportContextSessions;
|
||||
|
||||
constexpr inline s32 ErrorReportServerThreadPriority = 21;
|
||||
|
||||
constexpr inline sm::ServiceName ErrorReportContextServiceName = sm::ServiceName::Encode("erpt:c");
|
||||
constexpr inline sm::ServiceName ErrorReportReportServiceName = sm::ServiceName::Encode("erpt:r");
|
||||
|
||||
@@ -64,7 +62,8 @@ namespace ams::erpt::srv {
|
||||
|
||||
this->ResumeProcessing();
|
||||
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(this->thread), ThreadFunction, this, g_server_thread_stack, sizeof(g_server_thread_stack), ErrorReportServerThreadPriority));
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(this->thread), ThreadFunction, this, g_server_thread_stack, sizeof(g_server_thread_stack), AMS_GET_SYSTEM_THREAD_PRIORITY(erpt, IpcServer)));
|
||||
os::SetThreadNamePointer(std::addressof(this->thread), AMS_GET_SYSTEM_THREAD_NAME(erpt, IpcServer));
|
||||
|
||||
os::StartThread(std::addressof(this->thread));
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2020 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::fssystem {
|
||||
|
||||
s32 ScopedThreadPriorityChangerByAccessPriority::GetThreadPriorityByAccessPriority(AccessMode mode) {
|
||||
/* TODO: Actually implement this for real. */
|
||||
return os::GetThreadPriority(os::GetCurrentThread());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,7 +43,6 @@ namespace ams::pgl::srv {
|
||||
bool g_enable_jit_debug = false;
|
||||
|
||||
constexpr inline size_t ProcessControlTaskStackSize = 8_KB;
|
||||
constexpr inline s32 ProcessControlTaskPriority = 21;
|
||||
os::ThreadType g_process_control_task_thread;
|
||||
alignas(os::ThreadStackAlignment) u8 g_process_control_task_stack[ProcessControlTaskStackSize];
|
||||
|
||||
@@ -322,7 +321,8 @@ namespace ams::pgl::srv {
|
||||
|
||||
void InitializeProcessControlTask() {
|
||||
/* Create the task thread. */
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(g_process_control_task_thread), ProcessControlTask, nullptr, g_process_control_task_stack, sizeof(g_process_control_task_stack), ProcessControlTaskPriority));
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(g_process_control_task_thread), ProcessControlTask, nullptr, g_process_control_task_stack, sizeof(g_process_control_task_stack), AMS_GET_SYSTEM_THREAD_PRIORITY(pgl, ProcessControlTask)));
|
||||
os::SetThreadNamePointer(std::addressof(g_process_control_task_thread), AMS_GET_SYSTEM_THREAD_NAME(pgl, ProcessControlTask));
|
||||
|
||||
/* Retrieve settings. */
|
||||
settings::fwdbg::GetSettingsItemValue(std::addressof(g_enable_jit_debug), sizeof(g_enable_jit_debug), "jit_debug", "enable_jit_debug");
|
||||
|
||||
@@ -49,7 +49,6 @@ namespace ams::sf::hipc::impl {
|
||||
}
|
||||
|
||||
constexpr size_t QueryServerProcessThreadStackSize = 0x4000;
|
||||
constexpr s32 QueryServerProcessThreadPriority = -1;
|
||||
alignas(os::ThreadStackAlignment) u8 g_server_process_thread_stack[QueryServerProcessThreadStackSize];
|
||||
os::ThreadType g_query_server_process_thread;
|
||||
|
||||
@@ -70,7 +69,8 @@ namespace ams::sf::hipc::impl {
|
||||
R_ABORT_UNLESS(GetPointer(g_query_server_storage)->RegisterSession(query_handle, cmif::ServiceObjectHolder(std::make_shared<MitmQueryService>(query_func))));
|
||||
|
||||
if (AMS_UNLIKELY(!g_registered_any)) {
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(g_query_server_process_thread), &QueryServerProcessThreadMain, GetPointer(g_query_server_storage), g_server_process_thread_stack, sizeof(g_server_process_thread_stack), QueryServerProcessThreadPriority));
|
||||
R_ABORT_UNLESS(os::CreateThread(std::addressof(g_query_server_process_thread), &QueryServerProcessThreadMain, GetPointer(g_query_server_storage), g_server_process_thread_stack, sizeof(g_server_process_thread_stack), AMS_GET_SYSTEM_THREAD_PRIORITY(mitm_sf, QueryServerProcessThread)));
|
||||
os::SetThreadNamePointer(std::addressof(g_query_server_process_thread), AMS_GET_SYSTEM_THREAD_NAME(mitm_sf, QueryServerProcessThread));
|
||||
os::StartThread(std::addressof(g_query_server_process_thread));
|
||||
g_registered_any = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user