summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/spl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/spl/spl_module.cpp36
-rw-r--r--src/core/hle/service/spl/spl_module.h17
2 files changed, 28 insertions, 25 deletions
diff --git a/src/core/hle/service/spl/spl_module.cpp b/src/core/hle/service/spl/spl_module.cpp
index 64eae1ebf..0227d4393 100644
--- a/src/core/hle/service/spl/spl_module.cpp
+++ b/src/core/hle/service/spl/spl_module.cpp
@@ -8,7 +8,8 @@
#include "common/logging/log.h"
#include "common/settings.h"
#include "core/hle/api_version.h"
-#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/ipc_helpers.h"
+#include "core/hle/service/server_manager.h"
#include "core/hle/service/spl/csrng.h"
#include "core/hle/service/spl/spl.h"
#include "core/hle/service/spl/spl_module.h"
@@ -22,7 +23,7 @@ Module::Interface::Interface(Core::System& system_, std::shared_ptr<Module> modu
Module::Interface::~Interface() = default;
-void Module::Interface::GetConfig(Kernel::HLERequestContext& ctx) {
+void Module::Interface::GetConfig(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto config_item = rp.PopEnum<ConfigItem>();
@@ -47,21 +48,21 @@ void Module::Interface::GetConfig(Kernel::HLERequestContext& ctx) {
rb.Push(*smc_result);
}
-void Module::Interface::ModularExponentiate(Kernel::HLERequestContext& ctx) {
+void Module::Interface::ModularExponentiate(HLERequestContext& ctx) {
UNIMPLEMENTED_MSG("ModularExponentiate is not implemented!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSecureMonitorNotImplemented);
}
-void Module::Interface::SetConfig(Kernel::HLERequestContext& ctx) {
+void Module::Interface::SetConfig(HLERequestContext& ctx) {
UNIMPLEMENTED_MSG("SetConfig is not implemented!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSecureMonitorNotImplemented);
}
-void Module::Interface::GenerateRandomBytes(Kernel::HLERequestContext& ctx) {
+void Module::Interface::GenerateRandomBytes(HLERequestContext& ctx) {
LOG_DEBUG(Service_SPL, "called");
const std::size_t size = ctx.GetWriteBufferSize();
@@ -76,21 +77,21 @@ void Module::Interface::GenerateRandomBytes(Kernel::HLERequestContext& ctx) {
rb.Push(ResultSuccess);
}
-void Module::Interface::IsDevelopment(Kernel::HLERequestContext& ctx) {
+void Module::Interface::IsDevelopment(HLERequestContext& ctx) {
UNIMPLEMENTED_MSG("IsDevelopment is not implemented!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSecureMonitorNotImplemented);
}
-void Module::Interface::SetBootReason(Kernel::HLERequestContext& ctx) {
+void Module::Interface::SetBootReason(HLERequestContext& ctx) {
UNIMPLEMENTED_MSG("SetBootReason is not implemented!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSecureMonitorNotImplemented);
}
-void Module::Interface::GetBootReason(Kernel::HLERequestContext& ctx) {
+void Module::Interface::GetBootReason(HLERequestContext& ctx) {
UNIMPLEMENTED_MSG("GetBootReason is not implemented!");
IPC::ResponseBuilder rb{ctx, 2};
@@ -158,15 +159,18 @@ ResultVal<u64> Module::Interface::GetConfigImpl(ConfigItem config_item) const {
}
}
-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
+void LoopProcess(Core::System& system) {
+ auto server_manager = std::make_unique<ServerManager>(system);
auto module = std::make_shared<Module>();
- std::make_shared<CSRNG>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL_MIG>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL_FS>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL_SSL>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL_ES>(system, module)->InstallAsService(service_manager);
- std::make_shared<SPL_MANU>(system, module)->InstallAsService(service_manager);
+
+ server_manager->RegisterNamedService("csrng", std::make_shared<CSRNG>(system, module));
+ server_manager->RegisterNamedService("spl", std::make_shared<SPL>(system, module));
+ server_manager->RegisterNamedService("spl:mig", std::make_shared<SPL_MIG>(system, module));
+ server_manager->RegisterNamedService("spl:fs", std::make_shared<SPL_FS>(system, module));
+ server_manager->RegisterNamedService("spl:ssl", std::make_shared<SPL_SSL>(system, module));
+ server_manager->RegisterNamedService("spl:es", std::make_shared<SPL_ES>(system, module));
+ server_manager->RegisterNamedService("spl:manu", std::make_shared<SPL_MANU>(system, module));
+ ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::SPL
diff --git a/src/core/hle/service/spl/spl_module.h b/src/core/hle/service/spl/spl_module.h
index 4c9a3c618..e074e115d 100644
--- a/src/core/hle/service/spl/spl_module.h
+++ b/src/core/hle/service/spl/spl_module.h
@@ -23,13 +23,13 @@ public:
~Interface() override;
// General
- void GetConfig(Kernel::HLERequestContext& ctx);
- void ModularExponentiate(Kernel::HLERequestContext& ctx);
- void SetConfig(Kernel::HLERequestContext& ctx);
- void GenerateRandomBytes(Kernel::HLERequestContext& ctx);
- void IsDevelopment(Kernel::HLERequestContext& ctx);
- void SetBootReason(Kernel::HLERequestContext& ctx);
- void GetBootReason(Kernel::HLERequestContext& ctx);
+ void GetConfig(HLERequestContext& ctx);
+ void ModularExponentiate(HLERequestContext& ctx);
+ void SetConfig(HLERequestContext& ctx);
+ void GenerateRandomBytes(HLERequestContext& ctx);
+ void IsDevelopment(HLERequestContext& ctx);
+ void SetBootReason(HLERequestContext& ctx);
+ void GetBootReason(HLERequestContext& ctx);
protected:
std::shared_ptr<Module> module;
@@ -41,7 +41,6 @@ public:
};
};
-/// Registers all SPL services with the specified service manager.
-void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system);
+void LoopProcess(Core::System& system);
} // namespace Service::SPL