From 5233040ab480f0d0ace929247646d9eba6e77f9f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 1 Aug 2018 21:59:22 -0400 Subject: service: Add psc services Adds the basic skeleton for the psc services based off the information provided by Switch Brew. --- src/common/logging/backend.cpp | 1 + src/common/logging/log.h | 1 + src/core/CMakeLists.txt | 2 ++ src/core/hle/service/psc/psc.cpp | 77 ++++++++++++++++++++++++++++++++++++++++ src/core/hle/service/psc/psc.h | 15 ++++++++ src/core/hle/service/service.cpp | 2 ++ 6 files changed, 98 insertions(+) create mode 100644 src/core/hle/service/psc/psc.cpp create mode 100644 src/core/hle/service/psc/psc.h diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index d6714587c..43561d607 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -192,6 +192,7 @@ void FileBackend::Write(const Entry& entry) { SUB(Service, PCTL) \ SUB(Service, PCV) \ SUB(Service, PREPO) \ + SUB(Service, PSC) \ SUB(Service, SET) \ SUB(Service, SM) \ SUB(Service, SPL) \ diff --git a/src/common/logging/log.h b/src/common/logging/log.h index e96d817f4..1763bdeaf 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -79,6 +79,7 @@ enum class Class : ClassType { Service_PCTL, ///< The PCTL (Parental control) service Service_PCV, ///< The PCV (Parental control) service Service_PREPO, ///< The PREPO (Play report) service + Service_PSC, ///< The PSC service Service_SET, ///< The SET (Settings) service Service_SM, ///< The SM (Service manager) service Service_SPL, ///< The SPL service diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 3cc9160ca..5567737a1 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -261,6 +261,8 @@ add_library(core STATIC hle/service/pm/pm.h hle/service/prepo/prepo.cpp hle/service/prepo/prepo.h + hle/service/psc/psc.cpp + hle/service/psc/psc.h hle/service/service.cpp hle/service/service.h hle/service/set/set.cpp diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp new file mode 100644 index 000000000..bbad870a2 --- /dev/null +++ b/src/core/hle/service/psc/psc.cpp @@ -0,0 +1,77 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include + +#include "common/logging/log.h" +#include "core/hle/ipc_helpers.h" +#include "core/hle/service/psc/psc.h" +#include "core/hle/service/service.h" +#include "core/hle/service/sm/sm.h" + +namespace Service::PSC { + +class PSC_C final : public ServiceFramework { +public: + explicit PSC_C() : ServiceFramework{"psc:c"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Unknown1"}, + {1, nullptr, "Unknown2"}, + {2, nullptr, "Unknown3"}, + {3, nullptr, "Unknown4"}, + {4, nullptr, "Unknown5"}, + {5, nullptr, "Unknown6"}, + {6, nullptr, "Unknown7"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class IPmModule final : public ServiceFramework { +public: + explicit IPmModule() : ServiceFramework{"IPmModule"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Initialize"}, + {1, nullptr, "GetRequest"}, + {2, nullptr, "Acknowledge"}, + {3, nullptr, "Unknown1"}, + }; + // clang-format on + + RegisterHandlers(functions); + } +}; + +class PSC_M final : public ServiceFramework { +public: + explicit PSC_M() : ServiceFramework{"psc:m"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, &PSC_M::GetPmModule, "GetPmModule"}, + }; + // clang-format on + + RegisterHandlers(functions); + } + +private: + void GetPmModule(Kernel::HLERequestContext& ctx) { + IPC::ResponseBuilder rb{ctx, 2, 0, 1}; + rb.Push(RESULT_SUCCESS); + rb.PushIpcInterface(); + + LOG_DEBUG(Service_PSC, "called"); + } +}; + +void InstallInterfaces(SM::ServiceManager& sm) { + std::make_shared()->InstallAsService(sm); + std::make_shared()->InstallAsService(sm); +} + +} // namespace Service::PSC diff --git a/src/core/hle/service/psc/psc.h b/src/core/hle/service/psc/psc.h new file mode 100644 index 000000000..5052eb02c --- /dev/null +++ b/src/core/hle/service/psc/psc.h @@ -0,0 +1,15 @@ +// 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::PSC { + +void InstallInterfaces(SM::ServiceManager& sm); + +} // namespace Service::PSC diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 828666e9b..025f0c696 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -52,6 +52,7 @@ #include "core/hle/service/pcv/pcv.h" #include "core/hle/service/pm/pm.h" #include "core/hle/service/prepo/prepo.h" +#include "core/hle/service/psc/psc.h" #include "core/hle/service/service.h" #include "core/hle/service/set/settings.h" #include "core/hle/service/sm/controller.h" @@ -238,6 +239,7 @@ void Init(std::shared_ptr& sm) { PCV::InstallInterfaces(*sm); PlayReport::InstallInterfaces(*sm); PM::InstallInterfaces(*sm); + PSC::InstallInterfaces(*sm); Set::InstallInterfaces(*sm); Sockets::InstallInterfaces(*sm); SPL::InstallInterfaces(*sm); -- cgit v1.2.3 From 42c517132298005b3882837131cccf4d27331ed0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 1 Aug 2018 22:06:56 -0400 Subject: logging/log: Remove incorrect description in PCV doc comment PCV isn't the parental control service. --- src/common/logging/log.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/logging/log.h b/src/common/logging/log.h index 1763bdeaf..b5891fb15 100644 --- a/src/common/logging/log.h +++ b/src/common/logging/log.h @@ -77,7 +77,7 @@ enum class Class : ClassType { Service_NVDRV, ///< The NVDRV (Nvidia driver) service Service_PCIE, ///< The PCIe service Service_PCTL, ///< The PCTL (Parental control) service - Service_PCV, ///< The PCV (Parental control) service + Service_PCV, ///< The PCV service Service_PREPO, ///< The PREPO (Play report) service Service_PSC, ///< The PSC service Service_SET, ///< The SET (Settings) service -- cgit v1.2.3