From 9b34afa588c4e4bf312e2812ffe6879e09dafc75 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 3 Oct 2022 22:52:52 -0400 Subject: Add implementation of svcCreateSession --- src/core/hle/kernel/svc_wrap.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/hle/kernel/svc_wrap.h') diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 4bc49087e..16bf65802 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -346,6 +346,20 @@ void SvcWrap64(Core::System& system) { FuncReturn(system, retval); } +// Used by CreateSession +template +void SvcWrap64(Core::System& system) { + Handle param_1 = 0; + Handle param_2 = 0; + const u32 retval = func(system, ¶m_1, ¶m_2, static_cast(Param(system, 2)), + static_cast(Param(system, 3))) + .raw; + + system.CurrentArmInterface().SetReg(1, param_1); + system.CurrentArmInterface().SetReg(2, param_2); + FuncReturn(system, retval); +} + // Used by WaitForAddress template void SvcWrap64(Core::System& system) { -- cgit v1.2.3 From 61a8696510b3bca120f1f0289a3829e3db14834e Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 11 Oct 2022 18:16:56 -0400 Subject: k_server_session: preliminary support for userspace server sessions --- src/core/hle/kernel/svc_wrap.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/core/hle/kernel/svc_wrap.h') diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 16bf65802..272c54cf7 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -8,6 +8,7 @@ #include "core/core.h" #include "core/hle/kernel/svc_types.h" #include "core/hle/result.h" +#include "core/memory.h" namespace Kernel { @@ -360,6 +361,23 @@ void SvcWrap64(Core::System& system) { FuncReturn(system, retval); } +// Used by ReplyAndReceive +template +void SvcWrap64(Core::System& system) { + s32 param_1 = 0; + s32 num_handles = static_cast(Param(system, 2)); + + std::vector handles(num_handles); + system.Memory().ReadBlock(Param(system, 1), handles.data(), num_handles * sizeof(Handle)); + + const u32 retval = func(system, ¶m_1, handles.data(), num_handles, + static_cast(Param(system, 3)), static_cast(Param(system, 4))) + .raw; + + system.CurrentArmInterface().SetReg(1, param_1); + FuncReturn(system, retval); +} + // Used by WaitForAddress template void SvcWrap64(Core::System& system) { -- cgit v1.2.3