2022-04-23 08:59:50 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-08-02 01:59:22 +00:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#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<PSC_C> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit PSC_C(Core::System& system_) : ServiceFramework{system_, "psc:c"} {
|
2018-08-02 01:59:22 +00:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
2019-01-30 02:16:22 +00:00
|
|
|
{0, nullptr, "Initialize"},
|
|
|
|
{1, nullptr, "DispatchRequest"},
|
|
|
|
{2, nullptr, "GetResult"},
|
|
|
|
{3, nullptr, "GetState"},
|
|
|
|
{4, nullptr, "Cancel"},
|
|
|
|
{5, nullptr, "PrintModuleInformation"},
|
|
|
|
{6, nullptr, "GetModuleInformation"},
|
2020-06-29 02:01:34 +00:00
|
|
|
{10, nullptr, "Unknown10"},
|
|
|
|
{11, nullptr, "Unknown11"},
|
2018-08-02 01:59:22 +00:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class IPmModule final : public ServiceFramework<IPmModule> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit IPmModule(Core::System& system_) : ServiceFramework{system_, "IPmModule"} {
|
2018-08-02 01:59:22 +00:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, nullptr, "Initialize"},
|
|
|
|
{1, nullptr, "GetRequest"},
|
|
|
|
{2, nullptr, "Acknowledge"},
|
2019-01-30 02:16:22 +00:00
|
|
|
{3, nullptr, "Finalize"},
|
|
|
|
{4, nullptr, "AcknowledgeEx"},
|
2018-08-02 01:59:22 +00:00
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class PSC_M final : public ServiceFramework<PSC_M> {
|
|
|
|
public:
|
2020-11-26 20:19:08 +00:00
|
|
|
explicit PSC_M(Core::System& system_) : ServiceFramework{system_, "psc:m"} {
|
2018-08-02 01:59:22 +00:00
|
|
|
// clang-format off
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
{0, &PSC_M::GetPmModule, "GetPmModule"},
|
|
|
|
};
|
|
|
|
// clang-format on
|
|
|
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void GetPmModule(Kernel::HLERequestContext& ctx) {
|
2018-11-26 06:06:13 +00:00
|
|
|
LOG_DEBUG(Service_PSC, "called");
|
|
|
|
|
2018-08-02 01:59:22 +00:00
|
|
|
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
2021-05-21 05:05:04 +00:00
|
|
|
rb.Push(ResultSuccess);
|
2020-11-26 20:19:08 +00:00
|
|
|
rb.PushIpcInterface<IPmModule>(system);
|
2018-08-02 01:59:22 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-11-26 20:19:08 +00:00
|
|
|
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
|
|
|
|
std::make_shared<PSC_C>(system)->InstallAsService(sm);
|
|
|
|
std::make_shared<PSC_M>(system)->InstallAsService(sm);
|
2018-08-02 01:59:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Service::PSC
|