diff options
| author | 2021-11-26 15:10:21 -0800 | |
|---|---|---|
| committer | 2021-12-06 16:39:18 -0800 | |
| commit | 0d9afdedc4ef9c0861739b04fc9a53926305e1f3 (patch) | |
| tree | 58438353898e08ea00ce5cfb3e5a4abcf0f2fb6c /src/core | |
| parent | hle: kernel: fix timing on thread preemption (diff) | |
| download | yuzu-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.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_thread.h | 1 |
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 | ||
| 250 | ResultCode KThread::InitializeDummyThread(KThread* thread) { | 252 | ResultCode KThread::InitializeDummyThread(KThread* thread) { |
| 251 | return thread->Initialize({}, {}, {}, DefaultThreadPriority, 3, {}, ThreadType::Main); | 253 | return thread->Initialize({}, {}, {}, DefaultThreadPriority, 3, {}, ThreadType::Dummy); |
| 252 | } | 254 | } |
| 253 | 255 | ||
| 254 | ResultCode KThread::InitializeIdleThread(Core::System& system, KThread* thread, s32 virt_core) { | 256 | ResultCode 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 | }; |
| 52 | DECLARE_ENUM_FLAG_OPERATORS(ThreadType); | 53 | DECLARE_ENUM_FLAG_OPERATORS(ThreadType); |
| 53 | 54 | ||