diff options
author | Liam <byteslice@airmail.cc> | 2023-12-06 23:29:32 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-12-06 23:33:00 +0100 |
commit | 40bb176c396b7af6ca50d2e26561cbb20d2e40d1 (patch) | |
tree | 2c2ed0803aee8dedecc5eaa7d1d56490b93d4665 /src/core/hle/kernel/k_client_session.cpp | |
parent | Merge pull request #12236 from liamwhite/cpu-refactor (diff) | |
download | yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar.gz yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar.bz2 yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar.lz yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar.xz yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.tar.zst yuzu-40bb176c396b7af6ca50d2e26561cbb20d2e40d1.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 |