summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-10-12 07:57:32 -0400
committerGravatar FernandoS272019-10-15 11:55:22 -0400
commit0b72b34d89d8e3dd06fadfded728f7202bc34741 (patch)
treed834a6b0c899ad7f34e4abcd55aaa797cf9cb877
parentKernel: Correct Paused scheduling (diff)
downloadyuzu-0b72b34d89d8e3dd06fadfded728f7202bc34741.tar.gz
yuzu-0b72b34d89d8e3dd06fadfded728f7202bc34741.tar.xz
yuzu-0b72b34d89d8e3dd06fadfded728f7202bc34741.zip
KernelSVC: Assert that condition variable address is aligned to 4 bytes.
-rw-r--r--src/core/hle/kernel/svc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 101f72b7d..151acf33a 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1608,6 +1608,8 @@ static ResultCode WaitProcessWideKeyAtomic(Core::System& system, VAddr mutex_add
1608 return ERR_INVALID_ADDRESS; 1608 return ERR_INVALID_ADDRESS;
1609 } 1609 }
1610 1610
1611 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4));
1612
1611 auto* const current_process = system.Kernel().CurrentProcess(); 1613 auto* const current_process = system.Kernel().CurrentProcess();
1612 const auto& handle_table = current_process->GetHandleTable(); 1614 const auto& handle_table = current_process->GetHandleTable();
1613 SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 1615 SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
@@ -1639,6 +1641,8 @@ static ResultCode SignalProcessWideKey(Core::System& system, VAddr condition_var
1639 LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}", 1641 LOG_TRACE(Kernel_SVC, "called, condition_variable_addr=0x{:X}, target=0x{:08X}",
1640 condition_variable_addr, target); 1642 condition_variable_addr, target);
1641 1643
1644 ASSERT(condition_variable_addr == Common::AlignDown(condition_variable_addr, 4));
1645
1642 // Retrieve a list of all threads that are waiting for this condition variable. 1646 // Retrieve a list of all threads that are waiting for this condition variable.
1643 std::vector<SharedPtr<Thread>> waiting_threads; 1647 std::vector<SharedPtr<Thread>> waiting_threads;
1644 const auto& scheduler = system.GlobalScheduler(); 1648 const auto& scheduler = system.GlobalScheduler();