diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-12-26 17:46:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-26 17:46:11 +0100 |
commit | de1e5584b32edcc5b43dd7b5757ee4b361f9f70c (patch) | |
tree | a11721530b76fa281f0793ed8469fd9a847f5489 /src/core/hle/service/hle_ipc.cpp | |
parent | Merge pull request #12471 from FearlessTobi/port-7146 (diff) | |
parent | am/jit: reference memory instance from context (diff) | |
download | yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar.gz yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar.bz2 yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar.lz yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar.xz yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.tar.zst yuzu-de1e5584b32edcc5b43dd7b5757ee4b361f9f70c.zip |
Diffstat (limited to 'src/core/hle/service/hle_ipc.cpp')
-rw-r--r-- | src/core/hle/service/hle_ipc.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/hle/service/hle_ipc.cpp b/src/core/hle/service/hle_ipc.cpp index 38955932c..39df77e43 100644 --- a/src/core/hle/service/hle_ipc.cpp +++ b/src/core/hle/service/hle_ipc.cpp @@ -146,10 +146,7 @@ HLERequestContext::HLERequestContext(Kernel::KernelCore& kernel_, Core::Memory:: HLERequestContext::~HLERequestContext() = default; -void HLERequestContext::ParseCommandBuffer(Kernel::KProcess& process, u32_le* src_cmdbuf, - bool incoming) { - client_handle_table = &process.GetHandleTable(); - +void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) { IPC::RequestParser rp(src_cmdbuf); command_header = rp.PopRaw<IPC::CommandHeader>(); @@ -162,7 +159,7 @@ void HLERequestContext::ParseCommandBuffer(Kernel::KProcess& process, u32_le* sr if (command_header->enable_handle_descriptor) { handle_descriptor_header = rp.PopRaw<IPC::HandleDescriptorHeader>(); if (handle_descriptor_header->send_current_pid) { - pid = process.GetProcessId(); + pid = thread->GetOwnerProcess()->GetProcessId(); rp.Skip(2, false); } if (incoming) { @@ -270,9 +267,10 @@ void HLERequestContext::ParseCommandBuffer(Kernel::KProcess& process, u32_le* sr rp.Skip(1, false); // The command is actually an u64, but we don't use the high part. } -Result HLERequestContext::PopulateFromIncomingCommandBuffer(Kernel::KProcess& process, - u32_le* src_cmdbuf) { - ParseCommandBuffer(process, src_cmdbuf, true); +Result HLERequestContext::PopulateFromIncomingCommandBuffer(u32_le* src_cmdbuf) { + client_handle_table = &thread->GetOwnerProcess()->GetHandleTable(); + + ParseCommandBuffer(src_cmdbuf, true); if (command_header->IsCloseCommand()) { // Close does not populate the rest of the IPC header @@ -284,9 +282,9 @@ Result HLERequestContext::PopulateFromIncomingCommandBuffer(Kernel::KProcess& pr return ResultSuccess; } -Result HLERequestContext::WriteToOutgoingCommandBuffer(Kernel::KThread& requesting_thread) { +Result HLERequestContext::WriteToOutgoingCommandBuffer() { auto current_offset = handles_offset; - auto& owner_process = *requesting_thread.GetOwnerProcess(); + auto& owner_process = *thread->GetOwnerProcess(); auto& handle_table = owner_process.GetHandleTable(); for (auto& object : outgoing_copy_objects) { @@ -319,7 +317,7 @@ Result HLERequestContext::WriteToOutgoingCommandBuffer(Kernel::KThread& requesti } // Copy the translated command buffer back into the thread's command buffer area. - memory.WriteBlock(requesting_thread.GetTlsAddress(), cmd_buf.data(), write_size * sizeof(u32)); + memory.WriteBlock(thread->GetTlsAddress(), cmd_buf.data(), write_size * sizeof(u32)); return ResultSuccess; } |