From 45c87c7e6e841c11def43e5ab25160006dab6d77 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 28 Nov 2023 14:30:39 -0500 Subject: core: refactor emulated cpu core activation --- src/core/hle/kernel/svc/svc_light_ipc.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/core/hle/kernel/svc/svc_light_ipc.cpp') diff --git a/src/core/hle/kernel/svc/svc_light_ipc.cpp b/src/core/hle/kernel/svc/svc_light_ipc.cpp index b76ce984c..d757d5af2 100644 --- a/src/core/hle/kernel/svc/svc_light_ipc.cpp +++ b/src/core/hle/kernel/svc/svc_light_ipc.cpp @@ -37,37 +37,36 @@ Result ReplyAndReceiveLight64From32(Core::System& system, Handle session_handle, // Custom ABI implementation for light IPC. template -static void SvcWrap_LightIpc(Core::System& system, F&& cb) { - auto& core = system.CurrentArmInterface(); - std::array arguments{}; +static void SvcWrap_LightIpc(Core::System& system, std::span args, F&& cb) { + std::array ipc_args{}; - Handle session_handle = static_cast(core.GetReg(0)); + Handle session_handle = static_cast(args[0]); for (int i = 0; i < 7; i++) { - arguments[i] = static_cast(core.GetReg(i + 1)); + ipc_args[i] = static_cast(args[i + 1]); } - Result ret = cb(system, session_handle, arguments.data()); + Result ret = cb(system, session_handle, ipc_args.data()); - core.SetReg(0, ret.raw); + args[0] = ret.raw; for (int i = 0; i < 7; i++) { - core.SetReg(i + 1, arguments[i]); + args[i + 1] = ipc_args[i]; } } -void SvcWrap_SendSyncRequestLight64(Core::System& system) { - SvcWrap_LightIpc(system, SendSyncRequestLight64); +void SvcWrap_SendSyncRequestLight64(Core::System& system, std::span args) { + SvcWrap_LightIpc(system, args, SendSyncRequestLight64); } -void SvcWrap_ReplyAndReceiveLight64(Core::System& system) { - SvcWrap_LightIpc(system, ReplyAndReceiveLight64); +void SvcWrap_ReplyAndReceiveLight64(Core::System& system, std::span args) { + SvcWrap_LightIpc(system, args, ReplyAndReceiveLight64); } -void SvcWrap_SendSyncRequestLight64From32(Core::System& system) { - SvcWrap_LightIpc(system, SendSyncRequestLight64From32); +void SvcWrap_SendSyncRequestLight64From32(Core::System& system, std::span args) { + SvcWrap_LightIpc(system, args, SendSyncRequestLight64From32); } -void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system) { - SvcWrap_LightIpc(system, ReplyAndReceiveLight64From32); +void SvcWrap_ReplyAndReceiveLight64From32(Core::System& system, std::span args) { + SvcWrap_LightIpc(system, args, ReplyAndReceiveLight64From32); } } // namespace Kernel::Svc -- cgit v1.2.3