diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_debug_base.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_debug_base.hpp index d43a2f016..10c234e01 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_debug_base.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_debug_base.hpp @@ -58,6 +58,9 @@ namespace ams::kern { private: void PushDebugEvent(ams::svc::DebugEvent event, uintptr_t param0 = 0, uintptr_t param1 = 0, uintptr_t param2 = 0, uintptr_t param3 = 0, uintptr_t param4 = 0); void EnqueueDebugEventInfo(KEventInfo *info); + + template requires (std::same_as || std::same_as) + Result GetDebugEventInfoImpl(T *out); public: virtual void OnFinalizeSynchronizationObject() override; virtual bool IsSignaled() const override; diff --git a/libraries/libmesosphere/source/kern_k_debug_base.cpp b/libraries/libmesosphere/source/kern_k_debug_base.cpp index bdb45f9a5..94b7a0040 100644 --- a/libraries/libmesosphere/source/kern_k_debug_base.cpp +++ b/libraries/libmesosphere/source/kern_k_debug_base.cpp @@ -690,7 +690,8 @@ namespace ams::kern { return this->process; } - Result KDebugBase::GetDebugEventInfo(ams::svc::lp64::DebugEventInfo *out) { + template requires (std::same_as || std::same_as) + Result KDebugBase::GetDebugEventInfoImpl(T *out) { /* Get the attached process. */ KScopedAutoObject process = this->GetProcess(); R_UNLESS(process.IsNotNull(), svc::ResultProcessTerminated()); @@ -801,8 +802,12 @@ namespace ams::kern { return ResultSuccess(); } + Result KDebugBase::GetDebugEventInfo(ams::svc::lp64::DebugEventInfo *out) { + return this->GetDebugEventInfoImpl(out); + } + Result KDebugBase::GetDebugEventInfo(ams::svc::ilp32::DebugEventInfo *out) { - MESOSPHERE_UNIMPLEMENTED(); + return this->GetDebugEventInfoImpl(out); } void KDebugBase::OnFinalizeSynchronizationObject() {