summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ldr/ldr.cpp81
-rw-r--r--src/core/hle/service/ldr/ldr.h16
-rw-r--r--src/core/hle/service/service.cpp2
4 files changed, 101 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 0a587097e..2e2de59b1 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -158,6 +158,8 @@ add_library(core STATIC
158 hle/service/friend/interface.h 158 hle/service/friend/interface.h
159 hle/service/hid/hid.cpp 159 hle/service/hid/hid.cpp
160 hle/service/hid/hid.h 160 hle/service/hid/hid.h
161 hle/service/ldr/ldr.cpp
162 hle/service/ldr/ldr.h
161 hle/service/lm/lm.cpp 163 hle/service/lm/lm.cpp
162 hle/service/lm/lm.h 164 hle/service/lm/lm.h
163 hle/service/mm/mm_u.cpp 165 hle/service/mm/mm_u.cpp
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
new file mode 100644
index 000000000..ec32faf15
--- /dev/null
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -0,0 +1,81 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/ldr/ldr.h"
8#include "core/hle/service/service.h"
9
10namespace Service::LDR {
11
12class DebugMonitor final : public ServiceFramework<DebugMonitor> {
13public:
14 explicit DebugMonitor() : ServiceFramework{"ldr:dmnt"} {
15 // clang-format off
16 static const FunctionInfo functions[] = {
17 {0, nullptr, "AddProcessToDebugLaunchQueue"},
18 {1, nullptr, "ClearDebugLaunchQueue"},
19 {2, nullptr, "GetNsoInfos"},
20 };
21 // clang-format on
22
23 RegisterHandlers(functions);
24 }
25};
26
27class ProcessManager final : public ServiceFramework<ProcessManager> {
28public:
29 explicit ProcessManager() : ServiceFramework{"ldr:pm"} {
30 // clang-format off
31 static const FunctionInfo functions[] = {
32 {0, nullptr, "CreateProcess"},
33 {1, nullptr, "GetProgramInfo"},
34 {2, nullptr, "RegisterTitle"},
35 {3, nullptr, "UnregisterTitle"},
36 };
37 // clang-format on
38
39 RegisterHandlers(functions);
40 }
41};
42
43class Shell final : public ServiceFramework<Shell> {
44public:
45 explicit Shell() : ServiceFramework{"ldr:shel"} {
46 // clang-format off
47 static const FunctionInfo functions[] = {
48 {0, nullptr, "AddProcessToLaunchQueue"},
49 {1, nullptr, "ClearLaunchQueue"},
50 };
51 // clang-format on
52
53 RegisterHandlers(functions);
54 }
55};
56
57class RelocatableObject final : public ServiceFramework<RelocatableObject> {
58public:
59 explicit RelocatableObject() : ServiceFramework{"ldr:ro"} {
60 // clang-format off
61 static const FunctionInfo functions[] = {
62 {0, nullptr, "LoadNro"},
63 {1, nullptr, "UnloadNro"},
64 {2, nullptr, "LoadNrr"},
65 {3, nullptr, "UnloadNrr"},
66 {4, nullptr, "Initialize"},
67 };
68 // clang-format on
69
70 RegisterHandlers(functions);
71 }
72};
73
74void InstallInterfaces(SM::ServiceManager& sm) {
75 std::make_shared<DebugMonitor>()->InstallAsService(sm);
76 std::make_shared<ProcessManager>()->InstallAsService(sm);
77 std::make_shared<Shell>()->InstallAsService(sm);
78 std::make_shared<RelocatableObject>()->InstallAsService(sm);
79}
80
81} // namespace Service::LDR
diff --git a/src/core/hle/service/ldr/ldr.h b/src/core/hle/service/ldr/ldr.h
new file mode 100644
index 000000000..412410c4f
--- /dev/null
+++ b/src/core/hle/service/ldr/ldr.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::LDR {
12
13/// Registers all LDR services with the specified service manager.
14void InstallInterfaces(SM::ServiceManager& sm);
15
16} // namespace Service::LDR
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 4e44063ac..482989ea7 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -28,6 +28,7 @@
28#include "core/hle/service/filesystem/filesystem.h" 28#include "core/hle/service/filesystem/filesystem.h"
29#include "core/hle/service/friend/friend.h" 29#include "core/hle/service/friend/friend.h"
30#include "core/hle/service/hid/hid.h" 30#include "core/hle/service/hid/hid.h"
31#include "core/hle/service/ldr/ldr.h"
31#include "core/hle/service/lm/lm.h" 32#include "core/hle/service/lm/lm.h"
32#include "core/hle/service/mm/mm_u.h" 33#include "core/hle/service/mm/mm_u.h"
33#include "core/hle/service/nfp/nfp.h" 34#include "core/hle/service/nfp/nfp.h"
@@ -198,6 +199,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
198 FileSystem::InstallInterfaces(*sm); 199 FileSystem::InstallInterfaces(*sm);
199 Friend::InstallInterfaces(*sm); 200 Friend::InstallInterfaces(*sm);
200 HID::InstallInterfaces(*sm); 201 HID::InstallInterfaces(*sm);
202 LDR::InstallInterfaces(*sm);
201 LM::InstallInterfaces(*sm); 203 LM::InstallInterfaces(*sm);
202 MM::InstallInterfaces(*sm); 204 MM::InstallInterfaces(*sm);
203 NFP::InstallInterfaces(*sm); 205 NFP::InstallInterfaces(*sm);