diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 18 |
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; | |||
| 27 | struct EventType; | 27 | struct EventType; |
| 28 | } // namespace Core::Timing | 28 | } // namespace Core::Timing |
| 29 | 29 | ||
| 30 | namespace Service::SM { | ||
| 31 | class ServiceManager; | ||
| 32 | } | ||
| 33 | |||
| 30 | namespace Kernel { | 34 | namespace Kernel { |
| 31 | 35 | ||
| 32 | class KClientPort; | 36 | class KClientPort; |
| @@ -51,6 +55,9 @@ class ServiceThread; | |||
| 51 | class Synchronization; | 55 | class Synchronization; |
| 52 | class TimeManager; | 56 | class TimeManager; |
| 53 | 57 | ||
| 58 | using ServiceInterfaceFactory = | ||
| 59 | std::function<KClientPort&(Service::SM::ServiceManager&, Core::System&)>; | ||
| 60 | |||
| 54 | namespace Init { | 61 | namespace Init { |
| 55 | struct KSlabResourceCounts; | 62 | struct KSlabResourceCounts; |
| 56 | } | 63 | } |
| @@ -172,14 +179,11 @@ public: | |||
| 172 | 179 | ||
| 173 | void InvalidateCpuInstructionCacheRange(VAddr addr, std::size_t size); | 180 | void InvalidateCpuInstructionCacheRange(VAddr addr, std::size_t size); |
| 174 | 181 | ||
| 175 | /// Adds a port to the named port table | 182 | /// Registers a named HLE service, passing a factory used to open a port to that service. |
| 176 | void AddNamedPort(std::string name, KClientPort* port); | 183 | void RegisterNamedService(std::string name, ServiceInterfaceFactory&& factory); |
| 177 | |||
| 178 | /// Finds a port within the named port table with the given name. | ||
| 179 | NamedPortTable::iterator FindNamedPort(const std::string& name); | ||
| 180 | 184 | ||
| 181 | /// Finds a port within the named port table with the given name. | 185 | /// Opens a port to a service previously registered with RegisterNamedService. |
| 182 | NamedPortTable::const_iterator FindNamedPort(const std::string& name) const; | 186 | KClientPort* CreateNamedServicePort(std::string name); |
| 183 | 187 | ||
| 184 | /// Determines whether or not the given port is a valid named port. | 188 | /// Determines whether or not the given port is a valid named port. |
| 185 | bool IsValidNamedPort(NamedPortTable::const_iterator port) const; | 189 | bool IsValidNamedPort(NamedPortTable::const_iterator port) const; |