summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/timer.cpp
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-09-18 02:38:01 +0200
commitdc8479928c5aee4c6ad6fe4f59006fb604cee701 (patch)
tree569a7f13128450bbab973236615587ff00bced5f /src/core/hle/kernel/timer.cpp
parentTravis: Import Dolphin’s clang-format hook. (diff)
downloadyuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.gz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.bz2
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.lz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.xz
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.tar.zst
yuzu-dc8479928c5aee4c6ad6fe4f59006fb604cee701.zip
Diffstat (limited to 'src/core/hle/kernel/timer.cpp')
-rw-r--r--src/core/hle/kernel/timer.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index b8daaeede..255cb1aca 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -9,8 +9,8 @@
#include "core/core_timing.h"
#include "core/hle/kernel/kernel.h"
-#include "core/hle/kernel/timer.h"
#include "core/hle/kernel/thread.h"
+#include "core/hle/kernel/timer.h"
namespace Kernel {
@@ -20,8 +20,10 @@ static int timer_callback_event_type;
// us to simply use a pool index or similar.
static Kernel::HandleTable timer_callback_handle_table;
-Timer::Timer() {}
-Timer::~Timer() {}
+Timer::Timer() {
+}
+Timer::~Timer() {
+}
SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) {
SharedPtr<Timer> timer(new Timer);
@@ -41,7 +43,7 @@ bool Timer::ShouldWait() {
}
void Timer::Acquire() {
- ASSERT_MSG( !ShouldWait(), "object unavailable!");
+ ASSERT_MSG(!ShouldWait(), "object unavailable!");
if (reset_type == ResetType::OneShot)
signaled = false;
@@ -55,8 +57,8 @@ void Timer::Set(s64 initial, s64 interval) {
interval_delay = interval;
u64 initial_microseconds = initial / 1000;
- CoreTiming::ScheduleEvent(usToCycles(initial_microseconds),
- timer_callback_event_type, callback_handle);
+ CoreTiming::ScheduleEvent(usToCycles(initial_microseconds), timer_callback_event_type,
+ callback_handle);
HLE::Reschedule(__func__);
}
@@ -73,7 +75,8 @@ void Timer::Clear() {
/// The timer callback event, called when a timer is fired
static void TimerCallback(u64 timer_handle, int cycles_late) {
- SharedPtr<Timer> timer = timer_callback_handle_table.Get<Timer>(static_cast<Handle>(timer_handle));
+ SharedPtr<Timer> timer =
+ timer_callback_handle_table.Get<Timer>(static_cast<Handle>(timer_handle));
if (timer == nullptr) {
LOG_CRITICAL(Kernel, "Callback fired for invalid timer %08" PRIx64, timer_handle);
@@ -91,7 +94,7 @@ static void TimerCallback(u64 timer_handle, int cycles_late) {
// Reschedule the timer with the interval delay
u64 interval_microseconds = timer->interval_delay / 1000;
CoreTiming::ScheduleEvent(usToCycles(interval_microseconds) - cycles_late,
- timer_callback_event_type, timer_handle);
+ timer_callback_event_type, timer_handle);
}
}