summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/hle_ipc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/hle_ipc.cpp')
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index be24cef06..8b01567a8 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -214,10 +214,11 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const HandleTabl
ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(Thread& thread) {
auto& owner_process = *thread.GetOwnerProcess();
auto& handle_table = owner_process.GetHandleTable();
+ auto& memory = Core::System::GetInstance().Memory();
std::array<u32, IPC::COMMAND_BUFFER_LENGTH> dst_cmdbuf;
- Memory::ReadBlock(owner_process, thread.GetTLSAddress(), dst_cmdbuf.data(),
- dst_cmdbuf.size() * sizeof(u32));
+ memory.ReadBlock(owner_process, thread.GetTLSAddress(), dst_cmdbuf.data(),
+ dst_cmdbuf.size() * sizeof(u32));
// The header was already built in the internal command buffer. Attempt to parse it to verify
// the integrity and then copy it over to the target command buffer.
@@ -273,8 +274,8 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(Thread& thread) {
}
// Copy the translated command buffer back into the thread's command buffer area.
- Memory::WriteBlock(owner_process, thread.GetTLSAddress(), dst_cmdbuf.data(),
- dst_cmdbuf.size() * sizeof(u32));
+ memory.WriteBlock(owner_process, thread.GetTLSAddress(), dst_cmdbuf.data(),
+ dst_cmdbuf.size() * sizeof(u32));
return RESULT_SUCCESS;
}
@@ -282,15 +283,14 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(Thread& thread) {
std::vector<u8> HLERequestContext::ReadBuffer(int buffer_index) const {
std::vector<u8> buffer;
const bool is_buffer_a{BufferDescriptorA().size() && BufferDescriptorA()[buffer_index].Size()};
+ auto& memory = Core::System::GetInstance().Memory();
if (is_buffer_a) {
buffer.resize(BufferDescriptorA()[buffer_index].Size());
- Memory::ReadBlock(BufferDescriptorA()[buffer_index].Address(), buffer.data(),
- buffer.size());
+ memory.ReadBlock(BufferDescriptorA()[buffer_index].Address(), buffer.data(), buffer.size());
} else {
buffer.resize(BufferDescriptorX()[buffer_index].Size());
- Memory::ReadBlock(BufferDescriptorX()[buffer_index].Address(), buffer.data(),
- buffer.size());
+ memory.ReadBlock(BufferDescriptorX()[buffer_index].Address(), buffer.data(), buffer.size());
}
return buffer;
@@ -311,10 +311,11 @@ std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
size = buffer_size; // TODO(bunnei): This needs to be HW tested
}
+ auto& memory = Core::System::GetInstance().Memory();
if (is_buffer_b) {
- Memory::WriteBlock(BufferDescriptorB()[buffer_index].Address(), buffer, size);
+ memory.WriteBlock(BufferDescriptorB()[buffer_index].Address(), buffer, size);
} else {
- Memory::WriteBlock(BufferDescriptorC()[buffer_index].Address(), buffer, size);
+ memory.WriteBlock(BufferDescriptorC()[buffer_index].Address(), buffer, size);
}
return size;