aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/service/lm/lm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/lm/lm.cpp')
-rw-r--r--src/core/hle/service/lm/lm.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index be8cdf9aa9..d631a6dd80 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -87,7 +87,16 @@ DECLARE_ENUM_FLAG_OPERATORS(LogPacketFlags);
class ILogger final : public ServiceFramework<ILogger> {
public:
- explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {}
+ explicit ILogger(Core::System& system_) : ServiceFramework{system_, "ILogger"} {
+ static const FunctionInfo functions[] = {
+ {0, &ILogger::Log, "Log"},
+ {1, &ILogger::SetDestination, "SetDestination"},
+ {2, nullptr, "TransmitHashedLog"}, //20.0.0+
+ {3, nullptr, "DevNotify"}, //20.0.0+
+ };
+ RegisterHandlers(functions);
+ }
+
private:
void Log(HLERequestContext& ctx) {
std::size_t offset{};
@@ -322,25 +331,20 @@ private:
};
static_assert(sizeof(LogPacketHeader) == 0x18, "LogPacketHeader is an invalid size");
- std::optional<FunctionInfoBase> 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", MakeVersionGate({20,0,0})},
- FunctionInfo{3, nullptr, "DevNotify", MakeVersionGate({20,0,0})}
- );
::Common::unordered_map<LogPacketHeaderEntry, std::vector<u8>> entries{};
LogDestination destination{LogDestination::All};
};
class LM final : public ServiceFramework<LM> {
public:
- explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} {}
+ explicit LM(Core::System& system_) : ServiceFramework{system_, "lm"} {
+ // clang-format off
+ static const FunctionInfo functions[] = {
+ {0, &LM::OpenLogger, "OpenLogger"},
+ };
+ // clang-format on
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
+ RegisterHandlers(functions);
}
private:
@@ -351,26 +355,21 @@ private:
rb.Push(ResultSuccess);
rb.PushIpcInterface<ILogger>(ctx, system);
}
-
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, &LM::OpenLogger, "OpenLogger"}
- );
};
class LM_GET final : public ServiceFramework<LM_GET> {
public:
- explicit LM_GET(Core::System& system_) : ServiceFramework{system_, "lm:get"} {}
-
- std::optional<FunctionInfoBase> FindRequest(u32 key) override {
- return HandlerTableGenerateWithFind(key, functions);
+ explicit LM_GET(Core::System& system_)
+ : ServiceFramework{system_, "lm:get"}
+ {
+ static const FunctionInfo functions[] = {
+ {0, nullptr, "StartLogging"},
+ {1, nullptr, "StopLogging"},
+ {2, nullptr, "GetLog"},
+ {100, nullptr, "CreateDevNotificationReceiver"},
+ };
+ RegisterHandlers(functions);
}
-
- static constexpr auto functions = CreateStaticMap(
- FunctionInfo{0, nullptr, "StartLogging"},
- FunctionInfo{1, nullptr, "StopLogging"},
- FunctionInfo{2, nullptr, "GetLog"},
- FunctionInfo{100, nullptr, "CreateDevNotificationReceiver"}
- );
};
void LoopProcess(Core::System& system) {