summaryrefslogtreecommitdiff
path: root/src/core/hle/service/usb
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/usb
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/usb')
-rw-r--r--src/core/hle/service/usb/usb.cpp17
-rw-r--r--src/core/hle/service/usb/usb.h6
2 files changed, 11 insertions, 12 deletions
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp
index ac46a406c..ddb73f394 100644
--- a/src/core/hle/service/usb/usb.cpp
+++ b/src/core/hle/service/usb/usb.cpp
@@ -5,8 +5,8 @@
5 5
6#include "common/logging/log.h" 6#include "common/logging/log.h"
7#include "core/hle/ipc_helpers.h" 7#include "core/hle/ipc_helpers.h"
8#include "core/hle/service/server_manager.h"
8#include "core/hle/service/service.h" 9#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10#include "core/hle/service/usb/usb.h" 10#include "core/hle/service/usb/usb.h"
11 11
12namespace Service::USB { 12namespace Service::USB {
@@ -218,12 +218,15 @@ public:
218 } 218 }
219}; 219};
220 220
221void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { 221void LoopProcess(Core::System& system) {
222 std::make_shared<USB_DS>(system)->InstallAsService(sm); 222 auto server_manager = std::make_unique<ServerManager>(system);
223 std::make_shared<USB_HS>(system)->InstallAsService(sm); 223
224 std::make_shared<USB_PD>(system)->InstallAsService(sm); 224 server_manager->RegisterNamedService("usb:ds", std::make_shared<USB_DS>(system));
225 std::make_shared<USB_PD_C>(system)->InstallAsService(sm); 225 server_manager->RegisterNamedService("usb:hs", std::make_shared<USB_HS>(system));
226 std::make_shared<USB_PM>(system)->InstallAsService(sm); 226 server_manager->RegisterNamedService("usb:pd", std::make_shared<USB_PD>(system));
227 server_manager->RegisterNamedService("usb:pd:c", std::make_shared<USB_PD_C>(system));
228 server_manager->RegisterNamedService("usb:pm", std::make_shared<USB_PM>(system));
229 ServerManager::RunServer(std::move(server_manager));
227} 230}
228 231
229} // namespace Service::USB 232} // namespace Service::USB
diff --git a/src/core/hle/service/usb/usb.h b/src/core/hle/service/usb/usb.h
index b41b9684c..98376ebc0 100644
--- a/src/core/hle/service/usb/usb.h
+++ b/src/core/hle/service/usb/usb.h
@@ -7,12 +7,8 @@ namespace Core {
7class System; 7class System;
8} 8}
9 9
10namespace Service::SM {
11class ServiceManager;
12}
13
14namespace Service::USB { 10namespace Service::USB {
15 11
16void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); 12void LoopProcess(Core::System& system);
17 13
18} // namespace Service::USB 14} // namespace Service::USB