diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-10 01:03:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-10 01:03:56 +0100 |
commit | 875568bb3e34725578f7fa3661c8bad89f23a173 (patch) | |
tree | 966c08ba52f4e786765eef72848013a4c7aa559f /src/core/hle/kernel/k_client_session.cpp | |
parent | Merge pull request #12299 from liamwhite/light-ipc (diff) | |
parent | kernel: implement remaining IPC syscalls (diff) | |
download | yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar.gz yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar.bz2 yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar.lz yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar.xz yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.tar.zst yuzu-875568bb3e34725578f7fa3661c8bad89f23a173.zip |
Diffstat (limited to 'src/core/hle/kernel/k_client_session.cpp')
-rw-r--r-- | src/core/hle/kernel/k_client_session.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/core/hle/kernel/k_client_session.cpp b/src/core/hle/kernel/k_client_session.cpp index 72b66270d..472e8571c 100644 --- a/src/core/hle/kernel/k_client_session.cpp +++ b/src/core/hle/kernel/k_client_session.cpp @@ -10,9 +10,7 @@ namespace Kernel { -static constexpr u32 MessageBufferSize = 0x100; - -KClientSession::KClientSession(KernelCore& kernel) : KAutoObjectWithSlabHeapAndContainer{kernel} {} +KClientSession::KClientSession(KernelCore& kernel) : KAutoObject{kernel} {} KClientSession::~KClientSession() = default; void KClientSession::Destroy() { @@ -22,18 +20,30 @@ void KClientSession::Destroy() { void KClientSession::OnServerClosed() {} -Result KClientSession::SendSyncRequest() { +Result KClientSession::SendSyncRequest(uintptr_t address, size_t size) { + // Create a session request. + KSessionRequest* request = KSessionRequest::Create(m_kernel); + R_UNLESS(request != nullptr, ResultOutOfResource); + SCOPE_EXIT({ request->Close(); }); + + // Initialize the request. + request->Initialize(nullptr, address, size); + + // Send the request. + R_RETURN(m_parent->OnRequest(request)); +} + +Result KClientSession::SendAsyncRequest(KEvent* event, uintptr_t address, size_t size) { // Create a session request. KSessionRequest* request = KSessionRequest::Create(m_kernel); R_UNLESS(request != nullptr, ResultOutOfResource); SCOPE_EXIT({ request->Close(); }); // Initialize the request. - request->Initialize(nullptr, GetInteger(GetCurrentThread(m_kernel).GetTlsAddress()), - MessageBufferSize); + request->Initialize(event, address, size); // Send the request. - R_RETURN(m_parent->GetServerSession().OnRequest(request)); + R_RETURN(m_parent->OnRequest(request)); } } // namespace Kernel |