diff options
| author | 2020-02-11 10:46:25 -0400 | |
|---|---|---|
| committer | 2020-02-11 10:46:25 -0400 | |
| commit | c5aefe42aaec7afa29d317709cacc8524f7add20 (patch) | |
| tree | 5f9341ac7eb10d85b52c5a70e217f80963dc9e99 /src/core/hle/kernel/svc.cpp | |
| parent | Merge pull request #3372 from ReinUsesLisp/fix-back-stencil (diff) | |
| download | yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.tar.gz yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.tar.xz yuzu-c5aefe42aaec7afa29d317709cacc8524f7add20.zip | |
Kernel: Change WaitObject to Synchronization object. In order to better reflect RE.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 9cae5c73d..39552a176 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -435,7 +435,8 @@ static ResultCode GetProcessId(Core::System& system, u64* process_id, Handle han | |||
| 435 | 435 | ||
| 436 | /// Default thread wakeup callback for WaitSynchronization | 436 | /// Default thread wakeup callback for WaitSynchronization |
| 437 | static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, | 437 | static bool DefaultThreadWakeupCallback(ThreadWakeupReason reason, std::shared_ptr<Thread> thread, |
| 438 | std::shared_ptr<WaitObject> object, std::size_t index) { | 438 | std::shared_ptr<SynchronizationObject> object, |
| 439 | std::size_t index) { | ||
| 439 | ASSERT(thread->GetStatus() == ThreadStatus::WaitSynch); | 440 | ASSERT(thread->GetStatus() == ThreadStatus::WaitSynch); |
| 440 | 441 | ||
| 441 | if (reason == ThreadWakeupReason::Timeout) { | 442 | if (reason == ThreadWakeupReason::Timeout) { |
| @@ -473,13 +474,13 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr | |||
| 473 | 474 | ||
| 474 | auto* const thread = system.CurrentScheduler().GetCurrentThread(); | 475 | auto* const thread = system.CurrentScheduler().GetCurrentThread(); |
| 475 | 476 | ||
| 476 | using ObjectPtr = Thread::ThreadWaitObjects::value_type; | 477 | using ObjectPtr = Thread::ThreadSynchronizationObjects::value_type; |
| 477 | Thread::ThreadWaitObjects objects(handle_count); | 478 | Thread::ThreadSynchronizationObjects objects(handle_count); |
| 478 | const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); | 479 | const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); |
| 479 | 480 | ||
| 480 | for (u64 i = 0; i < handle_count; ++i) { | 481 | for (u64 i = 0; i < handle_count; ++i) { |
| 481 | const Handle handle = memory.Read32(handles_address + i * sizeof(Handle)); | 482 | const Handle handle = memory.Read32(handles_address + i * sizeof(Handle)); |
| 482 | const auto object = handle_table.Get<WaitObject>(handle); | 483 | const auto object = handle_table.Get<SynchronizationObject>(handle); |
| 483 | 484 | ||
| 484 | if (object == nullptr) { | 485 | if (object == nullptr) { |
| 485 | LOG_ERROR(Kernel_SVC, "Object is a nullptr"); | 486 | LOG_ERROR(Kernel_SVC, "Object is a nullptr"); |
| @@ -496,7 +497,7 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr | |||
| 496 | 497 | ||
| 497 | if (itr != objects.end()) { | 498 | if (itr != objects.end()) { |
| 498 | // We found a ready object, acquire it and set the result value | 499 | // We found a ready object, acquire it and set the result value |
| 499 | WaitObject* object = itr->get(); | 500 | SynchronizationObject* object = itr->get(); |
| 500 | object->Acquire(thread); | 501 | object->Acquire(thread); |
| 501 | *index = static_cast<s32>(std::distance(objects.begin(), itr)); | 502 | *index = static_cast<s32>(std::distance(objects.begin(), itr)); |
| 502 | return RESULT_SUCCESS; | 503 | return RESULT_SUCCESS; |
| @@ -519,7 +520,7 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr | |||
| 519 | object->AddWaitingThread(SharedFrom(thread)); | 520 | object->AddWaitingThread(SharedFrom(thread)); |
| 520 | } | 521 | } |
| 521 | 522 | ||
| 522 | thread->SetWaitObjects(std::move(objects)); | 523 | thread->SetSynchronizationObjects(std::move(objects)); |
| 523 | thread->SetStatus(ThreadStatus::WaitSynch); | 524 | thread->SetStatus(ThreadStatus::WaitSynch); |
| 524 | 525 | ||
| 525 | // Create an event to wake the thread up after the specified nanosecond delay has passed | 526 | // Create an event to wake the thread up after the specified nanosecond delay has passed |