summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-09-02 17:58:58 +0200
committerLioncash <mathew1800@gmail.com>2018-09-02 18:35:30 +0200
commit1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2 (patch)
treef540b9cbc6db29bb5d41668f7efa8fc5c4e44469 /src/core/hle/kernel/kernel.h
parentMerge pull request #1213 from DarkLordZach/octopath-fs (diff)
downloadyuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar.gz
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar.bz2
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar.lz
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar.xz
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.tar.zst
yuzu-1242c1ec0aab88d91b0bb4faf6200e4f20e4bdc2.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/kernel.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 089e959ac..ab2e9bffa 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -4,6 +4,8 @@
#pragma once
+#include <string>
+#include <unordered_map>
#include "core/hle/kernel/object.h"
template <typename T>
@@ -15,6 +17,7 @@ struct EventType;
namespace Kernel {
+class ClientPort;
class HandleTable;
class Process;
class ResourceLimit;
@@ -25,6 +28,9 @@ enum class ResourceLimitCategory : u8;
/// Represents a single instance of the kernel.
class KernelCore {
+private:
+ using NamedPortTable = std::unordered_map<std::string, SharedPtr<ClientPort>>;
+
public:
KernelCore();
~KernelCore();
@@ -59,6 +65,18 @@ public:
/// Adds the given shared pointer to an internal list of active processes.
void AppendNewProcess(SharedPtr<Process> process);
+ /// Adds a port to the named port table
+ void AddNamedPort(std::string name, SharedPtr<ClientPort> port);
+
+ /// Finds a port within the named port table with the given name.
+ NamedPortTable::iterator FindNamedPort(const std::string& name);
+
+ /// Finds a port within the named port table with the given name.
+ NamedPortTable::const_iterator FindNamedPort(const std::string& name) const;
+
+ /// Determines whether or not the given port is a valid named port.
+ bool IsValidNamedPort(NamedPortTable::const_iterator port) const;
+
private:
friend class Object;
friend class Process;