Merge pull request #3893 from NarcolepticK/dlp-migrate-framework

service/dlp: Migrate to ServiceFramework
This commit is contained in:
Weiyi Wang 2018-06-29 17:39:17 +03:00 committed by GitHub
commit 1eeccdd556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 98 additions and 100 deletions

View File

@ -6,18 +6,15 @@
#include "core/hle/service/dlp/dlp_clnt.h"
#include "core/hle/service/dlp/dlp_fkcl.h"
#include "core/hle/service/dlp/dlp_srvr.h"
#include "core/hle/service/service.h"
namespace Service {
namespace DLP {
void Init() {
AddService(new DLP_CLNT_Interface);
AddService(new DLP_FKCL_Interface);
AddService(new DLP_SRVR_Interface);
void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<DLP_CLNT>()->InstallAsService(service_manager);
std::make_shared<DLP_FKCL>()->InstallAsService(service_manager);
std::make_shared<DLP_SRVR>()->InstallAsService(service_manager);
}
void Shutdown() {}
} // namespace DLP
} // namespace Service

View File

@ -4,14 +4,13 @@
#pragma once
#include "core/hle/service/service.h"
namespace Service {
namespace DLP {
/// Initializes the DLP services.
void Init();
/// Shuts down the DLP services.
void Shutdown();
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace DLP
} // namespace Service

View File

@ -2,36 +2,39 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/dlp/dlp_clnt.h"
namespace Service {
namespace DLP {
const Interface::FunctionInfo FunctionTable[] = {
{0x000100C3, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetEventDesc"},
{0x00040000, nullptr, "GetChannel"},
{0x00050180, nullptr, "StartScan"},
{0x00060000, nullptr, "StopScan"},
{0x00070080, nullptr, "GetServerInfo"},
{0x00080100, nullptr, "GetTitleInfo"},
{0x00090040, nullptr, "GetTitleInfoInOrder"},
{0x000A0080, nullptr, "DeleteScanInfo"},
{0x000B0100, nullptr, "PrepareForSystemDownload"},
{0x000C0000, nullptr, "StartSystemDownload"},
{0x000D0100, nullptr, "StartTitleDownload"},
{0x000E0000, nullptr, "GetMyStatus"},
{0x000F0040, nullptr, "GetConnectingNodes"},
{0x00100040, nullptr, "GetNodeInfo"},
{0x00110000, nullptr, "GetWirelessRebootPassphrase"},
{0x00120000, nullptr, "StopSession"},
{0x00130100, nullptr, "GetCupVersion"},
{0x00140100, nullptr, "GetDupAvailability"},
};
DLP_CLNT::DLP_CLNT() : ServiceFramework("dlp:CLNT", 1) {
static const FunctionInfo functions[] = {
// clang-format off
{0x000100C3, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetEventDesc"},
{0x00040000, nullptr, "GetChannel"},
{0x00050180, nullptr, "StartScan"},
{0x00060000, nullptr, "StopScan"},
{0x00070080, nullptr, "GetServerInfo"},
{0x00080100, nullptr, "GetTitleInfo"},
{0x00090040, nullptr, "GetTitleInfoInOrder"},
{0x000A0080, nullptr, "DeleteScanInfo"},
{0x000B0100, nullptr, "PrepareForSystemDownload"},
{0x000C0000, nullptr, "StartSystemDownload"},
{0x000D0100, nullptr, "StartTitleDownload"},
{0x000E0000, nullptr, "GetMyStatus"},
{0x000F0040, nullptr, "GetConnectingNodes"},
{0x00100040, nullptr, "GetNodeInfo"},
{0x00110000, nullptr, "GetWirelessRebootPassphrase"},
{0x00120000, nullptr, "StopSession"},
{0x00130100, nullptr, "GetCupVersion"},
{0x00140100, nullptr, "GetDupAvailability"},
// clang-format on
};
DLP_CLNT_Interface::DLP_CLNT_Interface() {
Register(FunctionTable);
RegisterHandlers(functions);
}
} // namespace DLP

View File

@ -9,13 +9,10 @@
namespace Service {
namespace DLP {
class DLP_CLNT_Interface final : public Interface {
class DLP_CLNT final : public ServiceFramework<DLP_CLNT> {
public:
DLP_CLNT_Interface();
std::string GetPortName() const override {
return "dlp:CLNT";
}
DLP_CLNT();
~DLP_CLNT() = default;
};
} // namespace DLP

View File

@ -2,33 +2,36 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/ipc_helpers.h"
#include "core/hle/service/dlp/dlp_fkcl.h"
namespace Service {
namespace DLP {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010083, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetEventDesc"},
{0x00040000, nullptr, "GetChannels"},
{0x00050180, nullptr, "StartScan"},
{0x00060000, nullptr, "StopScan"},
{0x00070080, nullptr, "GetServerInfo"},
{0x00080100, nullptr, "GetTitleInfo"},
{0x00090040, nullptr, "GetTitleInfoInOrder"},
{0x000A0080, nullptr, "DeleteScanInfo"},
{0x000B0100, nullptr, "StartFakeSession"},
{0x000C0000, nullptr, "GetMyStatus"},
{0x000D0040, nullptr, "GetConnectingNodes"},
{0x000E0040, nullptr, "GetNodeInfo"},
{0x000F0000, nullptr, "GetWirelessRebootPassphrase"},
{0x00100000, nullptr, "StopSession"},
{0x00110203, nullptr, "Initialize2"},
};
DLP_FKCL::DLP_FKCL() : ServiceFramework("dlp:FKCL", 1) {
static const FunctionInfo functions[] = {
// clang-format off
{0x00010083, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetEventDesc"},
{0x00040000, nullptr, "GetChannels"},
{0x00050180, nullptr, "StartScan"},
{0x00060000, nullptr, "StopScan"},
{0x00070080, nullptr, "GetServerInfo"},
{0x00080100, nullptr, "GetTitleInfo"},
{0x00090040, nullptr, "GetTitleInfoInOrder"},
{0x000A0080, nullptr, "DeleteScanInfo"},
{0x000B0100, nullptr, "StartFakeSession"},
{0x000C0000, nullptr, "GetMyStatus"},
{0x000D0040, nullptr, "GetConnectingNodes"},
{0x000E0040, nullptr, "GetNodeInfo"},
{0x000F0000, nullptr, "GetWirelessRebootPassphrase"},
{0x00100000, nullptr, "StopSession"},
{0x00110203, nullptr, "Initialize2"},
// clang-format on
};
DLP_FKCL_Interface::DLP_FKCL_Interface() {
Register(FunctionTable);
RegisterHandlers(functions);
}
} // namespace DLP

View File

@ -9,13 +9,10 @@
namespace Service {
namespace DLP {
class DLP_FKCL_Interface final : public Interface {
class DLP_FKCL final : public ServiceFramework<DLP_FKCL> {
public:
DLP_FKCL_Interface();
std::string GetPortName() const override {
return "dlp:FKCL";
}
DLP_FKCL();
~DLP_FKCL() = default;
};
} // namespace DLP

View File

@ -4,43 +4,46 @@
#include "common/common_types.h"
#include "common/logging/log.h"
#include "core/hle/ipc.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/result.h"
#include "core/hle/service/dlp/dlp_srvr.h"
namespace Service {
namespace DLP {
static void IsChild(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
void DLP_SRVR::IsChild(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0E, 0, 0);
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
rb.Push(RESULT_SUCCESS);
rb.Push(false);
NGLOG_WARNING(Service_DLP, "(STUBBED) called");
}
const Interface::FunctionInfo FunctionTable[] = {
{0x00010183, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetServerState"},
{0x00040000, nullptr, "GetEventDescription"},
{0x00050080, nullptr, "StartAccepting"},
{0x00060000, nullptr, "EndAccepting"},
{0x00070000, nullptr, "StartDistribution"},
{0x000800C0, nullptr, "SendWirelessRebootPassphrase"},
{0x00090040, nullptr, "AcceptClient"},
{0x000A0040, nullptr, "DisconnectClient"},
{0x000B0042, nullptr, "GetConnectingClients"},
{0x000C0040, nullptr, "GetClientInfo"},
{0x000D0040, nullptr, "GetClientState"},
{0x000E0040, IsChild, "IsChild"},
{0x000F0303, nullptr, "InitializeWithName"},
{0x00100000, nullptr, "GetDupNoticeNeed"},
};
DLP_SRVR::DLP_SRVR() : ServiceFramework("dlp:SRVR", 1) {
static const FunctionInfo functions[] = {
// clang-format off
{0x00010183, nullptr, "Initialize"},
{0x00020000, nullptr, "Finalize"},
{0x00030000, nullptr, "GetServerState"},
{0x00040000, nullptr, "GetEventDescription"},
{0x00050080, nullptr, "StartAccepting"},
{0x00060000, nullptr, "EndAccepting"},
{0x00070000, nullptr, "StartDistribution"},
{0x000800C0, nullptr, "SendWirelessRebootPassphrase"},
{0x00090040, nullptr, "AcceptClient"},
{0x000A0040, nullptr, "DisconnectClient"},
{0x000B0042, nullptr, "GetConnectingClients"},
{0x000C0040, nullptr, "GetClientInfo"},
{0x000D0040, nullptr, "GetClientState"},
{0x000E0040, &DLP_SRVR::IsChild, "IsChild"},
{0x000F0303, nullptr, "InitializeWithName"},
{0x00100000, nullptr, "GetDupNoticeNeed"},
// clang-format on
};
DLP_SRVR_Interface::DLP_SRVR_Interface() {
Register(FunctionTable);
RegisterHandlers(functions);
}
} // namespace DLP

View File

@ -9,13 +9,13 @@
namespace Service {
namespace DLP {
class DLP_SRVR_Interface final : public Interface {
class DLP_SRVR final : public ServiceFramework<DLP_SRVR> {
public:
DLP_SRVR_Interface();
DLP_SRVR();
~DLP_SRVR() = default;
std::string GetPortName() const override {
return "dlp:SRVR";
}
private:
void IsChild(Kernel::HLERequestContext& ctx);
};
} // namespace DLP

View File

@ -242,7 +242,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
CAM::InstallInterfaces(*sm);
CECD::Init();
CFG::InstallInterfaces(*sm);
DLP::Init();
DLP::InstallInterfaces(*sm);
FRD::InstallInterfaces(*sm);
GSP::InstallInterfaces(*sm);
HID::InstallInterfaces(*sm);
@ -269,7 +269,6 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
/// Shutdown ServiceManager
void Shutdown() {
DLP::Shutdown();
CECD::Shutdown();
BOSS::Shutdown();
FS::ArchiveShutdown();