diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-01 20:56:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-01 20:56:31 +0100 |
commit | aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c (patch) | |
tree | 3f7ca8e93b7bc523b8dd357ec43d302fd794b37c /src/core/hle/kernel | |
parent | Merge pull request #12466 from liamwhite/sh2 (diff) | |
parent | core_timing: block advance thread while clearing and signal after (diff) | |
download | yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar.gz yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar.bz2 yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar.lz yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar.xz yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.tar.zst yuzu-aa9ff2ffc2d9c3c1b7d6f4f6a7170acda7e17e9c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_hardware_timer.cpp | 19 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/core/hle/kernel/k_hardware_timer.cpp b/src/core/hle/kernel/k_hardware_timer.cpp index 8e2e40307..4e947dd6b 100644 --- a/src/core/hle/kernel/k_hardware_timer.cpp +++ b/src/core/hle/kernel/k_hardware_timer.cpp @@ -10,15 +10,15 @@ namespace Kernel { void KHardwareTimer::Initialize() { // Create the timing callback to register with CoreTiming. - m_event_type = Core::Timing::CreateEvent( - "KHardwareTimer::Callback", [](std::uintptr_t timer_handle, s64, std::chrono::nanoseconds) { - reinterpret_cast<KHardwareTimer*>(timer_handle)->DoTask(); - return std::nullopt; - }); + m_event_type = Core::Timing::CreateEvent("KHardwareTimer::Callback", + [this](s64, std::chrono::nanoseconds) { + this->DoTask(); + return std::nullopt; + }); } void KHardwareTimer::Finalize() { - m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type, reinterpret_cast<uintptr_t>(this)); + m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type); m_wakeup_time = std::numeric_limits<s64>::max(); m_event_type.reset(); } @@ -57,13 +57,12 @@ void KHardwareTimer::EnableInterrupt(s64 wakeup_time) { m_wakeup_time = wakeup_time; m_kernel.System().CoreTiming().ScheduleEvent(std::chrono::nanoseconds{m_wakeup_time}, - m_event_type, reinterpret_cast<uintptr_t>(this), - true); + m_event_type, true); } void KHardwareTimer::DisableInterrupt() { - m_kernel.System().CoreTiming().UnscheduleEventWithoutWait(m_event_type, - reinterpret_cast<uintptr_t>(this)); + m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type, + Core::Timing::UnscheduleEventType::NoWait); m_wakeup_time = std::numeric_limits<s64>::max(); } diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index c14d2d2f3..1030f0c12 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -238,7 +238,7 @@ struct KernelCore::Impl { void InitializePreemption(KernelCore& kernel) { preemption_event = Core::Timing::CreateEvent( "PreemptionCallback", - [this, &kernel](std::uintptr_t, s64 time, + [this, &kernel](s64 time, std::chrono::nanoseconds) -> std::optional<std::chrono::nanoseconds> { { KScopedSchedulerLock lock(kernel); |