mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-04 13:24:19 +00:00
@@ -343,28 +343,8 @@ public:
|
|||||||
|
|
||||||
class IProfileCommon : public ServiceFramework<IProfileCommon> {
|
class IProfileCommon : public ServiceFramework<IProfileCommon> {
|
||||||
public:
|
public:
|
||||||
explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands,
|
explicit IProfileCommon(Core::System& system_, const char* name, bool editor_commands, Common::UUID user_id_, ProfileManager& profile_manager_)
|
||||||
Common::UUID user_id_, ProfileManager& profile_manager_)
|
|
||||||
: ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
|
: ServiceFramework{system_, name}, profile_manager{profile_manager_}, user_id{user_id_} {
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &IProfileCommon::Get, "Get"},
|
|
||||||
FunctionInfo{1, &IProfileCommon::GetBase, "GetBase"},
|
|
||||||
FunctionInfo{10, &IProfileCommon::GetImageSize, "GetImageSize"},
|
|
||||||
FunctionInfo{11, &IProfileCommon::LoadImage, "LoadImage"},
|
|
||||||
FunctionInfo{20, &IProfileCommon::Unknown20, "Unknown20"},
|
|
||||||
FunctionInfo{21, &IProfileCommon::Unknown21, "Unknown21"},
|
|
||||||
FunctionInfo{30, &IProfileCommon::Unknown30, "Unknown30"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
|
|
||||||
if (editor_commands) {
|
|
||||||
static const FunctionInfo editor_functions[] = {
|
|
||||||
FunctionInfo{100, &IProfileCommon::Store, "Store"},
|
|
||||||
FunctionInfo{101, &IProfileCommon::StoreWithImage, "StoreWithImage"},
|
|
||||||
FunctionInfo{110, &IProfileCommon::Unknown110, "Unknown110"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(editor_functions);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -591,6 +571,22 @@ protected:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &IProfileCommon::Get, "Get"},
|
||||||
|
FunctionInfo{1, &IProfileCommon::GetBase, "GetBase"},
|
||||||
|
FunctionInfo{10, &IProfileCommon::GetImageSize, "GetImageSize"},
|
||||||
|
FunctionInfo{11, &IProfileCommon::LoadImage, "LoadImage"},
|
||||||
|
FunctionInfo{20, &IProfileCommon::Unknown20, "Unknown20"},
|
||||||
|
FunctionInfo{21, &IProfileCommon::Unknown21, "Unknown21"},
|
||||||
|
FunctionInfo{30, &IProfileCommon::Unknown30, "Unknown30"},
|
||||||
|
// Editor commands
|
||||||
|
FunctionInfo{100, &IProfileCommon::Store, "Store"},
|
||||||
|
FunctionInfo{101, &IProfileCommon::StoreWithImage, "StoreWithImage"},
|
||||||
|
FunctionInfo{110, &IProfileCommon::Unknown110, "Unknown110"}
|
||||||
|
);
|
||||||
ProfileManager& profile_manager;
|
ProfileManager& profile_manager;
|
||||||
Common::UUID user_id{}; ///< The user id this profile refers to.
|
Common::UUID user_id{}; ///< The user id this profile refers to.
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,15 +14,7 @@ namespace Service::APM {
|
|||||||
|
|
||||||
class ISession final : public ServiceFramework<ISession> {
|
class ISession final : public ServiceFramework<ISession> {
|
||||||
public:
|
public:
|
||||||
explicit ISession(Core::System& system_, Controller& controller_)
|
explicit ISession(Core::System& system_, Controller& controller_) : ServiceFramework{system_, "ISession"}, controller{controller_} {}
|
||||||
: ServiceFramework{system_, "ISession"}, controller{controller_} {
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"},
|
|
||||||
FunctionInfo{1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"},
|
|
||||||
FunctionInfo{2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetPerformanceConfiguration(HLERequestContext& ctx) {
|
void SetPerformanceConfiguration(HLERequestContext& ctx) {
|
||||||
@@ -61,6 +53,14 @@ private:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &ISession::SetPerformanceConfiguration, "SetPerformanceConfiguration"},
|
||||||
|
FunctionInfo{1, &ISession::GetPerformanceConfiguration, "GetPerformanceConfiguration"},
|
||||||
|
FunctionInfo{2, &ISession::SetCpuOverclockEnabled, "SetCpuOverclockEnabled"}
|
||||||
|
);
|
||||||
Controller& controller;
|
Controller& controller;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,15 @@ namespace Service::GPIO {
|
|||||||
|
|
||||||
class GPIO final : public ServiceFramework<GPIO> {
|
class GPIO final : public ServiceFramework<GPIO> {
|
||||||
public:
|
public:
|
||||||
explicit GPIO(Core::System& system_)
|
explicit GPIO(Core::System& system_) : ServiceFramework{system_, "gpio"} {}
|
||||||
: ServiceFramework{system_, "gpio"}
|
|
||||||
{
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "Cmd0"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
~GPIO() override = default;
|
~GPIO() override = default;
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "Cmd0"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -17,25 +17,26 @@ namespace Service::I2C {
|
|||||||
|
|
||||||
class I2CSession final : public ServiceFramework<I2CSession> {
|
class I2CSession final : public ServiceFramework<I2CSession> {
|
||||||
public:
|
public:
|
||||||
explicit I2CSession(Core::System& system_)
|
explicit I2CSession(Core::System& system_) : ServiceFramework{system_, "I2CSession"} {}
|
||||||
: ServiceFramework{system_, "I2CSession"}
|
|
||||||
{
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "SendOld"},
|
|
||||||
FunctionInfo{1, nullptr, "ReceiveOld"},
|
|
||||||
FunctionInfo{2, nullptr, "ExecuteCommandListOld"},
|
|
||||||
FunctionInfo{10, C<&I2CSession::Send>, "Send"},
|
|
||||||
FunctionInfo{11, nullptr, "Receive"},
|
|
||||||
FunctionInfo{12, nullptr, "ExecuteCommandList"},
|
|
||||||
FunctionInfo{13, nullptr, "SetRetryPolicy"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
~I2CSession() override = default;
|
~I2CSession() override = default;
|
||||||
|
|
||||||
Result Send(InBuffer<BufferAttr_HipcMapAlias> in_data, u32 transaction_option) {
|
Result Send(InBuffer<BufferAttr_HipcMapAlias> in_data, u32 transaction_option) {
|
||||||
LOG_WARNING(Service, "(stubbed) topt={}", transaction_option);
|
LOG_WARNING(Service, "(stubbed) topt={}", transaction_option);
|
||||||
R_THROW(ResultUnknown);
|
R_THROW(ResultUnknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "SendOld"},
|
||||||
|
FunctionInfo{1, nullptr, "ReceiveOld"},
|
||||||
|
FunctionInfo{2, nullptr, "ExecuteCommandListOld"},
|
||||||
|
FunctionInfo{10, C<&I2CSession::Send>, "Send"},
|
||||||
|
FunctionInfo{11, nullptr, "Receive"},
|
||||||
|
FunctionInfo{12, nullptr, "ExecuteCommandList"},
|
||||||
|
FunctionInfo{13, nullptr, "SetRetryPolicy"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class I2CDevice : u32 {
|
enum class I2CDevice : u32 {
|
||||||
@@ -45,19 +46,9 @@ enum class I2CDevice : u32 {
|
|||||||
|
|
||||||
class I2C final : public ServiceFramework<I2C> {
|
class I2C final : public ServiceFramework<I2C> {
|
||||||
public:
|
public:
|
||||||
explicit I2C(Core::System& system_)
|
explicit I2C(Core::System& system_) : ServiceFramework{system_, "i2c"} {}
|
||||||
: ServiceFramework{system_, "i2c"}
|
|
||||||
{
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"},
|
|
||||||
FunctionInfo{1, C<&I2C::OpenSession>, "OpenSession"},
|
|
||||||
FunctionInfo{2, C<&I2C::HasDevice>, "HasDevice"},
|
|
||||||
FunctionInfo{3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"},
|
|
||||||
FunctionInfo{4, C<&I2C::OpenSession2>, "OpenSession2"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
~I2C() override = default;
|
~I2C() override = default;
|
||||||
|
|
||||||
Result OpenSessionForDev(OutInterface<I2CSession> out_session, s32 bus_idx, u32 slave_address, u32 addressing_mode, u32 speed_mode) {
|
Result OpenSessionForDev(OutInterface<I2CSession> out_session, s32 bus_idx, u32 slave_address, u32 addressing_mode, u32 speed_mode) {
|
||||||
LOG_DEBUG(Service, "(stubbed)");
|
LOG_DEBUG(Service, "(stubbed)");
|
||||||
*out_session = std::make_shared<I2CSession>(system);
|
*out_session = std::make_shared<I2CSession>(system);
|
||||||
@@ -83,6 +74,17 @@ public:
|
|||||||
*out_session = std::make_shared<I2CSession>(system);
|
*out_session = std::make_shared<I2CSession>(system);
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, C<&I2C::OpenSessionForDev>, "OpenSessionForDev"},
|
||||||
|
FunctionInfo{1, C<&I2C::OpenSession>, "OpenSession"},
|
||||||
|
FunctionInfo{2, C<&I2C::HasDevice>, "HasDevice"},
|
||||||
|
FunctionInfo{3, C<&I2C::HasDeviceForDev>, "HasDeviceForDev"},
|
||||||
|
FunctionInfo{4, C<&I2C::OpenSession2>, "OpenSession2"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -87,16 +87,7 @@ DECLARE_ENUM_FLAG_OPERATORS(LogPacketFlags);
|
|||||||
|
|
||||||
class ILogger final : public ServiceFramework<ILogger> {
|
class ILogger final : public ServiceFramework<ILogger> {
|
||||||
public:
|
public:
|
||||||
explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {
|
explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &ILogger::Log, "Log"},
|
|
||||||
FunctionInfo{1, &ILogger::SetDestination, "SetDestination"},
|
|
||||||
FunctionInfo{2, nullptr, "TransmitHashedLog"}, //20.0.0+
|
|
||||||
FunctionInfo{3, nullptr, "DevNotify"}, //20.0.0+
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Log(HLERequestContext& ctx) {
|
void Log(HLERequestContext& ctx) {
|
||||||
std::size_t offset{};
|
std::size_t offset{};
|
||||||
@@ -331,6 +322,15 @@ private:
|
|||||||
};
|
};
|
||||||
static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size");
|
static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size");
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &ILogger::Log, "Log"},
|
||||||
|
FunctionInfo{1, &ILogger::SetDestination, "SetDestination"},
|
||||||
|
FunctionInfo{2, nullptr, "TransmitHashedLog"}, //20.0.0+
|
||||||
|
FunctionInfo{3, nullptr, "DevNotify"} //20.0.0+
|
||||||
|
);
|
||||||
::Common::unordered_map<LogPacketHeaderEntry, std::vector<u8>> entries{};
|
::Common::unordered_map<LogPacketHeaderEntry, std::vector<u8>> entries{};
|
||||||
LogDestination destination{LogDestination::All};
|
LogDestination destination{LogDestination::All};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -425,12 +425,14 @@ class NCM_V final : public ServiceFramework<NCM_V> {
|
|||||||
public:
|
public:
|
||||||
explicit NCM_V(Core::System& system_)
|
explicit NCM_V(Core::System& system_)
|
||||||
: ServiceFramework{system_, "ncm:v"}
|
: ServiceFramework{system_, "ncm:v"}
|
||||||
{
|
{}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "GetSystemVersion"}
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
};
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "GetSystemVersion"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -18,68 +18,71 @@ namespace Service::NFC {
|
|||||||
|
|
||||||
class IUser final : public NfcInterface {
|
class IUser final : public NfcInterface {
|
||||||
public:
|
public:
|
||||||
explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) {
|
explicit IUser(Core::System& system_) : NfcInterface(system_, "NFC::IUser", BackendType::Nfc) {}
|
||||||
static const FunctionInfoTyped<IUser> functions[] = {
|
|
||||||
FunctionInfoTyped<IUser>{0, &NfcInterface::Initialize, "InitializeOld"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<IUser>{1, &NfcInterface::Finalize, "FinalizeOld"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<IUser>{2, &NfcInterface::GetState, "GetStateOld"},
|
|
||||||
FunctionInfoTyped<IUser>{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"},
|
|
||||||
FunctionInfoTyped<IUser>{400, &NfcInterface::Initialize, "Initialize"},
|
|
||||||
FunctionInfoTyped<IUser>{401, &NfcInterface::Finalize, "Finalize"},
|
|
||||||
FunctionInfoTyped<IUser>{402, &NfcInterface::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<IUser>{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"},
|
|
||||||
FunctionInfoTyped<IUser>{404, &NfcInterface::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<IUser>{405, &NfcInterface::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<IUser>{406, &NfcInterface::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<IUser>{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{408, &NfcInterface::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<IUser>{409, &NfcInterface::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<IUser>{410, &NfcInterface::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<IUser>{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{1000, &NfcInterface::ReadMifare, "ReadMifare"},
|
|
||||||
FunctionInfoTyped<IUser>{1001, &NfcInterface::WriteMifare ,"WriteMifare"},
|
|
||||||
FunctionInfoTyped<IUser>{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"},
|
|
||||||
FunctionInfoTyped<IUser>{1301, nullptr, "KeepPassThroughSession"},
|
|
||||||
FunctionInfoTyped<IUser>{1302, nullptr, "ReleasePassThroughSession"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<IUser>(
|
||||||
|
FunctionInfoTyped<IUser>{0, &NfcInterface::Initialize, "InitializeOld"},
|
||||||
|
FunctionInfoTyped<IUser>{1, &NfcInterface::Finalize, "FinalizeOld"},
|
||||||
|
FunctionInfoTyped<IUser>{2, &NfcInterface::GetState, "GetStateOld"},
|
||||||
|
FunctionInfoTyped<IUser>{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"},
|
||||||
|
FunctionInfoTyped<IUser>{400, &NfcInterface::Initialize, "Initialize"},
|
||||||
|
FunctionInfoTyped<IUser>{401, &NfcInterface::Finalize, "Finalize"},
|
||||||
|
FunctionInfoTyped<IUser>{402, &NfcInterface::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<IUser>{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"},
|
||||||
|
FunctionInfoTyped<IUser>{404, &NfcInterface::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<IUser>{405, &NfcInterface::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<IUser>{406, &NfcInterface::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<IUser>{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{408, &NfcInterface::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<IUser>{409, &NfcInterface::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<IUser>{410, &NfcInterface::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<IUser>{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{1000, &NfcInterface::ReadMifare, "ReadMifare"},
|
||||||
|
FunctionInfoTyped<IUser>{1001, &NfcInterface::WriteMifare ,"WriteMifare"},
|
||||||
|
FunctionInfoTyped<IUser>{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"},
|
||||||
|
FunctionInfoTyped<IUser>{1301, nullptr, "KeepPassThroughSession"},
|
||||||
|
FunctionInfoTyped<IUser>{1302, nullptr, "ReleasePassThroughSession"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ISystem final : public NfcInterface {
|
class ISystem final : public NfcInterface {
|
||||||
public:
|
public:
|
||||||
explicit ISystem(Core::System& system_)
|
explicit ISystem(Core::System& system_) : NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} {}
|
||||||
: NfcInterface{system_, "NFC::ISystem", BackendType::Nfc} {
|
|
||||||
static const FunctionInfoTyped<ISystem> functions[] = {
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<ISystem>{0, &NfcInterface::Initialize, "InitializeOld"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<ISystem>{1, &NfcInterface::Finalize, "FinalizeOld"},
|
|
||||||
FunctionInfoTyped<ISystem>{2, &NfcInterface::GetState, "GetStateOld"},
|
|
||||||
FunctionInfoTyped<ISystem>{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"},
|
|
||||||
FunctionInfoTyped<ISystem>{100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"},
|
|
||||||
FunctionInfoTyped<ISystem>{400, &NfcInterface::Initialize, "Initialize"},
|
|
||||||
FunctionInfoTyped<ISystem>{401, &NfcInterface::Finalize, "Finalize"},
|
|
||||||
FunctionInfoTyped<ISystem>{402, &NfcInterface::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<ISystem>{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"},
|
|
||||||
FunctionInfoTyped<ISystem>{404, &NfcInterface::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<ISystem>{405, &NfcInterface::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<ISystem>{406, &NfcInterface::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<ISystem>{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{408, &NfcInterface::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<ISystem>{409, &NfcInterface::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<ISystem>{410, &NfcInterface::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"},
|
|
||||||
FunctionInfoTyped<ISystem>{510, nullptr, "OutputTestWave"},
|
|
||||||
FunctionInfoTyped<ISystem>{1000, &NfcInterface::ReadMifare, "ReadMifare"},
|
|
||||||
FunctionInfoTyped<ISystem>{1001, &NfcInterface::WriteMifare, "WriteMifare"},
|
|
||||||
FunctionInfoTyped<ISystem>{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"},
|
|
||||||
FunctionInfoTyped<ISystem>{1301, nullptr, "KeepPassThroughSession"},
|
|
||||||
FunctionInfoTyped<ISystem>{1302, nullptr, "ReleasePassThroughSession"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<ISystem>(
|
||||||
|
FunctionInfoTyped<ISystem>{0, &NfcInterface::Initialize, "InitializeOld"},
|
||||||
|
FunctionInfoTyped<ISystem>{1, &NfcInterface::Finalize, "FinalizeOld"},
|
||||||
|
FunctionInfoTyped<ISystem>{2, &NfcInterface::GetState, "GetStateOld"},
|
||||||
|
FunctionInfoTyped<ISystem>{3, &NfcInterface::IsNfcEnabled, "IsNfcEnabledOld"},
|
||||||
|
FunctionInfoTyped<ISystem>{100, &NfcInterface::SetNfcEnabled, "SetNfcEnabledOld"},
|
||||||
|
FunctionInfoTyped<ISystem>{400, &NfcInterface::Initialize, "Initialize"},
|
||||||
|
FunctionInfoTyped<ISystem>{401, &NfcInterface::Finalize, "Finalize"},
|
||||||
|
FunctionInfoTyped<ISystem>{402, &NfcInterface::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<ISystem>{403, &NfcInterface::IsNfcEnabled, "IsNfcEnabled"},
|
||||||
|
FunctionInfoTyped<ISystem>{404, &NfcInterface::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<ISystem>{405, &NfcInterface::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<ISystem>{406, &NfcInterface::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<ISystem>{407, &NfcInterface::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{408, &NfcInterface::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<ISystem>{409, &NfcInterface::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<ISystem>{410, &NfcInterface::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{411, &NfcInterface::AttachActivateEvent, "AttachActivateEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{412, &NfcInterface::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{500, &NfcInterface::SetNfcEnabled, "SetNfcEnabled"},
|
||||||
|
FunctionInfoTyped<ISystem>{510, nullptr, "OutputTestWave"},
|
||||||
|
FunctionInfoTyped<ISystem>{1000, &NfcInterface::ReadMifare, "ReadMifare"},
|
||||||
|
FunctionInfoTyped<ISystem>{1001, &NfcInterface::WriteMifare, "WriteMifare"},
|
||||||
|
FunctionInfoTyped<ISystem>{1300, &NfcInterface::SendCommandByPassThrough, "SendCommandByPassThrough"},
|
||||||
|
FunctionInfoTyped<ISystem>{1301, nullptr, "KeepPassThroughSession"},
|
||||||
|
FunctionInfoTyped<ISystem>{1302, nullptr, "ReleasePassThroughSession"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// MFInterface has an unique interface but it's identical to NfcInterface so we can keep the code
|
// MFInterface has an unique interface but it's identical to NfcInterface so we can keep the code
|
||||||
@@ -87,25 +90,27 @@ public:
|
|||||||
using MFInterface = NfcInterface;
|
using MFInterface = NfcInterface;
|
||||||
class MFIUser final : public MFInterface {
|
class MFIUser final : public MFInterface {
|
||||||
public:
|
public:
|
||||||
explicit MFIUser(Core::System& system_) : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} {
|
explicit MFIUser(Core::System& system_) : MFInterface{system_, "NFC::MFInterface", BackendType::Mifare} {}
|
||||||
static const FunctionInfoTyped<MFIUser> functions[] = {
|
|
||||||
FunctionInfoTyped<MFIUser>{0, &MFIUser::Initialize, "Initialize"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<MFIUser>{1, &MFIUser::Finalize, "Finalize"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<MFIUser>{2, &MFIUser::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<MFIUser>{3, &MFIUser::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<MFIUser>{4, &MFIUser::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<MFIUser>{5, &MFIUser::ReadMifare, "Read"},
|
|
||||||
FunctionInfoTyped<MFIUser>{6, &MFIUser::WriteMifare, "Write"},
|
|
||||||
FunctionInfoTyped<MFIUser>{7, &MFIUser::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<MFIUser>{8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"},
|
|
||||||
FunctionInfoTyped<MFIUser>{9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"},
|
|
||||||
FunctionInfoTyped<MFIUser>{10, &MFIUser::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<MFIUser>{11, &MFIUser::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<MFIUser>{12, &MFIUser::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<MFIUser>{13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<MFIUser>(
|
||||||
|
FunctionInfoTyped<MFIUser>{0, &MFIUser::Initialize, "Initialize"},
|
||||||
|
FunctionInfoTyped<MFIUser>{1, &MFIUser::Finalize, "Finalize"},
|
||||||
|
FunctionInfoTyped<MFIUser>{2, &MFIUser::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<MFIUser>{3, &MFIUser::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<MFIUser>{4, &MFIUser::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<MFIUser>{5, &MFIUser::ReadMifare, "Read"},
|
||||||
|
FunctionInfoTyped<MFIUser>{6, &MFIUser::WriteMifare, "Write"},
|
||||||
|
FunctionInfoTyped<MFIUser>{7, &MFIUser::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<MFIUser>{8, &MFIUser::AttachActivateEvent, "GetActivateEventHandle"},
|
||||||
|
FunctionInfoTyped<MFIUser>{9, &MFIUser::AttachDeactivateEvent, "GetDeactivateEventHandle"},
|
||||||
|
FunctionInfoTyped<MFIUser>{10, &MFIUser::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<MFIUser>{11, &MFIUser::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<MFIUser>{12, &MFIUser::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<MFIUser>{13, &MFIUser::AttachAvailabilityChangeEvent, "GetAvailabilityChangeEventHandle"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IAm final : public ServiceFramework<IAm> {
|
class IAm final : public ServiceFramework<IAm> {
|
||||||
|
|||||||
+115
-110
@@ -14,133 +14,135 @@ namespace Service::NFP {
|
|||||||
|
|
||||||
class IUser final : public Interface {
|
class IUser final : public Interface {
|
||||||
public:
|
public:
|
||||||
explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") {
|
explicit IUser(Core::System& system_) : Interface(system_, "NFP:IUser") {}
|
||||||
static const FunctionInfoTyped<IUser> functions[] = {
|
|
||||||
FunctionInfoTyped<IUser>{0, &IUser::Initialize, "Initialize"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<IUser>{1, &IUser::Finalize, "Finalize"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<IUser>{2, &IUser::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<IUser>{3, &IUser::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<IUser>{4, &IUser::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<IUser>{5, &IUser::Mount, "Mount"},
|
|
||||||
FunctionInfoTyped<IUser>{6, &IUser::Unmount, "Unmount"},
|
|
||||||
FunctionInfoTyped<IUser>{7, &IUser::OpenApplicationArea, "OpenApplicationArea"},
|
|
||||||
FunctionInfoTyped<IUser>{8, &IUser::GetApplicationArea, "GetApplicationArea"},
|
|
||||||
FunctionInfoTyped<IUser>{9, &IUser::SetApplicationArea, "SetApplicationArea"},
|
|
||||||
FunctionInfoTyped<IUser>{10, &IUser::Flush, "Flush"},
|
|
||||||
FunctionInfoTyped<IUser>{11, &IUser::Restore, "Restore"},
|
|
||||||
FunctionInfoTyped<IUser>{12, &IUser::CreateApplicationArea, "CreateApplicationArea"},
|
|
||||||
FunctionInfoTyped<IUser>{13, &IUser::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<IUser>{14, &IUser::GetRegisterInfo, "GetRegisterInfo"},
|
|
||||||
FunctionInfoTyped<IUser>{15, &IUser::GetCommonInfo, "GetCommonInfo"},
|
|
||||||
FunctionInfoTyped<IUser>{16, &IUser::GetModelInfo, "GetModelInfo"},
|
|
||||||
FunctionInfoTyped<IUser>{17, &IUser::AttachActivateEvent, "AttachActivateEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{19, &IUser::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<IUser>{20, &IUser::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<IUser>{21, &IUser::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<IUser>{22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"},
|
|
||||||
FunctionInfoTyped<IUser>{23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
|
||||||
FunctionInfoTyped<IUser>{24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"},
|
|
||||||
FunctionInfoTyped<IUser>{25, &IUser::StartDetection, "StartDetectionWithFilter"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<IUser>(
|
||||||
|
FunctionInfoTyped<IUser>{0, &IUser::Initialize, "Initialize"},
|
||||||
|
FunctionInfoTyped<IUser>{1, &IUser::Finalize, "Finalize"},
|
||||||
|
FunctionInfoTyped<IUser>{2, &IUser::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<IUser>{3, &IUser::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<IUser>{4, &IUser::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<IUser>{5, &IUser::Mount, "Mount"},
|
||||||
|
FunctionInfoTyped<IUser>{6, &IUser::Unmount, "Unmount"},
|
||||||
|
FunctionInfoTyped<IUser>{7, &IUser::OpenApplicationArea, "OpenApplicationArea"},
|
||||||
|
FunctionInfoTyped<IUser>{8, &IUser::GetApplicationArea, "GetApplicationArea"},
|
||||||
|
FunctionInfoTyped<IUser>{9, &IUser::SetApplicationArea, "SetApplicationArea"},
|
||||||
|
FunctionInfoTyped<IUser>{10, &IUser::Flush, "Flush"},
|
||||||
|
FunctionInfoTyped<IUser>{11, &IUser::Restore, "Restore"},
|
||||||
|
FunctionInfoTyped<IUser>{12, &IUser::CreateApplicationArea, "CreateApplicationArea"},
|
||||||
|
FunctionInfoTyped<IUser>{13, &IUser::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<IUser>{14, &IUser::GetRegisterInfo, "GetRegisterInfo"},
|
||||||
|
FunctionInfoTyped<IUser>{15, &IUser::GetCommonInfo, "GetCommonInfo"},
|
||||||
|
FunctionInfoTyped<IUser>{16, &IUser::GetModelInfo, "GetModelInfo"},
|
||||||
|
FunctionInfoTyped<IUser>{17, &IUser::AttachActivateEvent, "AttachActivateEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{18, &IUser::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{19, &IUser::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<IUser>{20, &IUser::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<IUser>{21, &IUser::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<IUser>{22, &IUser::GetApplicationAreaSize, "GetApplicationAreaSize"},
|
||||||
|
FunctionInfoTyped<IUser>{23, &IUser::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
||||||
|
FunctionInfoTyped<IUser>{24, &IUser::RecreateApplicationArea, "RecreateApplicationArea"},
|
||||||
|
FunctionInfoTyped<IUser>{25, &IUser::StartDetection, "StartDetectionWithFilter"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class ISystem final : public Interface {
|
class ISystem final : public Interface {
|
||||||
public:
|
public:
|
||||||
explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") {
|
explicit ISystem(Core::System& system_) : Interface(system_, "NFP:ISystem") {}
|
||||||
static const FunctionInfoTyped<ISystem> functions[] = {
|
|
||||||
FunctionInfoTyped<ISystem>{0, &ISystem::InitializeSystem, "InitializeSystem"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<ISystem>{1, &ISystem::FinalizeSystem, "FinalizeSystem"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<ISystem>{2, &ISystem::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<ISystem>{3, &ISystem::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<ISystem>{4, &ISystem::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<ISystem>{5, &ISystem::Mount, "Mount"},
|
|
||||||
FunctionInfoTyped<ISystem>{6, &ISystem::Unmount, "Unmount"},
|
|
||||||
FunctionInfoTyped<ISystem>{10, &ISystem::Flush, "Flush"},
|
|
||||||
FunctionInfoTyped<ISystem>{11, &ISystem::Restore, "Restore"},
|
|
||||||
FunctionInfoTyped<ISystem>{12, &ISystem::CreateApplicationArea, "CreateApplicationArea"},
|
|
||||||
FunctionInfoTyped<ISystem>{13, &ISystem::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{14, &ISystem::GetRegisterInfo, "GetRegisterInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{15, &ISystem::GetCommonInfo, "GetCommonInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{16, &ISystem::GetModelInfo, "GetModelInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{17, &ISystem::AttachActivateEvent, "AttachActivateEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{19, &ISystem::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<ISystem>{20, &ISystem::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<ISystem>{21, &ISystem::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<ISystem>{23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
|
||||||
FunctionInfoTyped<ISystem>{25, &ISystem::StartDetection, "StartDetectionWithFilter"},
|
|
||||||
FunctionInfoTyped<ISystem>{100, &ISystem::Format, "Format"},
|
|
||||||
FunctionInfoTyped<ISystem>{101, &ISystem::GetAdminInfo, "GetAdminInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"},
|
|
||||||
FunctionInfoTyped<ISystem>{103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"},
|
|
||||||
FunctionInfoTyped<ISystem>{104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"},
|
|
||||||
FunctionInfoTyped<ISystem>{105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"},
|
|
||||||
FunctionInfoTyped<ISystem>{106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<ISystem>(
|
||||||
|
FunctionInfoTyped<ISystem>{0, &ISystem::InitializeSystem, "InitializeSystem"},
|
||||||
|
FunctionInfoTyped<ISystem>{1, &ISystem::FinalizeSystem, "FinalizeSystem"},
|
||||||
|
FunctionInfoTyped<ISystem>{2, &ISystem::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<ISystem>{3, &ISystem::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<ISystem>{4, &ISystem::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<ISystem>{5, &ISystem::Mount, "Mount"},
|
||||||
|
FunctionInfoTyped<ISystem>{6, &ISystem::Unmount, "Unmount"},
|
||||||
|
FunctionInfoTyped<ISystem>{10, &ISystem::Flush, "Flush"},
|
||||||
|
FunctionInfoTyped<ISystem>{11, &ISystem::Restore, "Restore"},
|
||||||
|
FunctionInfoTyped<ISystem>{12, &ISystem::CreateApplicationArea, "CreateApplicationArea"},
|
||||||
|
FunctionInfoTyped<ISystem>{13, &ISystem::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{14, &ISystem::GetRegisterInfo, "GetRegisterInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{15, &ISystem::GetCommonInfo, "GetCommonInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{16, &ISystem::GetModelInfo, "GetModelInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{17, &ISystem::AttachActivateEvent, "AttachActivateEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{18, &ISystem::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{19, &ISystem::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<ISystem>{20, &ISystem::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<ISystem>{21, &ISystem::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<ISystem>{23, &ISystem::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
||||||
|
FunctionInfoTyped<ISystem>{25, &ISystem::StartDetection, "StartDetectionWithFilter"},
|
||||||
|
FunctionInfoTyped<ISystem>{100, &ISystem::Format, "Format"},
|
||||||
|
FunctionInfoTyped<ISystem>{101, &ISystem::GetAdminInfo, "GetAdminInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{102, &ISystem::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"},
|
||||||
|
FunctionInfoTyped<ISystem>{103, &ISystem::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"},
|
||||||
|
FunctionInfoTyped<ISystem>{104, &ISystem::DeleteRegisterInfo, "DeleteRegisterInfo"},
|
||||||
|
FunctionInfoTyped<ISystem>{105, &ISystem::DeleteApplicationArea, "DeleteApplicationArea"},
|
||||||
|
FunctionInfoTyped<ISystem>{106, &ISystem::ExistsApplicationArea, "ExistsApplicationArea"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IDebug final : public Interface {
|
class IDebug final : public Interface {
|
||||||
public:
|
public:
|
||||||
explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") {
|
explicit IDebug(Core::System& system_) : Interface(system_, "NFP:IDebug") {}
|
||||||
static const FunctionInfoTyped<IDebug> functions[] = {
|
|
||||||
FunctionInfoTyped<IDebug>{0, &IDebug::InitializeDebug, "InitializeDebug"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfoTyped<IDebug>{1, &IDebug::FinalizeDebug, "FinalizeDebug"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfoTyped<IDebug>{2, &IDebug::ListDevices, "ListDevices"},
|
|
||||||
FunctionInfoTyped<IDebug>{3, &IDebug::StartDetection, "StartDetection"},
|
|
||||||
FunctionInfoTyped<IDebug>{4, &IDebug::StopDetection, "StopDetection"},
|
|
||||||
FunctionInfoTyped<IDebug>{5, &IDebug::Mount, "Mount"},
|
|
||||||
FunctionInfoTyped<IDebug>{6, &IDebug::Unmount, "Unmount"},
|
|
||||||
FunctionInfoTyped<IDebug>{7, &IDebug::OpenApplicationArea, "OpenApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{8, &IDebug::GetApplicationArea, "GetApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{9, &IDebug::SetApplicationArea, "SetApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{10, &IDebug::Flush, "Flush"},
|
|
||||||
FunctionInfoTyped<IDebug>{11, &IDebug::Restore, "Restore"},
|
|
||||||
FunctionInfoTyped<IDebug>{12, &IDebug::CreateApplicationArea, "CreateApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{13, &IDebug::GetTagInfo, "GetTagInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{14, &IDebug::GetRegisterInfo, "GetRegisterInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{15, &IDebug::GetCommonInfo, "GetCommonInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{16, &IDebug::GetModelInfo, "GetModelInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{17, &IDebug::AttachActivateEvent, "AttachActivateEvent"},
|
|
||||||
FunctionInfoTyped<IDebug>{18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
|
||||||
FunctionInfoTyped<IDebug>{19, &IDebug::GetState, "GetState"},
|
|
||||||
FunctionInfoTyped<IDebug>{20, &IDebug::GetDeviceState, "GetDeviceState"},
|
|
||||||
FunctionInfoTyped<IDebug>{21, &IDebug::GetNpadId, "GetNpadId"},
|
|
||||||
FunctionInfoTyped<IDebug>{22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"},
|
|
||||||
FunctionInfoTyped<IDebug>{23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
|
||||||
FunctionInfoTyped<IDebug>{24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{25, &IDebug::StartDetection, "StartDetectionWithFilter"},
|
|
||||||
FunctionInfoTyped<IDebug>{100, &IDebug::Format, "Format"},
|
|
||||||
FunctionInfoTyped<IDebug>{101, &IDebug::GetAdminInfo, "GetAdminInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"},
|
|
||||||
FunctionInfoTyped<IDebug>{103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"},
|
|
||||||
FunctionInfoTyped<IDebug>{104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"},
|
|
||||||
FunctionInfoTyped<IDebug>{105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"},
|
|
||||||
FunctionInfoTyped<IDebug>{200, &IDebug::GetAll, "GetAll"},
|
|
||||||
FunctionInfoTyped<IDebug>{201, &IDebug::SetAll, "SetAll"},
|
|
||||||
FunctionInfoTyped<IDebug>{202, &IDebug::FlushDebug, "FlushDebug"},
|
|
||||||
FunctionInfoTyped<IDebug>{203, &IDebug::BreakTag, "BreakTag"},
|
|
||||||
FunctionInfoTyped<IDebug>{204, &IDebug::ReadBackupData, "ReadBackupData"},
|
|
||||||
FunctionInfoTyped<IDebug>{205, &IDebug::WriteBackupData, "WriteBackupData"},
|
|
||||||
FunctionInfoTyped<IDebug>{206, &IDebug::WriteNtf, "WriteNtf"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMapWithClass<IDebug>(
|
||||||
|
FunctionInfoTyped<IDebug>{0, &IDebug::InitializeDebug, "InitializeDebug"},
|
||||||
|
FunctionInfoTyped<IDebug>{1, &IDebug::FinalizeDebug, "FinalizeDebug"},
|
||||||
|
FunctionInfoTyped<IDebug>{2, &IDebug::ListDevices, "ListDevices"},
|
||||||
|
FunctionInfoTyped<IDebug>{3, &IDebug::StartDetection, "StartDetection"},
|
||||||
|
FunctionInfoTyped<IDebug>{4, &IDebug::StopDetection, "StopDetection"},
|
||||||
|
FunctionInfoTyped<IDebug>{5, &IDebug::Mount, "Mount"},
|
||||||
|
FunctionInfoTyped<IDebug>{6, &IDebug::Unmount, "Unmount"},
|
||||||
|
FunctionInfoTyped<IDebug>{7, &IDebug::OpenApplicationArea, "OpenApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{8, &IDebug::GetApplicationArea, "GetApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{9, &IDebug::SetApplicationArea, "SetApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{10, &IDebug::Flush, "Flush"},
|
||||||
|
FunctionInfoTyped<IDebug>{11, &IDebug::Restore, "Restore"},
|
||||||
|
FunctionInfoTyped<IDebug>{12, &IDebug::CreateApplicationArea, "CreateApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{13, &IDebug::GetTagInfo, "GetTagInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{14, &IDebug::GetRegisterInfo, "GetRegisterInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{15, &IDebug::GetCommonInfo, "GetCommonInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{16, &IDebug::GetModelInfo, "GetModelInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{17, &IDebug::AttachActivateEvent, "AttachActivateEvent"},
|
||||||
|
FunctionInfoTyped<IDebug>{18, &IDebug::AttachDeactivateEvent, "AttachDeactivateEvent"},
|
||||||
|
FunctionInfoTyped<IDebug>{19, &IDebug::GetState, "GetState"},
|
||||||
|
FunctionInfoTyped<IDebug>{20, &IDebug::GetDeviceState, "GetDeviceState"},
|
||||||
|
FunctionInfoTyped<IDebug>{21, &IDebug::GetNpadId, "GetNpadId"},
|
||||||
|
FunctionInfoTyped<IDebug>{22, &IDebug::GetApplicationAreaSize, "GetApplicationAreaSize"},
|
||||||
|
FunctionInfoTyped<IDebug>{23, &IDebug::AttachAvailabilityChangeEvent, "AttachAvailabilityChangeEvent"},
|
||||||
|
FunctionInfoTyped<IDebug>{24, &IDebug::RecreateApplicationArea, "RecreateApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{25, &IDebug::StartDetection, "StartDetectionWithFilter"},
|
||||||
|
FunctionInfoTyped<IDebug>{100, &IDebug::Format, "Format"},
|
||||||
|
FunctionInfoTyped<IDebug>{101, &IDebug::GetAdminInfo, "GetAdminInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{102, &IDebug::GetRegisterInfoPrivate, "GetRegisterInfoPrivate"},
|
||||||
|
FunctionInfoTyped<IDebug>{103, &IDebug::SetRegisterInfoPrivate, "SetRegisterInfoPrivate"},
|
||||||
|
FunctionInfoTyped<IDebug>{104, &IDebug::DeleteRegisterInfo, "DeleteRegisterInfo"},
|
||||||
|
FunctionInfoTyped<IDebug>{105, &IDebug::DeleteApplicationArea, "DeleteApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{106, &IDebug::ExistsApplicationArea, "ExistsApplicationArea"},
|
||||||
|
FunctionInfoTyped<IDebug>{200, &IDebug::GetAll, "GetAll"},
|
||||||
|
FunctionInfoTyped<IDebug>{201, &IDebug::SetAll, "SetAll"},
|
||||||
|
FunctionInfoTyped<IDebug>{202, &IDebug::FlushDebug, "FlushDebug"},
|
||||||
|
FunctionInfoTyped<IDebug>{203, &IDebug::BreakTag, "BreakTag"},
|
||||||
|
FunctionInfoTyped<IDebug>{204, &IDebug::ReadBackupData, "ReadBackupData"},
|
||||||
|
FunctionInfoTyped<IDebug>{205, &IDebug::WriteBackupData, "WriteBackupData"},
|
||||||
|
FunctionInfoTyped<IDebug>{206, &IDebug::WriteNtf, "WriteNtf"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class IUserManager final : public ServiceFramework<IUserManager> {
|
class IUserManager final : public ServiceFramework<IUserManager> {
|
||||||
public:
|
public:
|
||||||
explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} {}
|
explicit IUserManager(Core::System& system_) : ServiceFramework{system_, "nfp:user"} {}
|
||||||
|
|
||||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateUserInterface(HLERequestContext& ctx) {
|
void CreateUserInterface(HLERequestContext& ctx) {
|
||||||
LOG_DEBUG(Service_NFP, "called");
|
LOG_DEBUG(Service_NFP, "called");
|
||||||
@@ -150,6 +152,9 @@ private:
|
|||||||
rb.PushIpcInterface<IUser>(ctx, system);
|
rb.PushIpcInterface<IUser>(ctx, system);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
static constexpr auto functions = CreateStaticMap(
|
static constexpr auto functions = CreateStaticMap(
|
||||||
FunctionInfo{0, &IUserManager::CreateUserInterface, "CreateUserInterface"}
|
FunctionInfo{0, &IUserManager::CreateUserInterface, "CreateUserInterface"}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -235,15 +235,6 @@ public:
|
|||||||
explicit IScanRequest(Core::System& system_)
|
explicit IScanRequest(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IScanRequest"}, svc_ctx{system_, "IScanRequest"} {
|
: ServiceFramework{system_, "IScanRequest"}, svc_ctx{system_, "IScanRequest"} {
|
||||||
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &IScanRequest::Submit, "Submit"},
|
|
||||||
FunctionInfo{1, &IScanRequest::IsProcessing, "IsProcessing"},
|
|
||||||
FunctionInfo{2, &IScanRequest::GetResult, "GetResult"},
|
|
||||||
FunctionInfo{3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"},
|
|
||||||
FunctionInfo{4, &IScanRequest::SetChannels, "SetChannels"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
|
|
||||||
evt_scan_complete = CreateKEvent(svc_ctx, "IScanRequest:Complete");
|
evt_scan_complete = CreateKEvent(svc_ctx, "IScanRequest:Complete");
|
||||||
evt_processing = CreateKEvent(svc_ctx, "IScanRequest:Processing");
|
evt_processing = CreateKEvent(svc_ctx, "IScanRequest:Processing");
|
||||||
}
|
}
|
||||||
@@ -257,8 +248,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<Network::ScanData> scan_results;
|
|
||||||
|
|
||||||
void Submit(HLERequestContext& ctx) {
|
void Submit(HLERequestContext& ctx) {
|
||||||
|
|
||||||
if (state.load() == State::Finished) {
|
if (state.load() == State::Finished) {
|
||||||
@@ -329,6 +318,17 @@ private:
|
|||||||
evt_scan_complete->Signal(system.Kernel());
|
evt_scan_complete->Signal(system.Kernel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &IScanRequest::Submit, "Submit"},
|
||||||
|
FunctionInfo{1, &IScanRequest::IsProcessing, "IsProcessing"},
|
||||||
|
FunctionInfo{2, &IScanRequest::GetResult, "GetResult"},
|
||||||
|
FunctionInfo{3, &IScanRequest::GetSystemEventReadableHandle, "GetSystemEventReadableHandle"},
|
||||||
|
FunctionInfo{4, &IScanRequest::SetChannels, "SetChannels"}
|
||||||
|
);
|
||||||
|
std::vector<Network::ScanData> scan_results;
|
||||||
KernelHelpers::ServiceContext svc_ctx;
|
KernelHelpers::ServiceContext svc_ctx;
|
||||||
|
|
||||||
Kernel::KEvent* evt_scan_complete{};
|
Kernel::KEvent* evt_scan_complete{};
|
||||||
@@ -342,36 +342,6 @@ class IRequest final : public ServiceFramework<IRequest> {
|
|||||||
public:
|
public:
|
||||||
explicit IRequest(Core::System& system_)
|
explicit IRequest(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IRequest"}, service_context{system_, "IRequest"} {
|
: ServiceFramework{system_, "IRequest"}, service_context{system_, "IRequest"} {
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &IRequest::GetRequestState, "GetRequestState"},
|
|
||||||
FunctionInfo{1, &IRequest::GetResult, "GetResult"},
|
|
||||||
FunctionInfo{2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"},
|
|
||||||
FunctionInfo{3, &IRequest::Cancel, "Cancel"},
|
|
||||||
FunctionInfo{4, &IRequest::Submit, "Submit"},
|
|
||||||
FunctionInfo{5, nullptr, "SetRequirement"},
|
|
||||||
FunctionInfo{6, &IRequest::SetRequirementPreset, "SetRequirementPreset"},
|
|
||||||
FunctionInfo{8, nullptr, "SetPriority"},
|
|
||||||
FunctionInfo{9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"},
|
|
||||||
FunctionInfo{10, nullptr, "SetRejectable"},
|
|
||||||
FunctionInfo{11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"},
|
|
||||||
FunctionInfo{12, nullptr, "SetPersistent"},
|
|
||||||
FunctionInfo{13, nullptr, "SetInstant"},
|
|
||||||
FunctionInfo{14, nullptr, "SetSustainable"},
|
|
||||||
FunctionInfo{15, nullptr, "SetRawPriority"},
|
|
||||||
FunctionInfo{16, nullptr, "SetGreedy"},
|
|
||||||
FunctionInfo{17, nullptr, "SetSharable"},
|
|
||||||
FunctionInfo{18, nullptr, "SetRequirementByRevision"},
|
|
||||||
FunctionInfo{19, nullptr, "GetRequirement"},
|
|
||||||
FunctionInfo{20, nullptr, "GetRevision"},
|
|
||||||
FunctionInfo{21, &IRequest::GetAppletInfo, "GetAppletInfo"},
|
|
||||||
FunctionInfo{22, nullptr, "GetAdditionalInfo"},
|
|
||||||
FunctionInfo{23, nullptr, "SetKeptInSleep"},
|
|
||||||
FunctionInfo{24, nullptr, "RegisterSocketDescriptor"},
|
|
||||||
FunctionInfo{25, nullptr, "UnregisterSocketDescriptor"},
|
|
||||||
FunctionInfo{26, nullptr, "GetNetworkAccessStatus"}, //21.0.0+
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
|
|
||||||
event1 = CreateKEvent(service_context, "IRequest:Event1");
|
event1 = CreateKEvent(service_context, "IRequest:Event1");
|
||||||
event2 = CreateKEvent(service_context, "IRequest:Event2");
|
event2 = CreateKEvent(service_context, "IRequest:Event2");
|
||||||
state = RequestState::NotSubmitted;
|
state = RequestState::NotSubmitted;
|
||||||
@@ -494,6 +464,37 @@ private:
|
|||||||
event1->Signal(system.Kernel());
|
event1->Signal(system.Kernel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &IRequest::GetRequestState, "GetRequestState"},
|
||||||
|
FunctionInfo{1, &IRequest::GetResult, "GetResult"},
|
||||||
|
FunctionInfo{2, &IRequest::GetSystemEventReadableHandles, "GetSystemEventReadableHandles"},
|
||||||
|
FunctionInfo{3, &IRequest::Cancel, "Cancel"},
|
||||||
|
FunctionInfo{4, &IRequest::Submit, "Submit"},
|
||||||
|
FunctionInfo{5, nullptr, "SetRequirement"},
|
||||||
|
FunctionInfo{6, &IRequest::SetRequirementPreset, "SetRequirementPreset"},
|
||||||
|
FunctionInfo{8, nullptr, "SetPriority"},
|
||||||
|
FunctionInfo{9, &IRequest::SetNetworkProfileId, "SetNetworkProfileId"},
|
||||||
|
FunctionInfo{10, nullptr, "SetRejectable"},
|
||||||
|
FunctionInfo{11, &IRequest::SetConnectionConfirmationOption, "SetConnectionConfirmationOption"},
|
||||||
|
FunctionInfo{12, nullptr, "SetPersistent"},
|
||||||
|
FunctionInfo{13, nullptr, "SetInstant"},
|
||||||
|
FunctionInfo{14, nullptr, "SetSustainable"},
|
||||||
|
FunctionInfo{15, nullptr, "SetRawPriority"},
|
||||||
|
FunctionInfo{16, nullptr, "SetGreedy"},
|
||||||
|
FunctionInfo{17, nullptr, "SetSharable"},
|
||||||
|
FunctionInfo{18, nullptr, "SetRequirementByRevision"},
|
||||||
|
FunctionInfo{19, nullptr, "GetRequirement"},
|
||||||
|
FunctionInfo{20, nullptr, "GetRevision"},
|
||||||
|
FunctionInfo{21, &IRequest::GetAppletInfo, "GetAppletInfo"},
|
||||||
|
FunctionInfo{22, nullptr, "GetAdditionalInfo"},
|
||||||
|
FunctionInfo{23, nullptr, "SetKeptInSleep"},
|
||||||
|
FunctionInfo{24, nullptr, "RegisterSocketDescriptor"},
|
||||||
|
FunctionInfo{25, nullptr, "UnregisterSocketDescriptor"},
|
||||||
|
FunctionInfo{26, nullptr, "GetNetworkAccessStatus"} //21.0.0+
|
||||||
|
);
|
||||||
KernelHelpers::ServiceContext service_context;
|
KernelHelpers::ServiceContext service_context;
|
||||||
|
|
||||||
RequestState state;
|
RequestState state;
|
||||||
@@ -508,14 +509,16 @@ private:
|
|||||||
|
|
||||||
class INetworkProfile final : public ServiceFramework<INetworkProfile> {
|
class INetworkProfile final : public ServiceFramework<INetworkProfile> {
|
||||||
public:
|
public:
|
||||||
explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} {
|
explicit INetworkProfile(Core::System& system_) : ServiceFramework{system_, "INetworkProfile"} {}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "Update"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfo{1, nullptr, "PersistOld"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfo{2, nullptr, "Persist"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "Update"},
|
||||||
|
FunctionInfo{1, nullptr, "PersistOld"},
|
||||||
|
FunctionInfo{2, nullptr, "Persist"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void IGeneralService::GetClientId(HLERequestContext& ctx) {
|
void IGeneralService::GetClientId(HLERequestContext& ctx) {
|
||||||
@@ -1113,14 +1116,7 @@ IGeneralService::~IGeneralService() = default;
|
|||||||
|
|
||||||
class NetworkInterface final : public ServiceFramework<NetworkInterface> {
|
class NetworkInterface final : public ServiceFramework<NetworkInterface> {
|
||||||
public:
|
public:
|
||||||
explicit NetworkInterface(const char* name, Core::System& system_)
|
explicit NetworkInterface(const char* name, Core::System& system_) : ServiceFramework{system_, name} {}
|
||||||
: ServiceFramework{system_, name} {
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
|
|
||||||
FunctionInfo{5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateGeneralServiceOld(HLERequestContext& ctx) {
|
void CreateGeneralServiceOld(HLERequestContext& ctx) {
|
||||||
@@ -1138,6 +1134,14 @@ private:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
rb.PushIpcInterface<IGeneralService>(ctx, system);
|
rb.PushIpcInterface<IGeneralService>(ctx, system);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{4, &NetworkInterface::CreateGeneralServiceOld, "CreateGeneralServiceOld"},
|
||||||
|
FunctionInfo{5, &NetworkInterface::CreateGeneralService, "CreateGeneralService"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -506,19 +506,7 @@ public:
|
|||||||
explicit IEnsureNetworkClockAvailabilityService(Core::System& system_)
|
explicit IEnsureNetworkClockAvailabilityService(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"},
|
: ServiceFramework{system_, "IEnsureNetworkClockAvailabilityService"},
|
||||||
service_context{system_, "IEnsureNetworkClockAvailabilityService"} {
|
service_context{system_, "IEnsureNetworkClockAvailabilityService"} {
|
||||||
static const FunctionInfo functions[] = {
|
finished_event = service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent");
|
||||||
FunctionInfo{0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"},
|
|
||||||
FunctionInfo{1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent,
|
|
||||||
"GetFinishNotificationEvent"},
|
|
||||||
FunctionInfo{2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"},
|
|
||||||
FunctionInfo{3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"},
|
|
||||||
FunctionInfo{4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"},
|
|
||||||
FunctionInfo{5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
|
|
||||||
finished_event =
|
|
||||||
service_context.CreateEvent("IEnsureNetworkClockAvailabilityService:FinishEvent");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~IEnsureNetworkClockAvailabilityService() override {
|
~IEnsureNetworkClockAvailabilityService() override {
|
||||||
@@ -575,8 +563,18 @@ private:
|
|||||||
rb.PushRaw<s64>(server_time);
|
rb.PushRaw<s64>(server_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &IEnsureNetworkClockAvailabilityService::StartTask, "StartTask"},
|
||||||
|
FunctionInfo{1, &IEnsureNetworkClockAvailabilityService::GetFinishNotificationEvent, "GetFinishNotificationEvent"},
|
||||||
|
FunctionInfo{2, &IEnsureNetworkClockAvailabilityService::GetResult, "GetResult"},
|
||||||
|
FunctionInfo{3, &IEnsureNetworkClockAvailabilityService::Cancel, "Cancel"},
|
||||||
|
FunctionInfo{4, &IEnsureNetworkClockAvailabilityService::IsProcessing, "IsProcessing"},
|
||||||
|
FunctionInfo{5, &IEnsureNetworkClockAvailabilityService::GetServerTime, "GetServerTime"}
|
||||||
|
);
|
||||||
KernelHelpers::ServiceContext service_context;
|
KernelHelpers::ServiceContext service_context;
|
||||||
|
|
||||||
Kernel::KEvent* finished_event;
|
Kernel::KEvent* finished_event;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -99,13 +99,6 @@ public:
|
|||||||
, data_offset{offset}
|
, data_offset{offset}
|
||||||
, data_size{size}
|
, data_size{size}
|
||||||
{
|
{
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, D<&IAsyncValue::GetSize>, "GetSize"},
|
|
||||||
FunctionInfo{1, D<&IAsyncValue::Get>, "Get"},
|
|
||||||
FunctionInfo{2, D<&IAsyncValue::Cancel>, "Cancel"},
|
|
||||||
FunctionInfo{3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
completion_event = service_context.CreateEvent("IAsyncValue:Completion");
|
completion_event = service_context.CreateEvent("IAsyncValue:Completion");
|
||||||
completion_event->GetReadableEvent().Signal(system.Kernel());
|
completion_event->GetReadableEvent().Signal(system.Kernel());
|
||||||
}
|
}
|
||||||
@@ -137,6 +130,16 @@ private:
|
|||||||
LOG_DEBUG(Service_NS, "called");
|
LOG_DEBUG(Service_NS, "called");
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, D<&IAsyncValue::GetSize>, "GetSize"},
|
||||||
|
FunctionInfo{1, D<&IAsyncValue::Get>, "Get"},
|
||||||
|
FunctionInfo{2, D<&IAsyncValue::Cancel>, "Cancel"},
|
||||||
|
FunctionInfo{3, D<&IAsyncValue::GetErrorContext>, "GetErrorContext"}
|
||||||
|
);
|
||||||
KernelHelpers::ServiceContext service_context;
|
KernelHelpers::ServiceContext service_context;
|
||||||
Kernel::KEvent* completion_event{};
|
Kernel::KEvent* completion_event{};
|
||||||
s32 data_offset;
|
s32 data_offset;
|
||||||
|
|||||||
@@ -50,55 +50,61 @@ class NVGEM_C final : public ServiceFramework<NVGEM_C> {
|
|||||||
public:
|
public:
|
||||||
explicit NVGEM_C(Core::System& system_)
|
explicit NVGEM_C(Core::System& system_)
|
||||||
: ServiceFramework{system_, "nvgem:c"}
|
: ServiceFramework{system_, "nvgem:c"}
|
||||||
{
|
{}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "Initialize"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfo{1, nullptr, "GetEventHandle"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfo{2, nullptr, "ControlNotification"},
|
|
||||||
FunctionInfo{3, nullptr, "SetNotificationPerm"},
|
|
||||||
FunctionInfo{4, nullptr, "SetCoreDumpPerm"},
|
|
||||||
FunctionInfo{5, nullptr, "GetAruid"},
|
|
||||||
FunctionInfo{6, nullptr, "Reset"},
|
|
||||||
FunctionInfo{7, nullptr, "GetAruid2"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "Initialize"},
|
||||||
|
FunctionInfo{1, nullptr, "GetEventHandle"},
|
||||||
|
FunctionInfo{2, nullptr, "ControlNotification"},
|
||||||
|
FunctionInfo{3, nullptr, "SetNotificationPerm"},
|
||||||
|
FunctionInfo{4, nullptr, "SetCoreDumpPerm"},
|
||||||
|
FunctionInfo{5, nullptr, "GetAruid"},
|
||||||
|
FunctionInfo{6, nullptr, "Reset"},
|
||||||
|
FunctionInfo{7, nullptr, "GetAruid2"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class NVGEM_CD final : public ServiceFramework<NVGEM_CD> {
|
class NVGEM_CD final : public ServiceFramework<NVGEM_CD> {
|
||||||
public:
|
public:
|
||||||
explicit NVGEM_CD(Core::System& system_)
|
explicit NVGEM_CD(Core::System& system_)
|
||||||
: ServiceFramework{system_, "nvgem:cd"}
|
: ServiceFramework{system_, "nvgem:cd"}
|
||||||
{
|
{}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "Initialize"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfo{1, nullptr, "GetAruid"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfo{2, nullptr, "ReadNextBlock"},
|
|
||||||
FunctionInfo{3, nullptr, "GetNextBlockSize"},
|
|
||||||
FunctionInfo{4, nullptr, "ReadNextBlock2"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "Initialize"},
|
||||||
|
FunctionInfo{1, nullptr, "GetAruid"},
|
||||||
|
FunctionInfo{2, nullptr, "ReadNextBlock"},
|
||||||
|
FunctionInfo{3, nullptr, "GetNextBlockSize"},
|
||||||
|
FunctionInfo{4, nullptr, "ReadNextBlock2"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class NVDBG_D final : public ServiceFramework<NVDBG_D> {
|
class NVDBG_D final : public ServiceFramework<NVDBG_D> {
|
||||||
public:
|
public:
|
||||||
explicit NVDBG_D(Core::System& system_)
|
explicit NVDBG_D(Core::System& system_)
|
||||||
: ServiceFramework{system_, "nvdbg:d"}
|
: ServiceFramework{system_, "nvdbg:d"}
|
||||||
{
|
{}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "Open"},
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
FunctionInfo{1, nullptr, "Ioctl"},
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
FunctionInfo{2, nullptr, "Close"},
|
|
||||||
FunctionInfo{4, nullptr, "QueryEvent"},
|
|
||||||
FunctionInfo{9, nullptr, "DumpStatus"},
|
|
||||||
FunctionInfo{10, nullptr, "InitializeDevtools"},
|
|
||||||
FunctionInfo{11, nullptr, "Ioctl2"},
|
|
||||||
FunctionInfo{12, nullptr, "Ioctl3"},
|
|
||||||
FunctionInfo{13, nullptr, "SetConfiguration"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "Open"},
|
||||||
|
FunctionInfo{1, nullptr, "Ioctl"},
|
||||||
|
FunctionInfo{2, nullptr, "Close"},
|
||||||
|
FunctionInfo{4, nullptr, "QueryEvent"},
|
||||||
|
FunctionInfo{9, nullptr, "DumpStatus"},
|
||||||
|
FunctionInfo{10, nullptr, "InitializeDevtools"},
|
||||||
|
FunctionInfo{11, nullptr, "Ioctl2"},
|
||||||
|
FunctionInfo{12, nullptr, "Ioctl3"},
|
||||||
|
FunctionInfo{13, nullptr, "SetConfiguration"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -47,13 +47,7 @@ void GetApplicationPidGeneric(Kernel::KernelCore& kernel, HLERequestContext& ctx
|
|||||||
|
|
||||||
class BootMode final : public ServiceFramework<BootMode> {
|
class BootMode final : public ServiceFramework<BootMode> {
|
||||||
public:
|
public:
|
||||||
explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} {
|
explicit BootMode(Core::System& system_) : ServiceFramework{system_, "pm:bm"} {}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &BootMode::GetBootMode, "GetBootMode"},
|
|
||||||
FunctionInfo{1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetBootMode(HLERequestContext& ctx) {
|
void GetBootMode(HLERequestContext& ctx) {
|
||||||
@@ -73,6 +67,13 @@ private:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &BootMode::GetBootMode, "GetBootMode"},
|
||||||
|
FunctionInfo{1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}
|
||||||
|
);
|
||||||
SystemBootMode boot_mode = SystemBootMode::Normal;
|
SystemBootMode boot_mode = SystemBootMode::Normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -80,10 +81,6 @@ class DebugMonitor final : public ServiceFramework<DebugMonitor> {
|
|||||||
public:
|
public:
|
||||||
explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} {}
|
explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "pm:dmnt"} {}
|
||||||
|
|
||||||
FunctionInfoBase const* FindRequest(u32 key) override {
|
|
||||||
return HandlerTableGenerateWithFind(key, functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetProcessId(HLERequestContext& ctx) {
|
void GetProcessId(HLERequestContext& ctx) {
|
||||||
IPC::RequestParser rp{ctx};
|
IPC::RequestParser rp{ctx};
|
||||||
@@ -153,6 +150,9 @@ private:
|
|||||||
rb.PushRaw(override_status);
|
rb.PushRaw(override_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
static constexpr auto functions = CreateStaticMap(
|
static constexpr auto functions = CreateStaticMap(
|
||||||
FunctionInfo{0, nullptr, "GetJitDebugProcessIdList"},
|
FunctionInfo{0, nullptr, "GetJitDebugProcessIdList"},
|
||||||
FunctionInfo{1, nullptr, "StartProcess"},
|
FunctionInfo{1, nullptr, "StartProcess"},
|
||||||
@@ -168,15 +168,7 @@ private:
|
|||||||
|
|
||||||
class Info final : public ServiceFramework<Info> {
|
class Info final : public ServiceFramework<Info> {
|
||||||
public:
|
public:
|
||||||
explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} {
|
explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} {}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &Info::GetProgramId, "GetProgramId"},
|
|
||||||
FunctionInfo{65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"},
|
|
||||||
FunctionInfo{65001, nullptr, "AtmosphereHasLaunchedProgram"},
|
|
||||||
FunctionInfo{65002, nullptr, "AtmosphereGetProcessInfo"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetProgramId(HLERequestContext& ctx) {
|
void GetProgramId(HLERequestContext& ctx) {
|
||||||
@@ -218,6 +210,16 @@ private:
|
|||||||
rb.Push(ResultSuccess);
|
rb.Push(ResultSuccess);
|
||||||
rb.Push(process->GetProcessId());
|
rb.Push(process->GetProcessId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &Info::GetProgramId, "GetProgramId"},
|
||||||
|
FunctionInfo{65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"},
|
||||||
|
FunctionInfo{65001, nullptr, "AtmosphereHasLaunchedProgram"},
|
||||||
|
FunctionInfo{65002, nullptr, "AtmosphereGetProcessInfo"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
class Shell final : public ServiceFramework<Shell> {
|
class Shell final : public ServiceFramework<Shell> {
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ private:
|
|||||||
virtual FunctionInfoBase const* FindRequestTipc(u32 key) = 0;
|
virtual FunctionInfoBase const* FindRequestTipc(u32 key) = 0;
|
||||||
|
|
||||||
void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n);
|
void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n);
|
||||||
void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n);
|
|
||||||
void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info);
|
void ReportUnimplementedFunction(HLERequestContext& ctx, const FunctionInfoBase* info);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -172,6 +171,15 @@ protected:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used exclusively by NFC
|
||||||
|
template<typename T, typename ...Ts>
|
||||||
|
requires (std::same_as<Ts, FunctionInfoTyped<T>> && ...)
|
||||||
|
static constexpr frozen::map<u32, FunctionInfoTyped<T>, sizeof...(Ts)> CreateStaticMapWithClass(Ts... args) {
|
||||||
|
return frozen::map<u32, FunctionInfoTyped<T>, sizeof...(args)>{
|
||||||
|
{args.expected_header, FunctionInfoTyped<T>(args)}...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static FunctionInfoBase const* HandlerTableGenerateWithFind(u32 key, T const& map) {
|
static FunctionInfoBase const* HandlerTableGenerateWithFind(u32 key, T const& map) {
|
||||||
auto const it = map.find(key);
|
auto const it = map.find(key);
|
||||||
@@ -192,49 +200,13 @@ protected:
|
|||||||
return it != handlers.end() ? std::addressof(it->second) : nullptr;
|
return it != handlers.end() ? std::addressof(it->second) : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionInfoBase const* FindRequestTipc(u32 key) override {
|
|
||||||
auto it = handlers_tipc.find(key);
|
|
||||||
return it != handlers_tipc.end() ? std::addressof(it->second) : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr void RegisterHandlersBase(const FunctionInfoBase* functions, std::size_t n) {
|
|
||||||
// Usually this array is sorted by id already, so hint to insert at the end
|
|
||||||
handlers.reserve(handlers.size() + n);
|
|
||||||
for (std::size_t i = 0; i < n; ++i)
|
|
||||||
handlers.emplace_hint(handlers.cend(), functions[i].expected_header, functions[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr void RegisterHandlersBaseTipc(const FunctionInfoBase* functions, std::size_t n) {
|
|
||||||
// Usually this array is sorted by id already, so hint to insert at the end
|
|
||||||
handlers_tipc.reserve(handlers_tipc.size() + n);
|
|
||||||
for (std::size_t i = 0; i < n; ++i)
|
|
||||||
handlers_tipc.emplace_hint(handlers_tipc.cend(), functions[i].expected_header, functions[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Registers handlers in the service.
|
/// Registers handlers in the service.
|
||||||
template <typename T = Self, std::size_t N>
|
template <typename T = Self, std::size_t N>
|
||||||
constexpr void RegisterHandlers(const FunctionInfoTyped<T> (&functions)[N]) {
|
constexpr void RegisterHandlers(const FunctionInfoTyped<T> (&functions)[N]) {
|
||||||
RegisterHandlers(functions, N);
|
// Usually this array is sorted by id already, so hint to insert at the end
|
||||||
}
|
handlers.reserve(handlers.size() + N);
|
||||||
|
for (std::size_t i = 0; i < N; ++i)
|
||||||
/// @brief Registers handlers in the service. Usually prefer using the other RegisterHandlers
|
handlers.emplace_hint(handlers.cend(), functions[i].expected_header, functions[i]);
|
||||||
/// overload in order to avoid needing to specify the array size.
|
|
||||||
template <typename T = Self>
|
|
||||||
constexpr void RegisterHandlers(const FunctionInfoTyped<T>* functions, std::size_t n) {
|
|
||||||
RegisterHandlersBase(functions, n);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Registers handlers in the service.
|
|
||||||
template <typename T = Self, std::size_t N>
|
|
||||||
constexpr void RegisterHandlersTipc(const FunctionInfoTyped<T> (&functions)[N]) {
|
|
||||||
RegisterHandlersTipc(functions, N);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @brief Registers handlers in the service. Usually prefer using the other RegisterHandlers
|
|
||||||
/// overload in order to avoid needing to specify the array size.
|
|
||||||
template <typename T = Self>
|
|
||||||
constexpr void RegisterHandlersTipc(const FunctionInfoTyped<T>* functions, std::size_t n) {
|
|
||||||
RegisterHandlersBaseTipc(functions, n);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -267,7 +239,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
::Common::unordered_map<u32, FunctionInfoBase> handlers;
|
::Common::unordered_map<u32, FunctionInfoBase> handlers;
|
||||||
::Common::unordered_map<u32, FunctionInfoBase> handlers_tipc;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Service
|
} // namespace Service
|
||||||
|
|||||||
@@ -112,6 +112,51 @@ Result ServiceManager::GetServicePort(Kernel::KClientPort** out_client_port,
|
|||||||
return ResultSuccess;
|
return ResultSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Interface to "sm:" service
|
||||||
|
class SM final : public ServiceFramework<SM> {
|
||||||
|
public:
|
||||||
|
explicit SM(ServiceManager& service_manager_, Core::System& system_);
|
||||||
|
~SM() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Initialize(HLERequestContext& ctx);
|
||||||
|
void GetServiceCmif(HLERequestContext& ctx);
|
||||||
|
void GetServiceTipc(HLERequestContext& ctx);
|
||||||
|
void RegisterServiceCmif(HLERequestContext& ctx);
|
||||||
|
void RegisterServiceTipc(HLERequestContext& ctx);
|
||||||
|
void UnregisterService(HLERequestContext& ctx);
|
||||||
|
void AtmosphereHasService(HLERequestContext& ctx);
|
||||||
|
|
||||||
|
Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx);
|
||||||
|
void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count, bool is_light);
|
||||||
|
|
||||||
|
// TODO: We reuse function list for both TIPC and non-TIPC
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
FunctionInfoBase const* FindRequestTipc(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &SM::Initialize, "Initialize"},
|
||||||
|
FunctionInfo{1, &SM::GetServiceTipc, "GetService"},
|
||||||
|
FunctionInfo{2, &SM::RegisterServiceTipc, "RegisterService"},
|
||||||
|
FunctionInfo{3, &SM::UnregisterService, "UnregisterService"},
|
||||||
|
FunctionInfo{4, nullptr, "DetachClient"},
|
||||||
|
FunctionInfo{65000, nullptr, "AtmosphereInstallMitm"},
|
||||||
|
FunctionInfo{65001, nullptr, "AtmosphereUninstallMitm"},
|
||||||
|
FunctionInfo{65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"},
|
||||||
|
FunctionInfo{65003, nullptr, "AtmosphereAcknowledgeMitmSession"},
|
||||||
|
FunctionInfo{65004, nullptr, "AtmosphereHasMitm"},
|
||||||
|
FunctionInfo{65005, nullptr, "AtmosphereWaitMitm"},
|
||||||
|
FunctionInfo{65006, nullptr, "AtmosphereDeclareFutureMitm"},
|
||||||
|
FunctionInfo{65100, &SM::AtmosphereHasService, "AtmosphereHasService"},
|
||||||
|
FunctionInfo{65101, nullptr, "AtmosphereWaitService"}
|
||||||
|
);
|
||||||
|
|
||||||
|
ServiceManager& service_manager;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SM::Initialize service function
|
* SM::Initialize service function
|
||||||
* Inputs:
|
* Inputs:
|
||||||
@@ -194,7 +239,7 @@ Result SM::GetServiceImpl(Kernel::KClientSession** out_client_session, HLEReques
|
|||||||
|
|
||||||
// Create a new session.
|
// Create a new session.
|
||||||
Kernel::KClientSession* session{};
|
Kernel::KClientSession* session{};
|
||||||
if (const auto result = client_port->CreateSession(kernel, &session); result.IsError()) {
|
if (const auto result = client_port->CreateSession(system.Kernel(), &session); result.IsError()) {
|
||||||
LOG_ERROR(Service_SM, "called service={} -> error {:#08x}", name, result.raw);
|
LOG_ERROR(Service_SM, "called service={} -> error {:#08x}", name, result.raw);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -265,42 +310,7 @@ void SM::AtmosphereHasService(HLERequestContext& ctx) {
|
|||||||
SM::SM(ServiceManager& service_manager_, Core::System& system_)
|
SM::SM(ServiceManager& service_manager_, Core::System& system_)
|
||||||
: ServiceFramework{system_, "sm:", 64}
|
: ServiceFramework{system_, "sm:", 64}
|
||||||
, service_manager{service_manager_}
|
, service_manager{service_manager_}
|
||||||
, kernel{system_.Kernel()}
|
{}
|
||||||
{
|
|
||||||
RegisterHandlers({
|
|
||||||
FunctionInfo{0, &SM::Initialize, "Initialize"},
|
|
||||||
FunctionInfo{1, &SM::GetServiceCmif, "GetService"},
|
|
||||||
FunctionInfo{2, &SM::RegisterServiceCmif, "RegisterService"},
|
|
||||||
FunctionInfo{3, &SM::UnregisterService, "UnregisterService"},
|
|
||||||
FunctionInfo{4, nullptr, "DetachClient"},
|
|
||||||
// TODO: are these non-TIPC as well?
|
|
||||||
FunctionInfo{65000, nullptr, "AtmosphereInstallMitm"},
|
|
||||||
FunctionInfo{65001, nullptr, "AtmosphereUninstallMitm"},
|
|
||||||
FunctionInfo{65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"},
|
|
||||||
FunctionInfo{65003, nullptr, "AtmosphereAcknowledgeMitmSession"},
|
|
||||||
FunctionInfo{65004, nullptr, "AtmosphereHasMitm"},
|
|
||||||
FunctionInfo{65005, nullptr, "AtmosphereWaitMitm"},
|
|
||||||
FunctionInfo{65006, nullptr, "AtmosphereDeclareFutureMitm"},
|
|
||||||
FunctionInfo{65100, &SM::AtmosphereHasService, "AtmosphereHasService"},
|
|
||||||
FunctionInfo{65101, nullptr, "AtmosphereWaitService"},
|
|
||||||
});
|
|
||||||
RegisterHandlersTipc({
|
|
||||||
FunctionInfo{0, &SM::Initialize, "Initialize"},
|
|
||||||
FunctionInfo{1, &SM::GetServiceTipc, "GetService"},
|
|
||||||
FunctionInfo{2, &SM::RegisterServiceTipc, "RegisterService"},
|
|
||||||
FunctionInfo{3, &SM::UnregisterService, "UnregisterService"},
|
|
||||||
FunctionInfo{4, nullptr, "DetachClient"},
|
|
||||||
FunctionInfo{65000, nullptr, "AtmosphereInstallMitm"},
|
|
||||||
FunctionInfo{65001, nullptr, "AtmosphereUninstallMitm"},
|
|
||||||
FunctionInfo{65002, nullptr, "Deprecated_AtmosphereAssociatePidTidForMitm"},
|
|
||||||
FunctionInfo{65003, nullptr, "AtmosphereAcknowledgeMitmSession"},
|
|
||||||
FunctionInfo{65004, nullptr, "AtmosphereHasMitm"},
|
|
||||||
FunctionInfo{65005, nullptr, "AtmosphereWaitMitm"},
|
|
||||||
FunctionInfo{65006, nullptr, "AtmosphereDeclareFutureMitm"},
|
|
||||||
FunctionInfo{65100, &SM::AtmosphereHasService, "AtmosphereHasService"},
|
|
||||||
FunctionInfo{65101, nullptr, "AtmosphereWaitService"},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SM::~SM() = default;
|
SM::~SM() = default;
|
||||||
|
|
||||||
|
|||||||
@@ -33,29 +33,7 @@ class SessionRequestHandler;
|
|||||||
namespace Service::SM {
|
namespace Service::SM {
|
||||||
|
|
||||||
class Controller;
|
class Controller;
|
||||||
|
class SM;
|
||||||
/// Interface to "sm:" service
|
|
||||||
class SM final : public ServiceFramework<SM> {
|
|
||||||
public:
|
|
||||||
explicit SM(ServiceManager& service_manager_, Core::System& system_);
|
|
||||||
~SM() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void Initialize(HLERequestContext& ctx);
|
|
||||||
void GetServiceCmif(HLERequestContext& ctx);
|
|
||||||
void GetServiceTipc(HLERequestContext& ctx);
|
|
||||||
void RegisterServiceCmif(HLERequestContext& ctx);
|
|
||||||
void RegisterServiceTipc(HLERequestContext& ctx);
|
|
||||||
void UnregisterService(HLERequestContext& ctx);
|
|
||||||
void AtmosphereHasService(HLERequestContext& ctx);
|
|
||||||
|
|
||||||
Result GetServiceImpl(Kernel::KClientSession** out_client_session, HLERequestContext& ctx);
|
|
||||||
void RegisterServiceImpl(HLERequestContext& ctx, std::string name, u32 max_session_count,
|
|
||||||
bool is_light);
|
|
||||||
|
|
||||||
ServiceManager& service_manager;
|
|
||||||
Kernel::KernelCore& kernel;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ServiceManager {
|
class ServiceManager {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -204,14 +204,15 @@ Result Module::Interface::GetConfigImpl(u64* out_config, ConfigItem config_item)
|
|||||||
|
|
||||||
class CSRNG final : public Module::Interface {
|
class CSRNG final : public Module::Interface {
|
||||||
public:
|
public:
|
||||||
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_)
|
explicit CSRNG(Core::System& system_, std::shared_ptr<Module> module_) : Interface(system_, std::move(module_), "csrng") {}
|
||||||
: Interface(system_, std::move(module_), "csrng") {
|
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
|
||||||
~CSRNG() override = default;
|
~CSRNG() override = default;
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &CSRNG::GenerateRandomBytes, "GenerateRandomBytes"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
@@ -450,29 +450,9 @@ public:
|
|||||||
explicit ISslContext(Core::System& system_, SslVersion version)
|
explicit ISslContext(Core::System& system_, SslVersion version)
|
||||||
: ServiceFramework{system_, "ISslContext"}, ssl_version{version},
|
: ServiceFramework{system_, "ISslContext"}, ssl_version{version},
|
||||||
shared_data{std::make_shared<SslContextSharedData>()} {
|
shared_data{std::make_shared<SslContextSharedData>()} {
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, &ISslContext::SetOption, "SetOption"},
|
|
||||||
FunctionInfo{1, &ISslContext::GetOption, "GetOption"},
|
|
||||||
FunctionInfo{2, &ISslContext::CreateConnection, "CreateConnection"},
|
|
||||||
FunctionInfo{3, &ISslContext::GetConnectionCount, "GetConnectionCount"},
|
|
||||||
FunctionInfo{4, &ISslContext::ImportServerPki, "ImportServerPki"},
|
|
||||||
FunctionInfo{5, &ISslContext::ImportClientPki, "ImportClientPki"},
|
|
||||||
FunctionInfo{6, nullptr, "RemoveServerPki"},
|
|
||||||
FunctionInfo{7, nullptr, "RemoveClientPki"},
|
|
||||||
FunctionInfo{8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"},
|
|
||||||
FunctionInfo{9, nullptr, "AddPolicyOid"},
|
|
||||||
FunctionInfo{10, nullptr, "ImportCrl"},
|
|
||||||
FunctionInfo{11, nullptr, "RemoveCrl"},
|
|
||||||
FunctionInfo{12, nullptr, "ImportClientCertKeyPki"},
|
|
||||||
FunctionInfo{13, nullptr, "GeneratePrivateKeyAndCert"}
|
|
||||||
};
|
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SslVersion ssl_version;
|
|
||||||
std::shared_ptr<SslContextSharedData> shared_data;
|
|
||||||
|
|
||||||
void SetOption(HLERequestContext& ctx) {
|
void SetOption(HLERequestContext& ctx) {
|
||||||
struct Parameters {
|
struct Parameters {
|
||||||
ContextOption option;
|
ContextOption option;
|
||||||
@@ -559,6 +539,28 @@ private:
|
|||||||
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
LOG_WARNING(Service_SSL, "(STUBBED) called");
|
||||||
R_SUCCEED();
|
R_SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, &ISslContext::SetOption, "SetOption"},
|
||||||
|
FunctionInfo{1, &ISslContext::GetOption, "GetOption"},
|
||||||
|
FunctionInfo{2, &ISslContext::CreateConnection, "CreateConnection"},
|
||||||
|
FunctionInfo{3, &ISslContext::GetConnectionCount, "GetConnectionCount"},
|
||||||
|
FunctionInfo{4, &ISslContext::ImportServerPki, "ImportServerPki"},
|
||||||
|
FunctionInfo{5, &ISslContext::ImportClientPki, "ImportClientPki"},
|
||||||
|
FunctionInfo{6, nullptr, "RemoveServerPki"},
|
||||||
|
FunctionInfo{7, nullptr, "RemoveClientPki"},
|
||||||
|
FunctionInfo{8, D<&ISslContext::RegisterInternalPki>, "RegisterInternalPki"},
|
||||||
|
FunctionInfo{9, nullptr, "AddPolicyOid"},
|
||||||
|
FunctionInfo{10, nullptr, "ImportCrl"},
|
||||||
|
FunctionInfo{11, nullptr, "RemoveCrl"},
|
||||||
|
FunctionInfo{12, nullptr, "ImportClientCertKeyPki"},
|
||||||
|
FunctionInfo{13, nullptr, "GeneratePrivateKeyAndCert"}
|
||||||
|
);
|
||||||
|
SslVersion ssl_version;
|
||||||
|
std::shared_ptr<SslContextSharedData> shared_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ISslService final : public ServiceFramework<ISslService> {
|
class ISslService final : public ServiceFramework<ISslService> {
|
||||||
|
|||||||
@@ -19,12 +19,14 @@ class HTC_TENV final : public ServiceFramework<HTC_TENV> {
|
|||||||
public:
|
public:
|
||||||
explicit HTC_TENV(Core::System& system_)
|
explicit HTC_TENV(Core::System& system_)
|
||||||
: ServiceFramework{system_, "htc:tenv"}
|
: ServiceFramework{system_, "htc:tenv"}
|
||||||
{
|
{}
|
||||||
static const FunctionInfo functions[] = {
|
|
||||||
FunctionInfo{0, nullptr, "GetServiceInterface"}
|
FunctionInfoBase const* FindRequest(u32 key) override {
|
||||||
};
|
return HandlerTableGenerateWithFind(key, functions);
|
||||||
RegisterHandlers(functions);
|
|
||||||
}
|
}
|
||||||
|
static constexpr auto functions = CreateStaticMap(
|
||||||
|
FunctionInfo{0, nullptr, "GetServiceInterface"}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
void LoopProcess(Core::System& system) {
|
void LoopProcess(Core::System& system) {
|
||||||
|
|||||||
Reference in New Issue
Block a user