diff options
author | Liam <byteslice@airmail.cc> | 2022-12-18 22:50:02 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-12-19 02:21:24 +0100 |
commit | c770f25ccb4755f6a6861037fbfdfdac55191348 (patch) | |
tree | eccc5140afa7a979800e8c27c1f4a2847adb283f /src/core/hle/kernel/k_hardware_timer.cpp | |
parent | kernel: add KHardwareTimer (diff) | |
download | yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar.gz yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar.bz2 yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar.lz yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar.xz yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.tar.zst yuzu-c770f25ccb4755f6a6861037fbfdfdac55191348.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/k_hardware_timer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_hardware_timer.cpp b/src/core/hle/kernel/k_hardware_timer.cpp index afa777f9a..6bba79ea0 100644 --- a/src/core/hle/kernel/k_hardware_timer.cpp +++ b/src/core/hle/kernel/k_hardware_timer.cpp @@ -5,15 +5,13 @@ #include "core/core_timing.h" #include "core/hle/kernel/k_hardware_timer.h" #include "core/hle/kernel/k_scheduler.h" -#include "core/hle/kernel/time_manager.h" namespace Kernel { void KHardwareTimer::Initialize() { // Create the timing callback to register with CoreTiming. m_event_type = Core::Timing::CreateEvent( - "KHardwareTimer::Callback", - [this](std::uintptr_t timer_handle, s64, std::chrono::nanoseconds) { + "KHardwareTimer::Callback", [](std::uintptr_t timer_handle, s64, std::chrono::nanoseconds) { reinterpret_cast<KHardwareTimer*>(timer_handle)->DoTask(); return std::nullopt; }); @@ -21,6 +19,7 @@ void KHardwareTimer::Initialize() { void KHardwareTimer::Finalize() { this->DisableInterrupt(); + m_event_type.reset(); } void KHardwareTimer::DoTask() { @@ -64,7 +63,7 @@ void KHardwareTimer::DisableInterrupt() { m_wakeup_time = std::numeric_limits<s64>::max(); } -s64 KHardwareTimer::GetTick() { +s64 KHardwareTimer::GetTick() const { return m_kernel.System().CoreTiming().GetGlobalTimeNs().count(); } |