diff options
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ldr/ldr.cpp | 81 | ||||
| -rw-r--r-- | src/core/hle/service/ldr/ldr.h | 16 | ||||
| -rw-r--r-- | src/core/hle/service/service.cpp | 2 |
4 files changed, 101 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index d513ce70a..f5e7ec080 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -154,6 +154,8 @@ add_library(core STATIC | |||
| 154 | hle/service/friend/interface.h | 154 | hle/service/friend/interface.h |
| 155 | hle/service/hid/hid.cpp | 155 | hle/service/hid/hid.cpp |
| 156 | hle/service/hid/hid.h | 156 | hle/service/hid/hid.h |
| 157 | hle/service/ldr/ldr.cpp | ||
| 158 | hle/service/ldr/ldr.h | ||
| 157 | hle/service/lm/lm.cpp | 159 | hle/service/lm/lm.cpp |
| 158 | hle/service/lm/lm.h | 160 | hle/service/lm/lm.h |
| 159 | hle/service/mm/mm_u.cpp | 161 | 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 | |||
| 10 | namespace Service::LDR { | ||
| 11 | |||
| 12 | class DebugMonitor final : public ServiceFramework<DebugMonitor> { | ||
| 13 | public: | ||
| 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 | |||
| 27 | class ProcessManager final : public ServiceFramework<ProcessManager> { | ||
| 28 | public: | ||
| 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 | |||
| 43 | class Shell final : public ServiceFramework<Shell> { | ||
| 44 | public: | ||
| 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 | |||
| 57 | class RelocatableObject final : public ServiceFramework<RelocatableObject> { | ||
| 58 | public: | ||
| 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 | |||
| 74 | void 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 | |||
| 7 | namespace Service::SM { | ||
| 8 | class ServiceManager; | ||
| 9 | } | ||
| 10 | |||
| 11 | namespace Service::LDR { | ||
| 12 | |||
| 13 | /// Registers all LDR services with the specified service manager. | ||
| 14 | void 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 4daf13fa3..2ac416b98 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include "core/hle/service/filesystem/filesystem.h" | 26 | #include "core/hle/service/filesystem/filesystem.h" |
| 27 | #include "core/hle/service/friend/friend.h" | 27 | #include "core/hle/service/friend/friend.h" |
| 28 | #include "core/hle/service/hid/hid.h" | 28 | #include "core/hle/service/hid/hid.h" |
| 29 | #include "core/hle/service/ldr/ldr.h" | ||
| 29 | #include "core/hle/service/lm/lm.h" | 30 | #include "core/hle/service/lm/lm.h" |
| 30 | #include "core/hle/service/mm/mm_u.h" | 31 | #include "core/hle/service/mm/mm_u.h" |
| 31 | #include "core/hle/service/nfp/nfp.h" | 32 | #include "core/hle/service/nfp/nfp.h" |
| @@ -194,6 +195,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { | |||
| 194 | FileSystem::InstallInterfaces(*sm); | 195 | FileSystem::InstallInterfaces(*sm); |
| 195 | Friend::InstallInterfaces(*sm); | 196 | Friend::InstallInterfaces(*sm); |
| 196 | HID::InstallInterfaces(*sm); | 197 | HID::InstallInterfaces(*sm); |
| 198 | LDR::InstallInterfaces(*sm); | ||
| 197 | LM::InstallInterfaces(*sm); | 199 | LM::InstallInterfaces(*sm); |
| 198 | MM::InstallInterfaces(*sm); | 200 | MM::InstallInterfaces(*sm); |
| 199 | NFP::InstallInterfaces(*sm); | 201 | NFP::InstallInterfaces(*sm); |