Kernel/IPC: Partially implement MappedBuffer translation.

Right now only MappedBuffers that only span a single page and are not aligned are implemented.

MappedBuffers are unmapped during the reply part of ReplyAndReceive. Only unmapping of ReadOnly buffers is currently implemented.
This commit is contained in:
Subv 2017-11-07 14:35:17 -05:00
parent 928202f744
commit a7a5c5aa0d
5 changed files with 102 additions and 14 deletions

View file

@ -472,8 +472,8 @@ static ResultCode ReceiveIPCRequest(SharedPtr<ServerSession> server_session,
VAddr target_address = thread->GetCommandBufferAddress();
VAddr source_address = server_session->currently_handling->GetCommandBufferAddress();
ResultCode translation_result = TranslateCommandBuffer(server_session->currently_handling,
thread, source_address, target_address);
ResultCode translation_result = TranslateCommandBuffer(
server_session->currently_handling, thread, source_address, target_address, false);
// If a translation error occurred, immediately resume the client thread.
if (translation_result.IsError()) {
@ -535,8 +535,8 @@ static ResultCode ReplyAndReceive(s32* index, VAddr handles_address, s32 handle_
VAddr source_address = GetCurrentThread()->GetCommandBufferAddress();
VAddr target_address = request_thread->GetCommandBufferAddress();
ResultCode translation_result = TranslateCommandBuffer(GetCurrentThread(), request_thread,
source_address, target_address);
ResultCode translation_result = TranslateCommandBuffer(
Kernel::GetCurrentThread(), request_thread, source_address, target_address, true);
// Note: The real kernel seems to always panic if the Server->Client buffer translation
// fails for whatever reason.