summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/cpu_manager.h10
-rw-r--r--src/core/hle/kernel/kernel.cpp11
-rw-r--r--src/core/hle/kernel/kernel.h1
-rw-r--r--src/core/hle/kernel/scheduler.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp2
5 files changed, 15 insertions, 11 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 35929ed94..17420c941 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -9,6 +9,9 @@
9#include <functional> 9#include <functional>
10#include <memory> 10#include <memory>
11#include <thread> 11#include <thread>
12
13#include "common/fiber.h"
14#include "common/thread.h"
12#include "core/hardware_properties.h" 15#include "core/hardware_properties.h"
13 16
14namespace Common { 17namespace Common {
@@ -46,9 +49,9 @@ public:
46 49
47 void Pause(bool paused); 50 void Pause(bool paused);
48 51
49 std::function<void(void*)> GetGuestThreadStartFunc(); 52 static std::function<void(void*)> GetGuestThreadStartFunc();
50 std::function<void(void*)> GetIdleThreadStartFunc(); 53 static std::function<void(void*)> GetIdleThreadStartFunc();
51 std::function<void(void*)> GetSuspendThreadStartFunc(); 54 static std::function<void(void*)> GetSuspendThreadStartFunc();
52 void* GetStartFuncParamater(); 55 void* GetStartFuncParamater();
53 56
54 void PreemptSingleCore(bool from_running_enviroment = true); 57 void PreemptSingleCore(bool from_running_enviroment = true);
@@ -97,7 +100,6 @@ private:
97 bool is_async_gpu{}; 100 bool is_async_gpu{};
98 bool is_multicore{}; 101 bool is_multicore{};
99 std::atomic<std::size_t> current_core{}; 102 std::atomic<std::size_t> current_core{};
100 std::size_t preemption_count{};
101 std::size_t idle_count{}; 103 std::size_t idle_count{};
102 static constexpr std::size_t max_cycle_runs = 5; 104 static constexpr std::size_t max_cycle_runs = 5;
103 105
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 6e2014e08..e1c7a0f3b 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -161,13 +161,14 @@ struct KernelCore::Impl {
161 void InitializeSuspendThreads() { 161 void InitializeSuspendThreads() {
162 for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { 162 for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
163 std::string name = "Suspend Thread Id:" + std::to_string(i); 163 std::string name = "Suspend Thread Id:" + std::to_string(i);
164 std::function<void(void*)> init_func = 164 std::function<void(void*)> init_func = Core::CpuManager::GetSuspendThreadStartFunc();
165 system.GetCpuManager().GetSuspendThreadStartFunc();
166 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater(); 165 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
167 ThreadType type = 166 const auto type =
168 static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_SUSPEND); 167 static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_SUSPEND);
169 auto thread_res = Thread::Create(system, type, name, 0, 0, 0, static_cast<u32>(i), 0, 168 auto thread_res =
170 nullptr, std::move(init_func), init_func_parameter); 169 Thread::Create(system, type, std::move(name), 0, 0, 0, static_cast<u32>(i), 0,
170 nullptr, std::move(init_func), init_func_parameter);
171
171 suspend_threads[i] = std::move(thread_res).Unwrap(); 172 suspend_threads[i] = std::move(thread_res).Unwrap();
172 } 173 }
173 } 174 }
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 49bd47e89..16285c3f0 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -9,6 +9,7 @@
9#include <string> 9#include <string>
10#include <unordered_map> 10#include <unordered_map>
11#include <vector> 11#include <vector>
12#include "core/arm/cpu_interrupt_handler.h"
12#include "core/hardware_properties.h" 13#include "core/hardware_properties.h"
13#include "core/hle/kernel/memory/memory_types.h" 14#include "core/hle/kernel/memory/memory_types.h"
14#include "core/hle/kernel/object.h" 15#include "core/hle/kernel/object.h"
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 7b929781c..f93e5e4b0 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -802,7 +802,7 @@ void Scheduler::UpdateLastContextSwitchTime(Thread* thread, Process* process) {
802 802
803void Scheduler::Initialize() { 803void Scheduler::Initialize() {
804 std::string name = "Idle Thread Id:" + std::to_string(core_id); 804 std::string name = "Idle Thread Id:" + std::to_string(core_id);
805 std::function<void(void*)> init_func = system.GetCpuManager().GetIdleThreadStartFunc(); 805 std::function<void(void*)> init_func = Core::CpuManager::GetIdleThreadStartFunc();
806 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater(); 806 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
807 ThreadType type = static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_IDLE); 807 ThreadType type = static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_IDLE);
808 auto thread_res = Thread::Create(system, type, name, 0, 64, 0, static_cast<u32>(core_id), 0, 808 auto thread_res = Thread::Create(system, type, name, 0, 64, 0, static_cast<u32>(core_id), 0,
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 67148fa6d..d132aba34 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -155,7 +155,7 @@ ResultVal<std::shared_ptr<Thread>> Thread::Create(Core::System& system, ThreadTy
155 std::string name, VAddr entry_point, u32 priority, 155 std::string name, VAddr entry_point, u32 priority,
156 u64 arg, s32 processor_id, VAddr stack_top, 156 u64 arg, s32 processor_id, VAddr stack_top,
157 Process* owner_process) { 157 Process* owner_process) {
158 std::function<void(void*)> init_func = system.GetCpuManager().GetGuestThreadStartFunc(); 158 std::function<void(void*)> init_func = Core::CpuManager::GetGuestThreadStartFunc();
159 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater(); 159 void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
160 return Create(system, type_flags, name, entry_point, priority, arg, processor_id, stack_top, 160 return Create(system, type_flags, name, entry_point, priority, arg, processor_id, stack_top,
161 owner_process, std::move(init_func), init_func_parameter); 161 owner_process, std::move(init_func), init_func_parameter);