diff options
| author | 2023-02-18 16:26:48 -0500 | |
|---|---|---|
| committer | 2023-02-21 12:19:25 -0500 | |
| commit | a9369726147c7499e0016e183d5d56a7b44efe4b (patch) | |
| tree | c1d1b4a9fdafd92863c0922b05d72c14de83ffa7 /src/core/hle/service/usb | |
| parent | core: defer cpu shutdown (diff) | |
| download | yuzu-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.cpp | 17 | ||||
| -rw-r--r-- | src/core/hle/service/usb/usb.h | 6 |
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 | ||
| 12 | namespace Service::USB { | 12 | namespace Service::USB { |
| @@ -218,12 +218,15 @@ public: | |||
| 218 | } | 218 | } |
| 219 | }; | 219 | }; |
| 220 | 220 | ||
| 221 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { | 221 | void 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 { | |||
| 7 | class System; | 7 | class System; |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | namespace Service::SM { | ||
| 11 | class ServiceManager; | ||
| 12 | } | ||
| 13 | |||
| 14 | namespace Service::USB { | 10 | namespace Service::USB { |
| 15 | 11 | ||
| 16 | void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); | 12 | void LoopProcess(Core::System& system); |
| 17 | 13 | ||
| 18 | } // namespace Service::USB | 14 | } // namespace Service::USB |