summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2017-01-10 16:45:00 +0100
committerGitHub <noreply@github.com>2017-01-10 16:45:00 +0100
commit84d72fd92fcd737566efde0cb324c48dcd689997 (patch)
tree7b52cc1949f9dc89aaf8f338a4d29624ff82868e
parentMerge pull request #2418 from jroweboy/appveyor_master (diff)
parentKernel: Implemented Pulse event and timers. (diff)
downloadyuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar.gz
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar.bz2
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar.lz
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar.xz
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.tar.zst
yuzu-84d72fd92fcd737566efde0cb324c48dcd689997.zip
-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) {
evt->reset_type = reset_type;
evt->name = std::move(name);
- if (reset_type == ResetType::Pulse) {
- LOG_ERROR(Kernel, "Unimplemented event reset type Pulse");
- UNIMPLEMENTED();
- }
-
return evt;
}
@@ -37,8 +32,7 @@ bool Event::ShouldWait(Thread* thread) const {
void Event::Acquire(Thread* thread) {
ASSERT_MSG(!ShouldWait(thread), "object unavailable!");
- // Release the event if it's not sticky...
- if (reset_type != ResetType::Sticky)
+ if (reset_type == ResetType::OneShot)
signaled = false;
}
@@ -51,4 +45,11 @@ void Event::Clear() {
signaled = false;
}
+void Event::WakeupAllWaitingThreads() {
+ WaitObject::WakeupAllWaitingThreads();
+
+ if (reset_type == ResetType::Pulse)
+ signaled = false;
+}
+
} // 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:
bool ShouldWait(Thread* thread) const override;
void Acquire(Thread* thread) override;
+ void WakeupAllWaitingThreads() override;
+
void Signal();
void Clear();
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:
* Wake up all threads waiting on this object that can be awoken, in priority order,
* and set the synchronization result and output of the thread.
*/
- void WakeupAllWaitingThreads();
+ virtual void WakeupAllWaitingThreads();
/// Obtains the highest priority thread that is ready to run from this object's waiting list.
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) {
timer->interval_delay = 0;
timer->callback_handle = timer_callback_handle_table.Create(timer).MoveFrom();
- if (reset_type == ResetType::Pulse) {
- LOG_ERROR(Kernel, "Unimplemented timer reset type Pulse");
- UNIMPLEMENTED();
- }
-
return timer;
}
@@ -70,6 +65,13 @@ void Timer::Clear() {
signaled = false;
}
+void Timer::WakeupAllWaitingThreads() {
+ WaitObject::WakeupAllWaitingThreads();
+
+ if (reset_type == ResetType::Pulse)
+ signaled = false;
+}
+
/// The timer callback event, called when a timer is fired
static void TimerCallback(u64 timer_handle, int cycles_late) {
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:
bool ShouldWait(Thread* thread) const override;
void Acquire(Thread* thread) override;
+ void WakeupAllWaitingThreads() override;
+
/**
* Starts the timer, with the specified initial delay and interval.
* @param initial Delay until the timer is first fired