summaryrefslogtreecommitdiff
path: root/src/core/hle/service/service.h
diff options
context:
space:
mode:
authorGravatar Liam2023-02-18 16:26:48 -0500
committerGravatar Liam2023-02-21 12:19:25 -0500
commita9369726147c7499e0016e183d5d56a7b44efe4b (patch)
treec1d1b4a9fdafd92863c0922b05d72c14de83ffa7 /src/core/hle/service/service.h
parentcore: defer cpu shutdown (diff)
downloadyuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.gz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.tar.xz
yuzu-a9369726147c7499e0016e183d5d56a7b44efe4b.zip
service: refactor server architecture
Converts services to have their own processes
Diffstat (limited to 'src/core/hle/service/service.h')
-rw-r--r--src/core/hle/service/service.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h
index 22e2119d7..db3b31378 100644
--- a/src/core/hle/service/service.h
+++ b/src/core/hle/service/service.h
@@ -19,8 +19,6 @@ class System;
19 19
20namespace Kernel { 20namespace Kernel {
21class HLERequestContext; 21class HLERequestContext;
22class KClientPort;
23class KPort;
24class KServerSession; 22class KServerSession;
25class ServiceThread; 23class ServiceThread;
26} // namespace Kernel 24} // namespace Kernel
@@ -67,18 +65,12 @@ public:
67 return max_sessions; 65 return max_sessions;
68 } 66 }
69 67
70 /// Creates a port pair and registers this service with the given ServiceManager.
71 void InstallAsService(SM::ServiceManager& service_manager);
72
73 /// Invokes a service request routine using the HIPC protocol. 68 /// Invokes a service request routine using the HIPC protocol.
74 void InvokeRequest(Kernel::HLERequestContext& ctx); 69 void InvokeRequest(Kernel::HLERequestContext& ctx);
75 70
76 /// Invokes a service request routine using the HIPC protocol. 71 /// Invokes a service request routine using the HIPC protocol.
77 void InvokeRequestTipc(Kernel::HLERequestContext& ctx); 72 void InvokeRequestTipc(Kernel::HLERequestContext& ctx);
78 73
79 /// Creates a port pair and registers it on the kernel's global port registry.
80 Kernel::KClientPort& CreatePort();
81
82 /// Handles a synchronization request for the service. 74 /// Handles a synchronization request for the service.
83 Result HandleSyncRequest(Kernel::KServerSession& session, 75 Result HandleSyncRequest(Kernel::KServerSession& session,
84 Kernel::HLERequestContext& context) override; 76 Kernel::HLERequestContext& context) override;
@@ -99,9 +91,6 @@ protected:
99 /// Identifier string used to connect to the service. 91 /// Identifier string used to connect to the service.
100 std::string service_name; 92 std::string service_name;
101 93
102 /// Port used by ManageNamedPort.
103 Kernel::KPort* named_port{};
104
105private: 94private:
106 template <typename T> 95 template <typename T>
107 friend class ServiceFramework; 96 friend class ServiceFramework;
@@ -116,8 +105,7 @@ private:
116 Kernel::HLERequestContext& ctx); 105 Kernel::HLERequestContext& ctx);
117 106
118 explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_, 107 explicit ServiceFrameworkBase(Core::System& system_, const char* service_name_,
119 ServiceThreadType thread_type, u32 max_sessions_, 108 u32 max_sessions_, InvokerFn* handler_invoker_);
120 InvokerFn* handler_invoker_);
121 ~ServiceFrameworkBase() override; 109 ~ServiceFrameworkBase() override;
122 110
123 void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n); 111 void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n);
@@ -181,15 +169,12 @@ protected:
181 * 169 *
182 * @param system_ The system context to construct this service under. 170 * @param system_ The system context to construct this service under.
183 * @param service_name_ Name of the service. 171 * @param service_name_ Name of the service.
184 * @param thread_type Specifies the thread type for this service. If this is set to CreateNew,
185 * it creates a new thread for it, otherwise this uses the default thread.
186 * @param max_sessions_ Maximum number of sessions that can be connected to this service at the 172 * @param max_sessions_ Maximum number of sessions that can be connected to this service at the
187 * same time. 173 * same time.
188 */ 174 */
189 explicit ServiceFramework(Core::System& system_, const char* service_name_, 175 explicit ServiceFramework(Core::System& system_, const char* service_name_,
190 ServiceThreadType thread_type = ServiceThreadType::Default,
191 u32 max_sessions_ = ServerSessionCountMax) 176 u32 max_sessions_ = ServerSessionCountMax)
192 : ServiceFrameworkBase(system_, service_name_, thread_type, max_sessions_, Invoker) {} 177 : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) {}
193 178
194 /// Registers handlers in the service. 179 /// Registers handlers in the service.
195 template <std::size_t N> 180 template <std::size_t N>