summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/svc/svc_light_ipc.cpp
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2023-12-07 01:54:52 +0100
committerLiam <byteslice@airmail.cc>2023-12-07 15:13:43 +0100
commit9268f265a1207f0cddb97a908a1cc349f9b6410b (patch)
tree5da6aea714523b3504b78362c5d8abd53689d72f /src/core/hle/kernel/svc/svc_light_ipc.cpp
parentMerge pull request #12236 from liamwhite/cpu-refactor (diff)
downloadyuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.gz
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.bz2
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.lz
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.xz
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.tar.zst
yuzu-9268f265a1207f0cddb97a908a1cc349f9b6410b.zip
Diffstat (limited to 'src/core/hle/kernel/svc/svc_light_ipc.cpp')
-rw-r--r--src/core/hle/kernel/svc/svc_light_ipc.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/core/hle/kernel/svc/svc_light_ipc.cpp b/src/core/hle/kernel/svc/svc_light_ipc.cpp
index d757d5af2..4772cbda1 100644
--- a/src/core/hle/kernel/svc/svc_light_ipc.cpp
+++ b/src/core/hle/kernel/svc/svc_light_ipc.cpp
@@ -1,21 +1,40 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "core/arm/arm_interface.h"
#include "core/core.h"
+#include "core/hle/kernel/k_light_client_session.h"
+#include "core/hle/kernel/k_light_server_session.h"
+#include "core/hle/kernel/k_process.h"
+#include "core/hle/kernel/k_thread.h"
#include "core/hle/kernel/svc.h"
#include "core/hle/kernel/svc_results.h"
namespace Kernel::Svc {
Result SendSyncRequestLight(Core::System& system, Handle session_handle, u32* args) {
- UNIMPLEMENTED();
- R_THROW(ResultNotImplemented);
+ // Get the light client session from its handle.
+ KScopedAutoObject session = GetCurrentProcess(system.Kernel())
+ .GetHandleTable()
+ .GetObject<KLightClientSession>(session_handle);
+ R_UNLESS(session.IsNotNull(), ResultInvalidHandle);
+
+ // Send the request.
+ R_TRY(session->SendSyncRequest(args));
+
+ R_SUCCEED();
}
Result ReplyAndReceiveLight(Core::System& system, Handle session_handle, u32* args) {
- UNIMPLEMENTED();
- R_THROW(ResultNotImplemented);
+ // Get the light server session from its handle.
+ KScopedAutoObject session = GetCurrentProcess(system.Kernel())
+ .GetHandleTable()
+ .GetObject<KLightServerSession>(session_handle);
+ R_UNLESS(session.IsNotNull(), ResultInvalidHandle);
+
+ // Handle the request.
+ R_TRY(session->ReplyAndReceive(args));
+
+ R_SUCCEED();
}
Result SendSyncRequestLight64(Core::System& system, Handle session_handle, u32* args) {