2026-08-18 18:11:33 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
2022-06-26 18:48:12 -05:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
#include "core/core.h"
|
|
|
|
|
#include "core/hle/service/ptm/psm.h"
|
|
|
|
|
#include "core/hle/service/ptm/ptm.h"
|
|
|
|
|
#include "core/hle/service/ptm/ts.h"
|
2023-02-18 16:26:48 -05:00
|
|
|
#include "core/hle/service/server_manager.h"
|
2022-06-26 18:48:12 -05:00
|
|
|
|
|
|
|
|
namespace Service::PTM {
|
|
|
|
|
|
2026-08-18 18:11:33 +02:00
|
|
|
class PSM_MANU final : public ServiceFramework<PSM_MANU> {
|
|
|
|
|
public:
|
|
|
|
|
explicit PSM_MANU(Core::System& system_)
|
|
|
|
|
: ServiceFramework{system_, "psm:manu"} {
|
|
|
|
|
// clang-format off
|
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
|
{0, nullptr, "EnableVdd50StateControl"},
|
|
|
|
|
{1, nullptr, "DisableVdd50StateControl"},
|
|
|
|
|
{2, nullptr, "SetVdd50State"},
|
|
|
|
|
};
|
|
|
|
|
// clang-format on
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class POWCTL final : public ServiceFramework<POWCTL> {
|
|
|
|
|
public:
|
|
|
|
|
explicit POWCTL(Core::System& system_)
|
|
|
|
|
: ServiceFramework{system_, "powctl"} {
|
|
|
|
|
// clang-format off
|
|
|
|
|
static const FunctionInfo functions[] = {
|
|
|
|
|
{0, nullptr, "OpenSession"},
|
|
|
|
|
};
|
|
|
|
|
// clang-format on
|
|
|
|
|
RegisterHandlers(functions);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-18 16:26:48 -05:00
|
|
|
void LoopProcess(Core::System& system) {
|
|
|
|
|
auto server_manager = std::make_unique<ServerManager>(system);
|
|
|
|
|
|
|
|
|
|
server_manager->RegisterNamedService("psm", std::make_shared<PSM>(system));
|
2026-08-18 18:11:33 +02:00
|
|
|
if (1 /* not retail */) {
|
|
|
|
|
server_manager->RegisterNamedService("psm:manu", std::make_shared<PSM_MANU>(system));
|
|
|
|
|
server_manager->RegisterNamedService("powctl", std::make_shared<POWCTL>(system));
|
|
|
|
|
}
|
2023-02-18 16:26:48 -05:00
|
|
|
server_manager->RegisterNamedService("ts", std::make_shared<TS>(system));
|
|
|
|
|
ServerManager::RunServer(std::move(server_manager));
|
2022-06-26 18:48:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Service::PTM
|