summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/event.cpp15
-rw-r--r--src/core/hle/kernel/event.h2
-rw-r--r--src/core/hle/kernel/kernel.h2
-rw-r--r--src/core/hle/kernel/timer.cpp12
-rw-r--r--src/core/hle/kernel/timer.h2
5 files changed, 20 insertions, 13 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index e1f42af05..23f9df0d6 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -22,11 +22,6 @@ SharedPtr<Event> Event::Create(ResetType reset_type, std::string name) {
22 evt->reset_type = reset_type; 22 evt->reset_type = reset_type;
23 evt->name = std::move(name); 23 evt->name = std::move(name);
24 24
25 if (reset_type == ResetType::Pulse) {
26 LOG_ERROR(Kernel, "Unimplemented event reset type Pulse");
27 UNIMPLEMENTED();
28 }
29
30 return evt; 25 return evt;
31} 26}
32 27
@@ -37,8 +32,7 @@ bool Event::ShouldWait(Thread* thread) const {
37void Event::Acquire(Thread* thread) { 32void Event::Acquire(Thread* thread) {
38 ASSERT_MSG(!ShouldWait(thread), "object unavailable!"); 33 ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
39 34
40 // Release the event if it's not sticky... 35 if (reset_type == ResetType::OneShot)
41 if (reset_type != ResetType::Sticky)
42 signaled = false; 36 signaled = false;
43} 37}
44 38
@@ -51,4 +45,11 @@ void Event::Clear() {
51 signaled = false; 45 signaled = false;
52} 46}
53 47
48void Event::WakeupAllWaitingThreads() {
49 WaitObject::WakeupAllWaitingThreads();
50
51 if (reset_type == ResetType::Pulse)
52 signaled = false;
53}
54
54} // namespace 55} // namespace
diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h
index 39452bf33..3e3673508 100644
--- a/src/core/hle/kernel/event.h
+++ b/src/core/hle/kernel/event.h
@@ -38,6 +38,8 @@ public:
38 bool ShouldWait(Thread* thread) const override; 38 bool ShouldWait(Thread* thread) const override;
39 void Acquire(Thread* thread) override; 39 void Acquire(Thread* thread) override;
40 40
41 void WakeupAllWaitingThreads() override;
42
41 void Signal(); 43 void Signal();
42 void Clear(); 44 void Clear();
43 45
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 05097824b..bb8b99bb5 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -157,7 +157,7 @@ public:
157 * Wake up all threads waiting on this object that can be awoken, in priority order, 157 * Wake up all threads waiting on this object that can be awoken, in priority order,
158 * and set the synchronization result and output of the thread. 158 * and set the synchronization result and output of the thread.
159 */ 159 */
160 void WakeupAllWaitingThreads(); 160 virtual void WakeupAllWaitingThreads();
161 161
162 /// Obtains the highest priority thread that is ready to run from this object's waiting list. 162 /// Obtains the highest priority thread that is ready to run from this object's waiting list.
163 SharedPtr<Thread> GetHighestPriorityReadyThread(); 163 SharedPtr<Thread> GetHighestPriorityReadyThread();
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp
index 8f2bc4c7f..60537f355 100644
--- a/src/core/hle/kernel/timer.cpp
+++ b/src/core/hle/kernel/timer.cpp
@@ -31,11 +31,6 @@ SharedPtr<Timer> Timer::Create(ResetType reset_type, std::string name) {
31 timer->interval_delay = 0; 31 timer->interval_delay = 0;
32 timer->callback_handle = timer_callback_handle_table.Create(timer).MoveFrom(); 32 timer->callback_handle = timer_callback_handle_table.Create(timer).MoveFrom();
33 33
34 if (reset_type == ResetType::Pulse) {
35 LOG_ERROR(Kernel, "Unimplemented timer reset type Pulse");
36 UNIMPLEMENTED();
37 }
38
39 return timer; 34 return timer;
40} 35}
41 36
@@ -70,6 +65,13 @@ void Timer::Clear() {
70 signaled = false; 65 signaled = false;
71} 66}
72 67
68void Timer::WakeupAllWaitingThreads() {
69 WaitObject::WakeupAllWaitingThreads();
70
71 if (reset_type == ResetType::Pulse)
72 signaled = false;
73}
74
73/// The timer callback event, called when a timer is fired 75/// The timer callback event, called when a timer is fired
74static void TimerCallback(u64 timer_handle, int cycles_late) { 76static void TimerCallback(u64 timer_handle, int cycles_late) {
75 SharedPtr<Timer> timer = 77 SharedPtr<Timer> timer =
diff --git a/src/core/hle/kernel/timer.h b/src/core/hle/kernel/timer.h
index 2e3b31b23..c174f5664 100644
--- a/src/core/hle/kernel/timer.h
+++ b/src/core/hle/kernel/timer.h
@@ -42,6 +42,8 @@ public:
42 bool ShouldWait(Thread* thread) const override; 42 bool ShouldWait(Thread* thread) const override;
43 void Acquire(Thread* thread) override; 43 void Acquire(Thread* thread) override;
44 44
45 void WakeupAllWaitingThreads() override;
46
45 /** 47 /**
46 * Starts the timer, with the specified initial delay and interval. 48 * Starts the timer, with the specified initial delay and interval.
47 * @param initial Delay until the timer is first fired 49 * @param initial Delay until the timer is first fired