summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-11-26 18:32:13 -0500
committerGravatar Zach Hilman2018-11-29 08:42:26 -0500
commitc61d2a28413bd149d58b1173fa89a250ddce03c4 (patch)
treeb45cef0f468a5cd28c7624a78db036025800525a /src/core/hle/kernel/kernel.cpp
parentkernel: Divide Event into ReadableEvent and WritableEvent (diff)
downloadyuzu-c61d2a28413bd149d58b1173fa89a250ddce03c4.tar.gz
yuzu-c61d2a28413bd149d58b1173fa89a250ddce03c4.tar.xz
yuzu-c61d2a28413bd149d58b1173fa89a250ddce03c4.zip
kernel: Add named event table
Used to store ReadableEvents of all events on the system.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index e441c5bc6..9cd714586 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -17,9 +17,11 @@
17#include "core/hle/kernel/handle_table.h" 17#include "core/hle/kernel/handle_table.h"
18#include "core/hle/kernel/kernel.h" 18#include "core/hle/kernel/kernel.h"
19#include "core/hle/kernel/process.h" 19#include "core/hle/kernel/process.h"
20#include "core/hle/kernel/readable_event.h"
20#include "core/hle/kernel/resource_limit.h" 21#include "core/hle/kernel/resource_limit.h"
21#include "core/hle/kernel/thread.h" 22#include "core/hle/kernel/thread.h"
22#include "core/hle/kernel/timer.h" 23#include "core/hle/kernel/timer.h"
24#include "core/hle/kernel/writable_event.h"
23#include "core/hle/lock.h" 25#include "core/hle/lock.h"
24#include "core/hle/result.h" 26#include "core/hle/result.h"
25 27
@@ -175,6 +177,10 @@ struct KernelCore::Impl {
175 // allowing us to simply use a pool index or similar. 177 // allowing us to simply use a pool index or similar.
176 Kernel::HandleTable thread_wakeup_callback_handle_table; 178 Kernel::HandleTable thread_wakeup_callback_handle_table;
177 179
180 /// Map of named events managed by the kernel, which are retrieved when HLE services need to
181 /// return an event to the system.
182 NamedEventTable named_events;
183
178 /// Map of named ports managed by the kernel, which can be retrieved using 184 /// Map of named ports managed by the kernel, which can be retrieved using
179 /// the ConnectToPort SVC. 185 /// the ConnectToPort SVC.
180 NamedPortTable named_ports; 186 NamedPortTable named_ports;
@@ -221,6 +227,19 @@ const Process* KernelCore::CurrentProcess() const {
221 return impl->current_process; 227 return impl->current_process;
222} 228}
223 229
230void KernelCore::AddNamedEvent(std::string name, SharedPtr<ReadableEvent> event) {
231 impl->named_events.emplace(std::move(name), std::move(event));
232}
233
234KernelCore::NamedEventTable::iterator KernelCore::FindNamedEvent(const std::string& name) {
235 return impl->named_events.find(name);
236}
237
238KernelCore::NamedEventTable::const_iterator KernelCore::FindNamedEvent(
239 const std::string& name) const {
240 return impl->named_events.find(name);
241}
242
224void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { 243void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) {
225 impl->named_ports.emplace(std::move(name), std::move(port)); 244 impl->named_ports.emplace(std::move(name), std::move(port));
226} 245}