service/boss: Migrate to ServiceFramework (#3998)

* service/boss: Migrate to ServiceFramework

* service/boss: Addressed comments

* service/boss: Added TODO: verify ResetType
This commit is contained in:
NarcolepticK 2018-07-27 09:07:23 -04:00 committed by Weiyi Wang
parent 5a4ed10982
commit 5c52c6e64a
7 changed files with 1836 additions and 1787 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,84 +2,86 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/boss/boss.h"
#include "core/hle/service/boss/boss_p.h" #include "core/hle/service/boss/boss_p.h"
namespace Service { namespace Service {
namespace BOSS { namespace BOSS {
const Interface::FunctionInfo FunctionTable[] = { BOSS_P::BOSS_P(std::shared_ptr<Module> boss)
: Module::Interface(std::move(boss), "boss:P", DefaultMaxSessions) {
static const FunctionInfo functions[] = {
// boss:u shared commands // boss:u shared commands
{0x00010082, InitializeSession, "InitializeSession"}, // clang-format off
{0x00020100, RegisterStorage, "RegisterStorage"}, {0x00010082, &BOSS_P::InitializeSession, "InitializeSession"},
{0x00030000, UnregisterStorage, "UnregisterStorage"}, {0x00020100, &BOSS_P::SetStorageInfo, "RegisterStorage"},
{0x00040000, GetStorageInfo, "GetStorageInfo"}, {0x00030000, &BOSS_P::UnregisterStorage, "UnregisterStorage"},
{0x00050042, RegisterPrivateRootCa, "RegisterPrivateRootCa"}, {0x00040000, &BOSS_P::GetStorageInfo, "GetStorageInfo"},
{0x00060084, RegisterPrivateClientCert, "RegisterPrivateClientCert"}, {0x00050042, &BOSS_P::RegisterPrivateRootCa, "RegisterPrivateRootCa"},
{0x00070000, GetNewArrivalFlag, "GetNewArrivalFlag"}, {0x00060084, &BOSS_P::RegisterPrivateClientCert, "RegisterPrivateClientCert"},
{0x00080002, RegisterNewArrivalEvent, "RegisterNewArrivalEvent"}, {0x00070000, &BOSS_P::GetNewArrivalFlag, "GetNewArrivalFlag"},
{0x00090040, SetOptoutFlag, "SetOptoutFlag"}, {0x00080002, &BOSS_P::RegisterNewArrivalEvent, "RegisterNewArrivalEvent"},
{0x000A0000, GetOptoutFlag, "GetOptoutFlag"}, {0x00090040, &BOSS_P::SetOptoutFlag, "SetOptoutFlag"},
{0x000B00C2, RegisterTask, "RegisterTask"}, {0x000A0000, &BOSS_P::GetOptoutFlag, "GetOptoutFlag"},
{0x000C0082, UnregisterTask, "UnregisterTask"}, {0x000B00C2, &BOSS_P::RegisterTask, "RegisterTask"},
{0x000D0082, ReconfigureTask, "ReconfigureTask"}, {0x000C0082, &BOSS_P::UnregisterTask, "UnregisterTask"},
{0x000E0000, GetTaskIdList, "GetTaskIdList"}, {0x000D0082, &BOSS_P::ReconfigureTask, "ReconfigureTask"},
{0x000F0042, GetStepIdList, "GetStepIdList"}, {0x000E0000, &BOSS_P::GetTaskIdList, "GetTaskIdList"},
{0x00100102, GetNsDataIdList, "GetNsDataIdList"}, {0x000F0042, &BOSS_P::GetStepIdList, "GetStepIdList"},
{0x00110102, GetOwnNsDataIdList, "GetOwnNsDataIdList"}, {0x00100102, &BOSS_P::GetNsDataIdList, "GetNsDataIdList"},
{0x00120102, GetNewDataNsDataIdList, "GetNewDataNsDataIdList"}, {0x00110102, &BOSS_P::GetNsDataIdList1, "GetNsDataIdList1"},
{0x00130102, GetOwnNewDataNsDataIdList, "GetOwnNewDataNsDataIdList"}, {0x00120102, &BOSS_P::GetNsDataIdList2, "GetNsDataIdList2"},
{0x00140082, SendProperty, "SendProperty"}, {0x00130102, &BOSS_P::GetNsDataIdList3, "GetNsDataIdList3"},
{0x00150042, SendPropertyHandle, "SendPropertyHandle"}, {0x00140082, &BOSS_P::SendProperty, "SendProperty"},
{0x00160082, ReceiveProperty, "ReceiveProperty"}, {0x00150042, &BOSS_P::SendPropertyHandle, "SendPropertyHandle"},
{0x00170082, UpdateTaskInterval, "UpdateTaskInterval"}, {0x00160082, &BOSS_P::ReceiveProperty, "ReceiveProperty"},
{0x00180082, UpdateTaskCount, "UpdateTaskCount"}, {0x00170082, &BOSS_P::UpdateTaskInterval, "UpdateTaskInterval"},
{0x00190042, GetTaskInterval, "GetTaskInterval"}, {0x00180082, &BOSS_P::UpdateTaskCount, "UpdateTaskCount"},
{0x001A0042, GetTaskCount, "GetTaskCount"}, {0x00190042, &BOSS_P::GetTaskInterval, "GetTaskInterval"},
{0x001B0042, GetTaskServiceStatus, "GetTaskServiceStatus"}, {0x001A0042, &BOSS_P::GetTaskCount, "GetTaskCount"},
{0x001C0042, StartTask, "StartTask"}, {0x001B0042, &BOSS_P::GetTaskServiceStatus, "GetTaskServiceStatus"},
{0x001D0042, StartTaskImmediate, "StartTaskImmediate"}, {0x001C0042, &BOSS_P::StartTask, "StartTask"},
{0x001E0042, CancelTask, "CancelTask"}, {0x001D0042, &BOSS_P::StartTaskImmediate, "StartTaskImmediate"},
{0x001F0000, GetTaskFinishHandle, "GetTaskFinishHandle"}, {0x001E0042, &BOSS_P::CancelTask, "CancelTask"},
{0x00200082, GetTaskState, "GetTaskState"}, {0x001F0000, &BOSS_P::GetTaskFinishHandle, "GetTaskFinishHandle"},
{0x00210042, GetTaskResult, "GetTaskResult"}, {0x00200082, &BOSS_P::GetTaskState, "GetTaskState"},
{0x00220042, GetTaskCommErrorCode, "GetTaskCommErrorCode"}, {0x00210042, &BOSS_P::GetTaskResult, "GetTaskResult"},
{0x002300C2, GetTaskStatus, "GetTaskStatus"}, {0x00220042, &BOSS_P::GetTaskCommErrorCode, "GetTaskCommErrorCode"},
{0x00240082, GetTaskError, "GetTaskError"}, {0x002300C2, &BOSS_P::GetTaskStatus, "GetTaskStatus"},
{0x00250082, GetTaskInfo, "GetTaskInfo"}, {0x00240082, &BOSS_P::GetTaskError, "GetTaskError"},
{0x00260040, DeleteNsData, "DeleteNsData"}, {0x00250082, &BOSS_P::GetTaskInfo, "GetTaskInfo"},
{0x002700C2, GetNsDataHeaderInfo, "GetNsDataHeaderInfo"}, {0x00260040, &BOSS_P::DeleteNsData, "DeleteNsData"},
{0x00280102, ReadNsData, "ReadNsData"}, {0x002700C2, &BOSS_P::GetNsDataHeaderInfo, "GetNsDataHeaderInfo"},
{0x00290080, SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"}, {0x00280102, &BOSS_P::ReadNsData, "ReadNsData"},
{0x002A0040, GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"}, {0x00290080, &BOSS_P::SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"},
{0x002B0080, SetNsDataNewFlag, "SetNsDataNewFlag"}, {0x002A0040, &BOSS_P::GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"},
{0x002C0040, GetNsDataNewFlag, "GetNsDataNewFlag"}, {0x002B0080, &BOSS_P::SetNsDataNewFlag, "SetNsDataNewFlag"},
{0x002D0040, GetNsDataLastUpdate, "GetNsDataLastUpdate"}, {0x002C0040, &BOSS_P::GetNsDataNewFlag, "GetNsDataNewFlag"},
{0x002E0040, GetErrorCode, "GetErrorCode"}, {0x002D0040, &BOSS_P::GetNsDataLastUpdate, "GetNsDataLastUpdate"},
{0x002F0140, RegisterStorageEntry, "RegisterStorageEntry"}, {0x002E0040, &BOSS_P::GetErrorCode, "GetErrorCode"},
{0x00300000, GetStorageEntryInfo, "GetStorageEntryInfo"}, {0x002F0140, &BOSS_P::RegisterStorageEntry, "RegisterStorageEntry"},
{0x00310100, SetStorageOption, "SetStorageOption"}, {0x00300000, &BOSS_P::GetStorageEntryInfo, "GetStorageEntryInfo"},
{0x00320000, GetStorageOption, "GetStorageOption"}, {0x00310100, &BOSS_P::SetStorageOption, "SetStorageOption"},
{0x00330042, StartBgImmediate, "StartBgImmediate"}, {0x00320000, &BOSS_P::GetStorageOption, "GetStorageOption"},
{0x00340042, GetTaskActivePriority, "GetTaskActivePriority"}, {0x00330042, &BOSS_P::StartBgImmediate, "StartBgImmediate"},
{0x003500C2, RegisterImmediateTask, "RegisterImmediateTask"}, {0x00340042, &BOSS_P::GetTaskProperty0, "GetTaskProperty0"},
{0x00360084, SetTaskQuery, "SetTaskQuery"}, {0x003500C2, &BOSS_P::RegisterImmediateTask, "RegisterImmediateTask"},
{0x00370084, GetTaskQuery, "GetTaskQuery"}, {0x00360084, &BOSS_P::SetTaskQuery, "SetTaskQuery"},
{0x00370084, &BOSS_P::GetTaskQuery, "GetTaskQuery"},
// boss:p // boss:p
{0x04010082, nullptr, "InitializeSessionPrivileged"}, {0x04010082, &BOSS_P::InitializeSessionPrivileged, "InitializeSessionPrivileged"},
{0x04040080, nullptr, "GetAppNewFlag"}, {0x04040080, &BOSS_P::GetAppNewFlag, "GetAppNewFlag"},
{0x040D0182, nullptr, "GetNsDataIdListPrivileged"}, {0x040D0182, &BOSS_P::GetNsDataIdListPrivileged, "GetNsDataIdListPrivileged"},
{0x040E0182, nullptr, "GetNsDataIdListPrivileged1"}, {0x040E0182, &BOSS_P::GetNsDataIdListPrivileged1, "GetNsDataIdListPrivileged1"},
{0x04130082, nullptr, "SendPropertyPrivileged"}, {0x04130082, &BOSS_P::SendPropertyPrivileged, "SendPropertyPrivileged"},
{0x041500C0, nullptr, "DeleteNsDataPrivileged"}, {0x041500C0, &BOSS_P::DeleteNsDataPrivileged, "DeleteNsDataPrivileged"},
{0x04160142, nullptr, "GetNsDataHeaderInfoPrivileged"}, {0x04160142, &BOSS_P::GetNsDataHeaderInfoPrivileged, "GetNsDataHeaderInfoPrivileged"},
{0x04170182, nullptr, "ReadNsDataPrivileged"}, {0x04170182, &BOSS_P::ReadNsDataPrivileged, "ReadNsDataPrivileged"},
{0x041A0100, nullptr, "SetNsDataNewFlagPrivileged"}, {0x041A0100, &BOSS_P::SetNsDataNewFlagPrivileged, "SetNsDataNewFlagPrivileged"},
{0x041B00C0, nullptr, "GetNsDataNewFlagPrivileged"}, {0x041B00C0, &BOSS_P::GetNsDataNewFlagPrivileged, "GetNsDataNewFlagPrivileged"},
}; // clang-format on
};
BOSS_P_Interface::BOSS_P_Interface() { RegisterHandlers(functions);
Register(FunctionTable);
} }
} // namespace BOSS } // namespace BOSS

View File

@ -4,18 +4,14 @@
#pragma once #pragma once
#include "core/hle/service/service.h" #include "core/hle/service/boss/boss.h"
namespace Service { namespace Service {
namespace BOSS { namespace BOSS {
class BOSS_P_Interface : public Service::Interface { class BOSS_P final : public Module::Interface {
public: public:
BOSS_P_Interface(); explicit BOSS_P(std::shared_ptr<Module> boss);
std::string GetPortName() const override {
return "boss:P";
}
}; };
} // namespace BOSS } // namespace BOSS

View File

@ -2,72 +2,74 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/boss/boss.h"
#include "core/hle/service/boss/boss_u.h" #include "core/hle/service/boss/boss_u.h"
namespace Service { namespace Service {
namespace BOSS { namespace BOSS {
const Interface::FunctionInfo FunctionTable[] = { BOSS_U::BOSS_U(std::shared_ptr<Module> boss)
{0x00010082, InitializeSession, "InitializeSession"}, : Module::Interface(std::move(boss), "boss:U", DefaultMaxSessions) {
{0x00020100, RegisterStorage, "RegisterStorage"}, static const FunctionInfo functions[] = {
{0x00030000, UnregisterStorage, "UnregisterStorage"}, // clang-format off
{0x00040000, GetStorageInfo, "GetStorageInfo"}, {0x00010082, &BOSS_U::InitializeSession, "InitializeSession"},
{0x00050042, RegisterPrivateRootCa, "RegisterPrivateRootCa"}, {0x00020100, &BOSS_U::SetStorageInfo, "SetStorageInfo"},
{0x00060084, RegisterPrivateClientCert, "RegisterPrivateClientCert"}, {0x00030000, &BOSS_U::UnregisterStorage, "UnregisterStorage"},
{0x00070000, GetNewArrivalFlag, "GetNewArrivalFlag"}, {0x00040000, &BOSS_U::GetStorageInfo, "GetStorageInfo"},
{0x00080002, RegisterNewArrivalEvent, "RegisterNewArrivalEvent"}, {0x00050042, &BOSS_U::RegisterPrivateRootCa, "RegisterPrivateRootCa"},
{0x00090040, SetOptoutFlag, "SetOptoutFlag"}, {0x00060084, &BOSS_U::RegisterPrivateClientCert, "RegisterPrivateClientCert"},
{0x000A0000, GetOptoutFlag, "GetOptoutFlag"}, {0x00070000, &BOSS_U::GetNewArrivalFlag, "GetNewArrivalFlag"},
{0x000B00C2, RegisterTask, "RegisterTask"}, {0x00080002, &BOSS_U::RegisterNewArrivalEvent, "RegisterNewArrivalEvent"},
{0x000C0082, UnregisterTask, "UnregisterTask"}, {0x00090040, &BOSS_U::SetOptoutFlag, "SetOptoutFlag"},
{0x000D0082, ReconfigureTask, "ReconfigureTask"}, {0x000A0000, &BOSS_U::GetOptoutFlag, "GetOptoutFlag"},
{0x000E0000, GetTaskIdList, "GetTaskIdList"}, {0x000B00C2, &BOSS_U::RegisterTask, "RegisterTask"},
{0x000F0042, GetStepIdList, "GetStepIdList"}, {0x000C0082, &BOSS_U::UnregisterTask, "UnregisterTask"},
{0x00100102, GetNsDataIdList, "GetNsDataIdList"}, {0x000D0082, &BOSS_U::ReconfigureTask, "ReconfigureTask"},
{0x00110102, GetOwnNsDataIdList, "GetOwnNsDataIdList"}, {0x000E0000, &BOSS_U::GetTaskIdList, "GetTaskIdList"},
{0x00120102, GetNewDataNsDataIdList, "GetNewDataNsDataIdList"}, {0x000F0042, &BOSS_U::GetStepIdList, "GetStepIdList"},
{0x00130102, GetOwnNewDataNsDataIdList, "GetOwnNewDataNsDataIdList"}, {0x00100102, &BOSS_U::GetNsDataIdList, "GetNsDataIdList"},
{0x00140082, SendProperty, "SendProperty"}, {0x00110102, &BOSS_U::GetNsDataIdList1, "GetNsDataIdList1"},
{0x00150042, SendPropertyHandle, "SendPropertyHandle"}, {0x00120102, &BOSS_U::GetNsDataIdList2, "GetNsDataIdList2"},
{0x00160082, ReceiveProperty, "ReceiveProperty"}, {0x00130102, &BOSS_U::GetNsDataIdList3, "GetNsDataIdList3"},
{0x00170082, UpdateTaskInterval, "UpdateTaskInterval"}, {0x00140082, &BOSS_U::SendProperty, "SendProperty"},
{0x00180082, UpdateTaskCount, "UpdateTaskCount"}, {0x00150042, &BOSS_U::SendPropertyHandle, "SendPropertyHandle"},
{0x00190042, GetTaskInterval, "GetTaskInterval"}, {0x00160082, &BOSS_U::ReceiveProperty, "ReceiveProperty"},
{0x001A0042, GetTaskCount, "GetTaskCount"}, {0x00170082, &BOSS_U::UpdateTaskInterval, "UpdateTaskInterval"},
{0x001B0042, GetTaskServiceStatus, "GetTaskServiceStatus"}, {0x00180082, &BOSS_U::UpdateTaskCount, "UpdateTaskCount"},
{0x001C0042, StartTask, "StartTask"}, {0x00190042, &BOSS_U::GetTaskInterval, "GetTaskInterval"},
{0x001D0042, StartTaskImmediate, "StartTaskImmediate"}, {0x001A0042, &BOSS_U::GetTaskCount, "GetTaskCount"},
{0x001E0042, CancelTask, "CancelTask"}, {0x001B0042, &BOSS_U::GetTaskServiceStatus, "GetTaskServiceStatus"},
{0x001F0000, GetTaskFinishHandle, "GetTaskFinishHandle"}, {0x001C0042, &BOSS_U::StartTask, "StartTask"},
{0x00200082, GetTaskState, "GetTaskState"}, {0x001D0042, &BOSS_U::StartTaskImmediate, "StartTaskImmediate"},
{0x00210042, GetTaskResult, "GetTaskResult"}, {0x001E0042, &BOSS_U::CancelTask, "CancelTask"},
{0x00220042, GetTaskCommErrorCode, "GetTaskCommErrorCode"}, {0x001F0000, &BOSS_U::GetTaskFinishHandle, "GetTaskFinishHandle"},
{0x002300C2, GetTaskStatus, "GetTaskStatus"}, {0x00200082, &BOSS_U::GetTaskState, "GetTaskState"},
{0x00240082, GetTaskError, "GetTaskError"}, {0x00210042, &BOSS_U::GetTaskResult, "GetTaskResult"},
{0x00250082, GetTaskInfo, "GetTaskInfo"}, {0x00220042, &BOSS_U::GetTaskCommErrorCode, "GetTaskCommErrorCode"},
{0x00260040, DeleteNsData, "DeleteNsData"}, {0x002300C2, &BOSS_U::GetTaskStatus, "GetTaskStatus"},
{0x002700C2, GetNsDataHeaderInfo, "GetNsDataHeaderInfo"}, {0x00240082, &BOSS_U::GetTaskError, "GetTaskError"},
{0x00280102, ReadNsData, "ReadNsData"}, {0x00250082, &BOSS_U::GetTaskInfo, "GetTaskInfo"},
{0x00290080, SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"}, {0x00260040, &BOSS_U::DeleteNsData, "DeleteNsData"},
{0x002A0040, GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"}, {0x002700C2, &BOSS_U::GetNsDataHeaderInfo, "GetNsDataHeaderInfo"},
{0x002B0080, SetNsDataNewFlag, "SetNsDataNewFlag"}, {0x00280102, &BOSS_U::ReadNsData, "ReadNsData"},
{0x002C0040, GetNsDataNewFlag, "GetNsDataNewFlag"}, {0x00290080, &BOSS_U::SetNsDataAdditionalInfo, "SetNsDataAdditionalInfo"},
{0x002D0040, GetNsDataLastUpdate, "GetNsDataLastUpdate"}, {0x002A0040, &BOSS_U::GetNsDataAdditionalInfo, "GetNsDataAdditionalInfo"},
{0x002E0040, GetErrorCode, "GetErrorCode"}, {0x002B0080, &BOSS_U::SetNsDataNewFlag, "SetNsDataNewFlag"},
{0x002F0140, RegisterStorageEntry, "RegisterStorageEntry"}, {0x002C0040, &BOSS_U::GetNsDataNewFlag, "GetNsDataNewFlag"},
{0x00300000, GetStorageEntryInfo, "GetStorageEntryInfo"}, {0x002D0040, &BOSS_U::GetNsDataLastUpdate, "GetNsDataLastUpdate"},
{0x00310100, SetStorageOption, "SetStorageOption"}, {0x002E0040, &BOSS_U::GetErrorCode, "GetErrorCode"},
{0x00320000, GetStorageOption, "GetStorageOption"}, {0x002F0140, &BOSS_U::RegisterStorageEntry, "RegisterStorageEntry"},
{0x00330042, StartBgImmediate, "StartBgImmediate"}, {0x00300000, &BOSS_U::GetStorageEntryInfo, "GetStorageEntryInfo"},
{0x00340042, GetTaskActivePriority, "GetTaskActivePriority"}, {0x00310100, &BOSS_U::SetStorageOption, "SetStorageOption"},
{0x003500C2, RegisterImmediateTask, "RegisterImmediateTask"}, {0x00320000, &BOSS_U::GetStorageOption, "GetStorageOption"},
{0x00360084, SetTaskQuery, "SetTaskQuery"}, {0x00330042, &BOSS_U::StartBgImmediate, "StartBgImmediate"},
{0x00370084, GetTaskQuery, "GetTaskQuery"}, {0x00340042, &BOSS_U::GetTaskProperty0, "GetTaskProperty0"},
}; {0x003500C2, &BOSS_U::RegisterImmediateTask, "RegisterImmediateTask"},
{0x00360084, &BOSS_U::SetTaskQuery, "SetTaskQuery"},
{0x00370084, &BOSS_U::GetTaskQuery, "GetTaskQuery"},
// clang-format on
};
BOSS_U_Interface::BOSS_U_Interface() { RegisterHandlers(functions);
Register(FunctionTable);
} }
} // namespace BOSS } // namespace BOSS

View File

@ -4,18 +4,14 @@
#pragma once #pragma once
#include "core/hle/service/service.h" #include "core/hle/service/boss/boss.h"
namespace Service { namespace Service {
namespace BOSS { namespace BOSS {
class BOSS_U_Interface : public Service::Interface { class BOSS_U final : public Module::Interface {
public: public:
BOSS_U_Interface(); explicit BOSS_U(std::shared_ptr<Module> boss);
std::string GetPortName() const override {
return "boss:U";
}
}; };
} // namespace BOSS } // namespace BOSS

View File

@ -239,7 +239,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
ACT::InstallInterfaces(*sm); ACT::InstallInterfaces(*sm);
AM::InstallInterfaces(*sm); AM::InstallInterfaces(*sm);
APT::InstallInterfaces(*sm); APT::InstallInterfaces(*sm);
BOSS::Init(); BOSS::InstallInterfaces(*sm);
CAM::InstallInterfaces(*sm); CAM::InstallInterfaces(*sm);
CECD::InstallInterfaces(*sm); CECD::InstallInterfaces(*sm);
CFG::InstallInterfaces(*sm); CFG::InstallInterfaces(*sm);
@ -269,7 +269,6 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
/// Shutdown ServiceManager /// Shutdown ServiceManager
void Shutdown() { void Shutdown() {
BOSS::Shutdown();
FS::ArchiveShutdown(); FS::ArchiveShutdown();
g_kernel_named_ports.clear(); g_kernel_named_ports.clear();