summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_hardware_timer.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-12-18 22:50:02 +0100
committerLiam <byteslice@airmail.cc>2022-12-19 02:21:24 +0100
commitc770f25ccb4755f6a6861037fbfdfdac55191348 (patch)
treeeccc5140afa7a979800e8c27c1f4a2847adb283f /src/core/hle/kernel/k_hardware_timer.h
parentkernel: add KHardwareTimer (diff)
downloadyuzu-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.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_hardware_timer.h b/src/core/hle/kernel/k_hardware_timer.h
index 2c88876b3..00bef6ea1 100644
--- a/src/core/hle/kernel/k_hardware_timer.h
+++ b/src/core/hle/kernel/k_hardware_timer.h
@@ -19,10 +19,14 @@ public:
void Initialize();
void Finalize();
- s64 GetCount() {
+ s64 GetCount() const {
return GetTick();
}
+ void RegisterTask(KTimerTask* task, s64 time_from_now) {
+ this->RegisterAbsoluteTask(task, GetTick() + time_from_now);
+ }
+
void RegisterAbsoluteTask(KTimerTask* task, s64 task_time) {
KScopedDisableDispatch dd{m_kernel};
KScopedSpinLock lk{this->GetLock()};
@@ -38,7 +42,7 @@ private:
void EnableInterrupt(s64 wakeup_time);
void DisableInterrupt();
bool GetInterruptEnabled();
- s64 GetTick();
+ s64 GetTick() const;
void DoTask();
private: