summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/ldr/ldr.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/ldr/ldr.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index 2d4d6fe3e..6de96ed5b 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -9,11 +9,12 @@
#include "common/hex_util.h"
#include "common/scope_exit.h"
#include "core/core.h"
-#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/k_page_table.h"
#include "core/hle/kernel/svc_results.h"
#include "core/hle/kernel/svc_types.h"
+#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/ldr/ldr.h"
+#include "core/hle/service/server_manager.h"
#include "core/hle/service/service.h"
#include "core/loader/nro.h"
#include "core/memory.h"
@@ -159,8 +160,7 @@ public:
class RelocatableObject final : public ServiceFramework<RelocatableObject> {
public:
- explicit RelocatableObject(Core::System& system_)
- : ServiceFramework{system_, "ldr:ro", ServiceThreadType::CreateNew} {
+ explicit RelocatableObject(Core::System& system_) : ServiceFramework{system_, "ldr:ro"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &RelocatableObject::LoadModule, "LoadModule"},
@@ -175,7 +175,7 @@ public:
RegisterHandlers(functions);
}
- void RegisterModuleInfo(Kernel::HLERequestContext& ctx) {
+ void RegisterModuleInfo(HLERequestContext& ctx) {
struct Parameters {
u64_le process_id;
u64_le nrr_address;
@@ -272,7 +272,7 @@ public:
rb.Push(ResultSuccess);
}
- void UnregisterModuleInfo(Kernel::HLERequestContext& ctx) {
+ void UnregisterModuleInfo(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto pid = rp.Pop<u64>();
const auto nrr_address = rp.Pop<VAddr>();
@@ -446,7 +446,7 @@ public:
data_start, bss_end_addr - data_start, Kernel::Svc::MemoryPermission::ReadWrite);
}
- void LoadModule(Kernel::HLERequestContext& ctx) {
+ void LoadModule(HLERequestContext& ctx) {
struct Parameters {
u64_le process_id;
u64_le image_address;
@@ -592,7 +592,7 @@ public:
return ResultSuccess;
}
- void UnloadModule(Kernel::HLERequestContext& ctx) {
+ void UnloadModule(HLERequestContext& ctx) {
if (!initialized) {
LOG_ERROR(Service_LDR, "LDR:RO not initialized before use!");
IPC::ResponseBuilder rb{ctx, 2};
@@ -638,7 +638,7 @@ public:
rb.Push(result);
}
- void Initialize(Kernel::HLERequestContext& ctx) {
+ void Initialize(HLERequestContext& ctx) {
LOG_WARNING(Service_LDR, "(STUBBED) called");
initialized = true;
@@ -682,11 +682,15 @@ private:
}
};
-void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
- std::make_shared<DebugMonitor>(system)->InstallAsService(sm);
- std::make_shared<ProcessManager>(system)->InstallAsService(sm);
- std::make_shared<Shell>(system)->InstallAsService(sm);
- std::make_shared<RelocatableObject>(system)->InstallAsService(sm);
+void LoopProcess(Core::System& system) {
+ auto server_manager = std::make_unique<ServerManager>(system);
+
+ server_manager->RegisterNamedService("ldr:dmnt", std::make_shared<DebugMonitor>(system));
+ server_manager->RegisterNamedService("ldr:pm", std::make_shared<ProcessManager>(system));
+ server_manager->RegisterNamedService("ldr:shel", std::make_shared<Shell>(system));
+ server_manager->RegisterNamedService("ldr:ro", std::make_shared<RelocatableObject>(system));
+
+ ServerManager::RunServer(std::move(server_manager));
}
} // namespace Service::LDR