summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2021-11-26 15:10:21 -0800
committerGravatar bunnei2021-12-06 16:39:18 -0800
commit0d9afdedc4ef9c0861739b04fc9a53926305e1f3 (patch)
tree58438353898e08ea00ce5cfb3e5a4abcf0f2fb6c /src/core
parenthle: kernel: fix timing on thread preemption (diff)
downloadyuzu-0d9afdedc4ef9c0861739b04fc9a53926305e1f3.tar.gz
yuzu-0d9afdedc4ef9c0861739b04fc9a53926305e1f3.tar.xz
yuzu-0d9afdedc4ef9c0861739b04fc9a53926305e1f3.zip
hle: kernel: k_thread: Treat dummy threads as a special type.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/k_thread.cpp4
-rw-r--r--src/core/hle/kernel/k_thread.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index f69978caf..334487d8a 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -113,6 +113,8 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s
113 [[fallthrough]]; 113 [[fallthrough]];
114 case ThreadType::HighPriority: 114 case ThreadType::HighPriority:
115 [[fallthrough]]; 115 [[fallthrough]];
116 case ThreadType::Dummy:
117 [[fallthrough]];
116 case ThreadType::User: 118 case ThreadType::User:
117 ASSERT(((owner == nullptr) || 119 ASSERT(((owner == nullptr) ||
118 (owner->GetCoreMask() | (1ULL << virt_core)) == owner->GetCoreMask())); 120 (owner->GetCoreMask() | (1ULL << virt_core)) == owner->GetCoreMask()));
@@ -248,7 +250,7 @@ ResultCode KThread::InitializeThread(KThread* thread, KThreadFunction func, uint
248} 250}
249 251
250ResultCode KThread::InitializeDummyThread(KThread* thread) { 252ResultCode KThread::InitializeDummyThread(KThread* thread) {
251 return thread->Initialize({}, {}, {}, DefaultThreadPriority, 3, {}, ThreadType::Main); 253 return thread->Initialize({}, {}, {}, DefaultThreadPriority, 3, {}, ThreadType::Dummy);
252} 254}
253 255
254ResultCode KThread::InitializeIdleThread(Core::System& system, KThread* thread, s32 virt_core) { 256ResultCode KThread::InitializeIdleThread(Core::System& system, KThread* thread, s32 virt_core) {
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h
index be1bc59ae..94b87bef1 100644
--- a/src/core/hle/kernel/k_thread.h
+++ b/src/core/hle/kernel/k_thread.h
@@ -48,6 +48,7 @@ enum class ThreadType : u32 {
48 Kernel = 1, 48 Kernel = 1,
49 HighPriority = 2, 49 HighPriority = 2,
50 User = 3, 50 User = 3,
51 Dummy = 100, // Special thread type for emulation purposes only
51}; 52};
52DECLARE_ENUM_FLAG_OPERATORS(ThreadType); 53DECLARE_ENUM_FLAG_OPERATORS(ThreadType);
53 54