summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-12-28 13:16:43 -0800
committerGravatar bunnei2021-01-11 14:23:16 -0800
commitc3c43e32fcf198444acb493483e03fcb193156df (patch)
treea516e116d7dbb9309b0adbfa2e3660861ff4e6b7 /src/core/hle/kernel/svc.cpp
parentcore: hle: kernel: Add some useful functions for checking kernel addresses. (diff)
downloadyuzu-c3c43e32fcf198444acb493483e03fcb193156df.tar.gz
yuzu-c3c43e32fcf198444acb493483e03fcb193156df.tar.xz
yuzu-c3c43e32fcf198444acb493483e03fcb193156df.zip
hle: kernel: thread: Replace ThreadStatus/ThreadSchedStatus with a single ThreadState.
- This is how the real kernel works, and is more accurate and simpler.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 0a3064c7d..304b8727d 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -343,7 +343,7 @@ static ResultCode SendSyncRequest(Core::System& system, Handle handle) {
343 auto thread = kernel.CurrentScheduler()->GetCurrentThread(); 343 auto thread = kernel.CurrentScheduler()->GetCurrentThread();
344 { 344 {
345 KScopedSchedulerLock lock(kernel); 345 KScopedSchedulerLock lock(kernel);
346 thread->SetState(ThreadStatus::WaitIPC); 346 thread->SetState(ThreadState::Waiting);
347 session->SendSyncRequest(SharedFrom(thread), system.Memory(), system.CoreTiming()); 347 session->SendSyncRequest(SharedFrom(thread), system.Memory(), system.CoreTiming());
348 } 348 }
349 349
@@ -1546,7 +1546,7 @@ static ResultCode StartThread(Core::System& system, Handle thread_handle) {
1546 return ERR_INVALID_HANDLE; 1546 return ERR_INVALID_HANDLE;
1547 } 1547 }
1548 1548
1549 ASSERT(thread->GetStatus() == ThreadStatus::Dormant); 1549 ASSERT(thread->GetState() == ThreadState::Initialized);
1550 1550
1551 return thread->Start(); 1551 return thread->Start();
1552} 1552}
@@ -1661,7 +1661,8 @@ static ResultCode WaitProcessWideKeyAtomic(Core::System& system, VAddr mutex_add
1661 current_thread->SetCondVarWaitAddress(condition_variable_addr); 1661 current_thread->SetCondVarWaitAddress(condition_variable_addr);
1662 current_thread->SetMutexWaitAddress(mutex_addr); 1662 current_thread->SetMutexWaitAddress(mutex_addr);
1663 current_thread->SetWaitHandle(thread_handle); 1663 current_thread->SetWaitHandle(thread_handle);
1664 current_thread->SetState(ThreadStatus::WaitCondVar); 1664 current_thread->SetState(ThreadState::Waiting);
1665 current_thread->SetWaitingCondVar(true);
1665 current_process->InsertConditionVariableThread(SharedFrom(current_thread)); 1666 current_process->InsertConditionVariableThread(SharedFrom(current_thread));
1666 } 1667 }
1667 1668
@@ -1755,9 +1756,7 @@ static void SignalProcessWideKey(Core::System& system, VAddr condition_variable_
1755 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 1756 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
1756 auto owner = handle_table.Get<Thread>(owner_handle); 1757 auto owner = handle_table.Get<Thread>(owner_handle);
1757 ASSERT(owner); 1758 ASSERT(owner);
1758 if (thread->GetStatus() == ThreadStatus::WaitCondVar) { 1759 thread->SetWaitingCondVar(false);
1759 thread->SetState(ThreadStatus::WaitMutex);
1760 }
1761 1760
1762 owner->AddMutexWaiter(thread); 1761 owner->AddMutexWaiter(thread);
1763 } 1762 }