summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-16 07:30:21 +0200
committerGitHub <noreply@github.com>2021-05-16 07:30:21 +0200
commit5a2b15bf75318987d773a2bc69bd6224a28b7939 (patch)
treef213f5b011410022e8e98f7c3905d16d575ed413 /src/core/hle/kernel/kernel.h
parentMerge pull request #6289 from ameerj/oob-blit (diff)
parentcommon: tree: Avoid a nullptr dereference. (diff)
downloadyuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.gz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.bz2
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.lz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.xz
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.tar.zst
yuzu-5a2b15bf75318987d773a2bc69bd6224a28b7939.zip
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r--src/core/hle/kernel/kernel.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 51aaccbc7..2d01e1ae0 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -27,6 +27,10 @@ class CoreTiming;
struct EventType;
} // namespace Core::Timing
+namespace Service::SM {
+class ServiceManager;
+}
+
namespace Kernel {
class KClientPort;
@@ -51,6 +55,9 @@ class ServiceThread;
class Synchronization;
class TimeManager;
+using ServiceInterfaceFactory =
+ std::function<KClientPort&(Service::SM::ServiceManager&, Core::System&)>;
+
namespace Init {
struct KSlabResourceCounts;
}
@@ -172,14 +179,11 @@ public:
void InvalidateCpuInstructionCacheRange(VAddr addr, std::size_t size);
- /// Adds a port to the named port table
- void AddNamedPort(std::string name, KClientPort* port);
-
- /// Finds a port within the named port table with the given name.
- NamedPortTable::iterator FindNamedPort(const std::string& name);
+ /// Registers a named HLE service, passing a factory used to open a port to that service.
+ void RegisterNamedService(std::string name, ServiceInterfaceFactory&& factory);
- /// Finds a port within the named port table with the given name.
- NamedPortTable::const_iterator FindNamedPort(const std::string& name) const;
+ /// Opens a port to a service previously registered with RegisterNamedService.
+ KClientPort* CreateNamedServicePort(std::string name);
/// Determines whether or not the given port is a valid named port.
bool IsValidNamedPort(NamedPortTable::const_iterator port) const;