summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/k_hardware_timer.cpp19
-rw-r--r--src/core/hle/kernel/kernel.cpp2
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 {
10 10
11void KHardwareTimer::Initialize() { 11void KHardwareTimer::Initialize() {
12 // Create the timing callback to register with CoreTiming. 12 // Create the timing callback to register with CoreTiming.
13 m_event_type = Core::Timing::CreateEvent( 13 m_event_type = Core::Timing::CreateEvent("KHardwareTimer::Callback",
14 "KHardwareTimer::Callback", [](std::uintptr_t timer_handle, s64, std::chrono::nanoseconds) { 14 [this](s64, std::chrono::nanoseconds) {
15 reinterpret_cast<KHardwareTimer*>(timer_handle)->DoTask(); 15 this->DoTask();
16 return std::nullopt; 16 return std::nullopt;
17 }); 17 });
18} 18}
19 19
20void KHardwareTimer::Finalize() { 20void KHardwareTimer::Finalize() {
21 m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type, reinterpret_cast<uintptr_t>(this)); 21 m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type);
22 m_wakeup_time = std::numeric_limits<s64>::max(); 22 m_wakeup_time = std::numeric_limits<s64>::max();
23 m_event_type.reset(); 23 m_event_type.reset();
24} 24}
@@ -57,13 +57,12 @@ void KHardwareTimer::EnableInterrupt(s64 wakeup_time) {
57 57
58 m_wakeup_time = wakeup_time; 58 m_wakeup_time = wakeup_time;
59 m_kernel.System().CoreTiming().ScheduleEvent(std::chrono::nanoseconds{m_wakeup_time}, 59 m_kernel.System().CoreTiming().ScheduleEvent(std::chrono::nanoseconds{m_wakeup_time},
60 m_event_type, reinterpret_cast<uintptr_t>(this), 60 m_event_type, true);
61 true);
62} 61}
63 62
64void KHardwareTimer::DisableInterrupt() { 63void KHardwareTimer::DisableInterrupt() {
65 m_kernel.System().CoreTiming().UnscheduleEventWithoutWait(m_event_type, 64 m_kernel.System().CoreTiming().UnscheduleEvent(m_event_type,
66 reinterpret_cast<uintptr_t>(this)); 65 Core::Timing::UnscheduleEventType::NoWait);
67 m_wakeup_time = std::numeric_limits<s64>::max(); 66 m_wakeup_time = std::numeric_limits<s64>::max();
68} 67}
69 68
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 {
238 void InitializePreemption(KernelCore& kernel) { 238 void InitializePreemption(KernelCore& kernel) {
239 preemption_event = Core::Timing::CreateEvent( 239 preemption_event = Core::Timing::CreateEvent(
240 "PreemptionCallback", 240 "PreemptionCallback",
241 [this, &kernel](std::uintptr_t, s64 time, 241 [this, &kernel](s64 time,
242 std::chrono::nanoseconds) -> std::optional<std::chrono::nanoseconds> { 242 std::chrono::nanoseconds) -> std::optional<std::chrono::nanoseconds> {
243 { 243 {
244 KScopedSchedulerLock lock(kernel); 244 KScopedSchedulerLock lock(kernel);