diff options
author | Liam <byteslice@airmail.cc> | 2022-10-12 00:16:56 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-10-12 00:40:40 +0200 |
commit | 61a8696510b3bca120f1f0289a3829e3db14834e (patch) | |
tree | 34239a299b7cd842e46df21626f6b190e9b40d14 /src/core/hle/kernel/svc_wrap.h | |
parent | Add implementation of svcCreateSession (diff) | |
download | yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar.gz yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar.bz2 yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar.lz yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar.xz yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.tar.zst yuzu-61a8696510b3bca120f1f0289a3829e3db14834e.zip |
Diffstat (limited to 'src/core/hle/kernel/svc_wrap.h')
-rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 <Result func(Core::System&, s32*, Handle*, s32, Handle, s64)> +void SvcWrap64(Core::System& system) { + s32 param_1 = 0; + s32 num_handles = static_cast<s32>(Param(system, 2)); + + std::vector<Handle> 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<s32>(Param(system, 3)), static_cast<s64>(Param(system, 4))) + .raw; + + system.CurrentArmInterface().SetReg(1, param_1); + FuncReturn(system, retval); +} + // Used by WaitForAddress template <Result func(Core::System&, u64, Svc::ArbitrationType, s32, s64)> void SvcWrap64(Core::System& system) { |