From 252486913ba28903362f314ff38fda70751a648a Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 17 Sep 2021 16:20:55 -0700 Subject: [PATCH] kern: KWorkerTaskManager no longer tracks id --- .../include/mesosphere/kern_k_worker_task_manager.hpp | 5 ++--- .../libmesosphere/source/kern_k_worker_task_manager.cpp | 5 +---- libraries/libmesosphere/source/kern_main.cpp | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_worker_task_manager.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_worker_task_manager.hpp index 89d95493c..344ca4f0b 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_worker_task_manager.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_worker_task_manager.hpp @@ -33,7 +33,6 @@ namespace ams::kern { KWorkerTask *m_head_task; KWorkerTask *m_tail_task; KThread *m_thread; - WorkerType m_type; bool m_active; private: static void ThreadFunction(uintptr_t arg); @@ -42,9 +41,9 @@ namespace ams::kern { KWorkerTask *GetTask(); void AddTask(KWorkerTask *task); public: - constexpr KWorkerTaskManager() : m_head_task(), m_tail_task(), m_thread(), m_type(WorkerType_Count), m_active() { /* ... */ } + constexpr KWorkerTaskManager() : m_head_task(), m_tail_task(), m_thread(), m_active() { /* ... */ } - NOINLINE void Initialize(WorkerType wt, s32 priority); + NOINLINE void Initialize(s32 priority); static void AddTask(WorkerType type, KWorkerTask *task); }; diff --git a/libraries/libmesosphere/source/kern_k_worker_task_manager.cpp b/libraries/libmesosphere/source/kern_k_worker_task_manager.cpp index f525acd28..6b49b295f 100644 --- a/libraries/libmesosphere/source/kern_k_worker_task_manager.cpp +++ b/libraries/libmesosphere/source/kern_k_worker_task_manager.cpp @@ -17,10 +17,7 @@ namespace ams::kern { - void KWorkerTaskManager::Initialize(WorkerType wt, s32 priority) { - /* Set type, other members already initialized in constructor. */ - m_type = wt; - + void KWorkerTaskManager::Initialize(s32 priority) { /* Reserve a thread from the system limit. */ MESOSPHERE_ABORT_UNLESS(Kernel::GetSystemResourceLimit().Reserve(ams::svc::LimitableResource_ThreadCountMax, 1)); diff --git a/libraries/libmesosphere/source/kern_main.cpp b/libraries/libmesosphere/source/kern_main.cpp index 6450b0cac..8133dfd3f 100644 --- a/libraries/libmesosphere/source/kern_main.cpp +++ b/libraries/libmesosphere/source/kern_main.cpp @@ -117,7 +117,7 @@ namespace ams::kern { /* Perform more core-0 specific initialization. */ if (core_id == 0) { /* Initialize the exit worker manager, so that threads and processes may exit cleanly. */ - Kernel::GetWorkerTaskManager(KWorkerTaskManager::WorkerType_Exit).Initialize(KWorkerTaskManager::WorkerType_Exit, KWorkerTaskManager::ExitWorkerPriority); + Kernel::GetWorkerTaskManager(KWorkerTaskManager::WorkerType_Exit).Initialize(KWorkerTaskManager::ExitWorkerPriority); /* Setup so that we may sleep later, and reserve memory for secure applets. */ KSystemControl::InitializePhase2();