summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-07-16 19:28:10 +0200
committerLioncash <mathew1800@gmail.com>2020-07-16 19:30:56 +0200
commitf0125b2be8ba34aaf07b8c9d04b866d29ceea53a (patch)
treec9fd8ce00f4ff0fbec3c5767db1dad5d22327085
parentcpu_manager: Remove unused preemption_count variable (diff)
downloadyuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar.gz
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar.bz2
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar.lz
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar.xz
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.tar.zst
yuzu-f0125b2be8ba34aaf07b8c9d04b866d29ceea53a.zip
-rw-r--r--src/core/cpu_manager.h6
-rw-r--r--src/core/hle/kernel/kernel.cpp11
-rw-r--r--src/core/hle/kernel/scheduler.cpp2
-rw-r--r--src/core/hle/kernel/thread.cpp2
4 files changed, 11 insertions, 10 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 33fb43cfa..17420c941 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -49,9 +49,9 @@ public:
void Pause(bool paused);
- std::function<void(void*)> GetGuestThreadStartFunc();
- std::function<void(void*)> GetIdleThreadStartFunc();
- std::function<void(void*)> GetSuspendThreadStartFunc();
+ static std::function<void(void*)> GetGuestThreadStartFunc();
+ static std::function<void(void*)> GetIdleThreadStartFunc();
+ static std::function<void(void*)> GetSuspendThreadStartFunc();
void* GetStartFuncParamater();
void PreemptSingleCore(bool from_running_enviroment = true);
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 {
void InitializeSuspendThreads() {
for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
std::string name = "Suspend Thread Id:" + std::to_string(i);
- std::function<void(void*)> init_func =
- system.GetCpuManager().GetSuspendThreadStartFunc();
+ std::function<void(void*)> init_func = Core::CpuManager::GetSuspendThreadStartFunc();
void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
- ThreadType type =
+ const auto type =
static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_SUSPEND);
- auto thread_res = Thread::Create(system, type, name, 0, 0, 0, static_cast<u32>(i), 0,
- nullptr, std::move(init_func), init_func_parameter);
+ auto thread_res =
+ Thread::Create(system, type, std::move(name), 0, 0, 0, static_cast<u32>(i), 0,
+ nullptr, std::move(init_func), init_func_parameter);
+
suspend_threads[i] = std::move(thread_res).Unwrap();
}
}
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) {
void Scheduler::Initialize() {
std::string name = "Idle Thread Id:" + std::to_string(core_id);
- std::function<void(void*)> init_func = system.GetCpuManager().GetIdleThreadStartFunc();
+ std::function<void(void*)> init_func = Core::CpuManager::GetIdleThreadStartFunc();
void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
ThreadType type = static_cast<ThreadType>(THREADTYPE_KERNEL | THREADTYPE_HLE | THREADTYPE_IDLE);
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
std::string name, VAddr entry_point, u32 priority,
u64 arg, s32 processor_id, VAddr stack_top,
Process* owner_process) {
- std::function<void(void*)> init_func = system.GetCpuManager().GetGuestThreadStartFunc();
+ std::function<void(void*)> init_func = Core::CpuManager::GetGuestThreadStartFunc();
void* init_func_parameter = system.GetCpuManager().GetStartFuncParamater();
return Create(system, type_flags, name, entry_point, priority, arg, processor_id, stack_top,
owner_process, std::move(init_func), init_func_parameter);