diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/CMakeLists.txt | 14 | ||||
-rw-r--r-- | src/core/hle/service/erpt/erpt.cpp | 51 | ||||
-rw-r--r-- | src/core/hle/service/erpt/erpt.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/eupld/eupld.cpp | 52 | ||||
-rw-r--r-- | src/core/hle/service/eupld/eupld.h | 16 | ||||
-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/nifm/nifm.cpp | 47 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm.h | 19 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_a.cpp | 17 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_a.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_s.cpp | 17 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_s.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_u.cpp | 17 | ||||
-rw-r--r-- | src/core/hle/service/nifm/nifm_u.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.cpp | 10 | ||||
-rw-r--r-- | src/core/hle/service/nvdrv/nvdrv.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/pm/pm.cpp | 70 | ||||
-rw-r--r-- | src/core/hle/service/pm/pm.h | 16 | ||||
-rw-r--r-- | src/core/hle/service/service.cpp | 8 |
20 files changed, 371 insertions, 146 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 87e381055..2e2de59b1 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -136,8 +136,12 @@ add_library(core STATIC hle/service/bcat/bcat.h hle/service/bcat/module.cpp hle/service/bcat/module.h + hle/service/erpt/erpt.cpp + hle/service/erpt/erpt.h hle/service/es/es.cpp hle/service/es/es.h + hle/service/eupld/eupld.cpp + hle/service/eupld/eupld.h hle/service/fatal/fatal.cpp hle/service/fatal/fatal.h hle/service/fatal/fatal_p.cpp @@ -154,6 +158,8 @@ add_library(core STATIC hle/service/friend/interface.h hle/service/hid/hid.cpp hle/service/hid/hid.h + hle/service/ldr/ldr.cpp + hle/service/ldr/ldr.h hle/service/lm/lm.cpp hle/service/lm/lm.h hle/service/mm/mm_u.cpp @@ -164,12 +170,6 @@ add_library(core STATIC hle/service/nfp/nfp_user.h hle/service/nifm/nifm.cpp hle/service/nifm/nifm.h - hle/service/nifm/nifm_a.cpp - hle/service/nifm/nifm_a.h - hle/service/nifm/nifm_s.cpp - hle/service/nifm/nifm_s.h - hle/service/nifm/nifm_u.cpp - hle/service/nifm/nifm_u.h hle/service/ns/ns.cpp hle/service/ns/ns.h hle/service/ns/pl_u.cpp @@ -203,6 +203,8 @@ add_library(core STATIC hle/service/pctl/module.h hle/service/pctl/pctl.cpp hle/service/pctl/pctl.h + hle/service/pm/pm.cpp + hle/service/pm/pm.h hle/service/prepo/prepo.cpp hle/service/prepo/prepo.h hle/service/service.cpp diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp new file mode 100644 index 000000000..ee11cd78e --- /dev/null +++ b/src/core/hle/service/erpt/erpt.cpp @@ -0,0 +1,51 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "core/hle/service/erpt/erpt.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::ERPT { + +class ErrorReportContext final : public ServiceFramework<ErrorReportContext> { +public: + explicit ErrorReportContext() : ServiceFramework{"erpt:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SubmitContext"}, + {1, nullptr, "CreateReport"}, + {2, nullptr, "Unknown1"}, + {3, nullptr, "Unknown2"}, + {4, nullptr, "Unknown3"}, + {5, nullptr, "Unknown4"}, + {6, nullptr, "Unknown5"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class ErrorReportSession final : public ServiceFramework<ErrorReportSession> { +public: + explicit ErrorReportSession() : ServiceFramework{"erpt:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "OpenReport"}, + {1, nullptr, "OpenManager"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<ErrorReportContext>()->InstallAsService(sm); + std::make_shared<ErrorReportSession>()->InstallAsService(sm); +} + +} // namespace Service::ERPT diff --git a/src/core/hle/service/erpt/erpt.h b/src/core/hle/service/erpt/erpt.h new file mode 100644 index 000000000..de439ab6d --- /dev/null +++ b/src/core/hle/service/erpt/erpt.h @@ -0,0 +1,16 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +namespace Service::SM { +class ServiceManager; +} + +namespace Service::ERPT { + +/// Registers all ERPT services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& sm); + +} // namespace Service::ERPT diff --git a/src/core/hle/service/eupld/eupld.cpp b/src/core/hle/service/eupld/eupld.cpp new file mode 100644 index 000000000..2df30acee --- /dev/null +++ b/src/core/hle/service/eupld/eupld.cpp @@ -0,0 +1,52 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "core/hle/service/eupld/eupld.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::EUPLD { + +class ErrorUploadContext final : public ServiceFramework<ErrorUploadContext> { +public: + explicit ErrorUploadContext() : ServiceFramework{"eupld:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "SetUrl"}, + {1, nullptr, "ImportCrt"}, + {2, nullptr, "ImportPki"}, + {3, nullptr, "SetAutoUpload"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class ErrorUploadRequest final : public ServiceFramework<ErrorUploadRequest> { +public: + explicit ErrorUploadRequest() : ServiceFramework{"eupld:r"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "UploadAll"}, + {2, nullptr, "UploadSelected"}, + {3, nullptr, "GetUploadStatus"}, + {4, nullptr, "CancelUpload"}, + {5, nullptr, "GetResult"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<ErrorUploadContext>()->InstallAsService(sm); + std::make_shared<ErrorUploadRequest>()->InstallAsService(sm); +} + +} // namespace Service::EUPLD diff --git a/src/core/hle/service/eupld/eupld.h b/src/core/hle/service/eupld/eupld.h new file mode 100644 index 000000000..6eef2c15f --- /dev/null +++ b/src/core/hle/service/eupld/eupld.h @@ -0,0 +1,16 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +namespace Service::SM { +class ServiceManager; +} + +namespace Service::EUPLD { + +/// Registers all EUPLD services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& sm); + +} // namespace Service::EUPLD 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "core/hle/service/ldr/ldr.h" +#include "core/hle/service/service.h" + +namespace Service::LDR { + +class DebugMonitor final : public ServiceFramework<DebugMonitor> { +public: + explicit DebugMonitor() : ServiceFramework{"ldr:dmnt"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "AddProcessToDebugLaunchQueue"}, + {1, nullptr, "ClearDebugLaunchQueue"}, + {2, nullptr, "GetNsoInfos"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class ProcessManager final : public ServiceFramework<ProcessManager> { +public: + explicit ProcessManager() : ServiceFramework{"ldr:pm"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "CreateProcess"}, + {1, nullptr, "GetProgramInfo"}, + {2, nullptr, "RegisterTitle"}, + {3, nullptr, "UnregisterTitle"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class Shell final : public ServiceFramework<Shell> { +public: + explicit Shell() : ServiceFramework{"ldr:shel"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "AddProcessToLaunchQueue"}, + {1, nullptr, "ClearLaunchQueue"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class RelocatableObject final : public ServiceFramework<RelocatableObject> { +public: + explicit RelocatableObject() : ServiceFramework{"ldr:ro"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "LoadNro"}, + {1, nullptr, "UnloadNro"}, + {2, nullptr, "LoadNrr"}, + {3, nullptr, "UnloadNrr"}, + {4, nullptr, "Initialize"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<DebugMonitor>()->InstallAsService(sm); + std::make_shared<ProcessManager>()->InstallAsService(sm); + std::make_shared<Shell>()->InstallAsService(sm); + std::make_shared<RelocatableObject>()->InstallAsService(sm); +} + +} // 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +namespace Service::SM { +class ServiceManager; +} + +namespace Service::LDR { + +/// Registers all LDR services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& sm); + +} // namespace Service::LDR diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 0d951084b..cfe8d9178 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -5,9 +5,7 @@ #include "core/hle/ipc_helpers.h" #include "core/hle/kernel/event.h" #include "core/hle/service/nifm/nifm.h" -#include "core/hle/service/nifm/nifm_a.h" -#include "core/hle/service/nifm/nifm_s.h" -#include "core/hle/service/nifm/nifm_u.h" +#include "core/hle/service/service.h" namespace Service::NIFM { @@ -210,28 +208,35 @@ IGeneralService::IGeneralService() : ServiceFramework("IGeneralService") { RegisterHandlers(functions); } -void Module::Interface::CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<IGeneralService>(); - LOG_DEBUG(Service_NIFM, "called"); -} +class NetworkInterface final : public ServiceFramework<NetworkInterface> { +public: + explicit NetworkInterface(const char* name) : ServiceFramework{name} { + static const FunctionInfo functions[] = { + {4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, + {5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}, + }; + RegisterHandlers(functions); + } -void Module::Interface::CreateGeneralService(Kernel::HLERequestContext& ctx) { - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<IGeneralService>(); - LOG_DEBUG(Service_NIFM, "called"); -} + void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<IGeneralService>(); + LOG_DEBUG(Service_NIFM, "called"); + } -Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) - : ServiceFramework(name), module(std::move(module)) {} + void CreateGeneralService(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface<IGeneralService>(); + LOG_DEBUG(Service_NIFM, "called"); + } +}; void InstallInterfaces(SM::ServiceManager& service_manager) { - auto module = std::make_shared<Module>(); - std::make_shared<NIFM_A>(module)->InstallAsService(service_manager); - std::make_shared<NIFM_S>(module)->InstallAsService(service_manager); - std::make_shared<NIFM_U>(module)->InstallAsService(service_manager); + std::make_shared<NetworkInterface>("nifm:a")->InstallAsService(service_manager); + std::make_shared<NetworkInterface>("nifm:s")->InstallAsService(service_manager); + std::make_shared<NetworkInterface>("nifm:u")->InstallAsService(service_manager); } } // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm.h b/src/core/hle/service/nifm/nifm.h index 11f1b5831..4616b3b48 100644 --- a/src/core/hle/service/nifm/nifm.h +++ b/src/core/hle/service/nifm/nifm.h @@ -4,24 +4,13 @@ #pragma once -#include "core/hle/service/service.h" +namespace Service::SM { +class ServiceManager; +} namespace Service::NIFM { -class Module final { -public: - class Interface : public ServiceFramework<Interface> { - public: - explicit Interface(std::shared_ptr<Module> module, const char* name); - - void CreateGeneralServiceOld(Kernel::HLERequestContext& ctx); - void CreateGeneralService(Kernel::HLERequestContext& ctx); - - protected: - std::shared_ptr<Module> module; - }; -}; - +/// Registers all NIFM services with the specified service manager. void InstallInterfaces(SM::ServiceManager& service_manager); } // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_a.cpp b/src/core/hle/service/nifm/nifm_a.cpp deleted file mode 100644 index b7f296a20..000000000 --- a/src/core/hle/service/nifm/nifm_a.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/nifm/nifm_a.h" - -namespace Service::NIFM { - -NIFM_A::NIFM_A(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:a") { - static const FunctionInfo functions[] = { - {4, &NIFM_A::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, - {5, &NIFM_A::CreateGeneralService, "CreateGeneralService"}, - }; - RegisterHandlers(functions); -} - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_a.h b/src/core/hle/service/nifm/nifm_a.h deleted file mode 100644 index c3ba33110..000000000 --- a/src/core/hle/service/nifm/nifm_a.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/nifm/nifm.h" - -namespace Service::NIFM { - -class NIFM_A final : public Module::Interface { -public: - explicit NIFM_A(std::shared_ptr<Module> module); -}; - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_s.cpp b/src/core/hle/service/nifm/nifm_s.cpp deleted file mode 100644 index 96e3c0cee..000000000 --- a/src/core/hle/service/nifm/nifm_s.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/nifm/nifm_s.h" - -namespace Service::NIFM { - -NIFM_S::NIFM_S(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:s") { - static const FunctionInfo functions[] = { - {4, &NIFM_S::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, - {5, &NIFM_S::CreateGeneralService, "CreateGeneralService"}, - }; - RegisterHandlers(functions); -} - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_s.h b/src/core/hle/service/nifm/nifm_s.h deleted file mode 100644 index 8d1635a5d..000000000 --- a/src/core/hle/service/nifm/nifm_s.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/nifm/nifm.h" - -namespace Service::NIFM { - -class NIFM_S final : public Module::Interface { -public: - explicit NIFM_S(std::shared_ptr<Module> module); -}; - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_u.cpp b/src/core/hle/service/nifm/nifm_u.cpp deleted file mode 100644 index 8cb75b903..000000000 --- a/src/core/hle/service/nifm/nifm_u.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/nifm/nifm_u.h" - -namespace Service::NIFM { - -NIFM_U::NIFM_U(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "nifm:u") { - static const FunctionInfo functions[] = { - {4, &NIFM_U::CreateGeneralServiceOld, "CreateGeneralServiceOld"}, - {5, &NIFM_U::CreateGeneralService, "CreateGeneralService"}, - }; - RegisterHandlers(functions); -} - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nifm/nifm_u.h b/src/core/hle/service/nifm/nifm_u.h deleted file mode 100644 index def9726b1..000000000 --- a/src/core/hle/service/nifm/nifm_u.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/nifm/nifm.h" - -namespace Service::NIFM { - -class NIFM_U final : public Module::Interface { -public: - explicit NIFM_U(std::shared_ptr<Module> module); -}; - -} // namespace Service::NIFM diff --git a/src/core/hle/service/nvdrv/nvdrv.cpp b/src/core/hle/service/nvdrv/nvdrv.cpp index cc5cfe34e..1555ea806 100644 --- a/src/core/hle/service/nvdrv/nvdrv.cpp +++ b/src/core/hle/service/nvdrv/nvdrv.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <utility> + #include "core/hle/ipc_helpers.h" #include "core/hle/service/nvdrv/devices/nvdevice.h" #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" @@ -40,14 +42,14 @@ Module::Module() { devices["/dev/nvhost-nvdec"] = std::make_shared<Devices::nvhost_nvdec>(); } -u32 Module::Open(std::string device_name) { +u32 Module::Open(const std::string& device_name) { ASSERT_MSG(devices.find(device_name) != devices.end(), "Trying to open unknown device {}", device_name); auto device = devices[device_name]; - u32 fd = next_fd++; + const u32 fd = next_fd++; - open_files[fd] = device; + open_files[fd] = std::move(device); return fd; } @@ -56,7 +58,7 @@ u32 Module::Ioctl(u32 fd, u32_le command, const std::vector<u8>& input, std::vec auto itr = open_files.find(fd); ASSERT_MSG(itr != open_files.end(), "Tried to talk to an invalid device"); - auto device = itr->second; + auto& device = itr->second; return device->ioctl({command}, input, output); } diff --git a/src/core/hle/service/nvdrv/nvdrv.h b/src/core/hle/service/nvdrv/nvdrv.h index 35b2c65fc..184f3c9fc 100644 --- a/src/core/hle/service/nvdrv/nvdrv.h +++ b/src/core/hle/service/nvdrv/nvdrv.h @@ -38,7 +38,7 @@ public: } /// Opens a device node and returns a file descriptor to it. - u32 Open(std::string device_name); + u32 Open(const std::string& device_name); /// Sends an ioctl command to the specified file descriptor. u32 Ioctl(u32 fd, u32 command, const std::vector<u8>& input, std::vector<u8>& output); /// Closes a device file descriptor and returns operation success. diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp new file mode 100644 index 000000000..e20a25689 --- /dev/null +++ b/src/core/hle/service/pm/pm.cpp @@ -0,0 +1,70 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "core/hle/service/service.h" + +namespace Service::PM { + +class BootMode final : public ServiceFramework<BootMode> { +public: + explicit BootMode() : ServiceFramework{"pm:bm"} { + static const FunctionInfo functions[] = { + {0, nullptr, "GetBootMode"}, + {1, nullptr, "SetMaintenanceBoot"}, + }; + RegisterHandlers(functions); + } +}; + +class DebugMonitor final : public ServiceFramework<DebugMonitor> { +public: + explicit DebugMonitor() : ServiceFramework{"pm:dmnt"} { + static const FunctionInfo functions[] = { + {0, nullptr, "IsDebugMode"}, + {1, nullptr, "GetDebugProcesses"}, + {2, nullptr, "StartDebugProcess"}, + {3, nullptr, "GetTitlePid"}, + {4, nullptr, "EnableDebugForTitleId"}, + {5, nullptr, "GetApplicationPid"}, + {6, nullptr, "EnableDebugForApplication"}, + }; + RegisterHandlers(functions); + } +}; + +class Info final : public ServiceFramework<Info> { +public: + explicit Info() : ServiceFramework{"pm:info"} { + static const FunctionInfo functions[] = { + {0, nullptr, "GetTitleId"}, + }; + RegisterHandlers(functions); + } +}; + +class Shell final : public ServiceFramework<Shell> { +public: + explicit Shell() : ServiceFramework{"pm:shell"} { + static const FunctionInfo functions[] = { + {0, nullptr, "LaunchProcess"}, + {1, nullptr, "TerminateProcessByPid"}, + {2, nullptr, "TerminateProcessByTitleId"}, + {3, nullptr, "GetProcessEventWaiter"}, + {4, nullptr, "GetProcessEventType"}, + {5, nullptr, "NotifyBootFinished"}, + {6, nullptr, "GetApplicationPid"}, + {7, nullptr, "BoostSystemMemoryResourceLimit"}, + }; + RegisterHandlers(functions); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared<BootMode>()->InstallAsService(sm); + std::make_shared<DebugMonitor>()->InstallAsService(sm); + std::make_shared<Info>()->InstallAsService(sm); + std::make_shared<Shell>()->InstallAsService(sm); +} + +} // namespace Service::PM diff --git a/src/core/hle/service/pm/pm.h b/src/core/hle/service/pm/pm.h new file mode 100644 index 000000000..9fc19fed6 --- /dev/null +++ b/src/core/hle/service/pm/pm.h @@ -0,0 +1,16 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +namespace Service::SM { +class ServiceManager; +} + +namespace Service::PM { + +/// Registers all PM services with the specified service manager. +void InstallInterfaces(SM::ServiceManager& service_manager); + +} // namespace Service::PM diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index b70d0d517..482989ea7 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -21,11 +21,14 @@ #include "core/hle/service/apm/apm.h" #include "core/hle/service/audio/audio.h" #include "core/hle/service/bcat/bcat.h" +#include "core/hle/service/erpt/erpt.h" #include "core/hle/service/es/es.h" +#include "core/hle/service/eupld/eupld.h" #include "core/hle/service/fatal/fatal.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/hle/service/friend/friend.h" #include "core/hle/service/hid/hid.h" +#include "core/hle/service/ldr/ldr.h" #include "core/hle/service/lm/lm.h" #include "core/hle/service/mm/mm_u.h" #include "core/hle/service/nfp/nfp.h" @@ -33,6 +36,7 @@ #include "core/hle/service/ns/ns.h" #include "core/hle/service/nvdrv/nvdrv.h" #include "core/hle/service/pctl/pctl.h" +#include "core/hle/service/pm/pm.h" #include "core/hle/service/prepo/prepo.h" #include "core/hle/service/service.h" #include "core/hle/service/set/settings.h" @@ -188,11 +192,14 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { APM::InstallInterfaces(*sm); BCAT::InstallInterfaces(*sm); Audio::InstallInterfaces(*sm); + ERPT::InstallInterfaces(*sm); ES::InstallInterfaces(*sm); + EUPLD::InstallInterfaces(*sm); Fatal::InstallInterfaces(*sm); FileSystem::InstallInterfaces(*sm); Friend::InstallInterfaces(*sm); HID::InstallInterfaces(*sm); + LDR::InstallInterfaces(*sm); LM::InstallInterfaces(*sm); MM::InstallInterfaces(*sm); NFP::InstallInterfaces(*sm); @@ -201,6 +208,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) { Nvidia::InstallInterfaces(*sm); PCTL::InstallInterfaces(*sm); PlayReport::InstallInterfaces(*sm); + PM::InstallInterfaces(*sm); Sockets::InstallInterfaces(*sm); SPL::InstallInterfaces(*sm); SSL::InstallInterfaces(*sm); |