diff options
author | Subv <subv2112@gmail.com> | 2016-04-19 18:59:44 +0200 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2016-05-13 03:01:27 +0200 |
commit | 5679d066b5bc0433378c9ac8f66066f2439eb6c7 (patch) | |
tree | 7beebe51d19486343426a4d31f6cac418d2f813a /src/core/hle | |
parent | Kernel: Implemented shared memory permissions. (diff) | |
download | yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar.gz yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar.bz2 yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar.lz yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar.xz yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.tar.zst yuzu-5679d066b5bc0433378c9ac8f66066f2439eb6c7.zip |
Diffstat (limited to 'src/core/hle')
-rw-r--r-- | src/core/hle/kernel/shared_memory.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index c1e0e556b..2b6007caa 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -77,17 +77,23 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Error out if the requested permissions don't match what the creator process allows. if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) { + LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", + GetObjectId(), address, name.c_str()); return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::OS, ErrorSummary::InvalidArgument, ErrorLevel::Usage); } // Heap-backed memory blocks can not be mapped with other_permissions = DontCare if (base_address != 0 && other_permissions == MemoryPermission::DontCare) { + LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", + GetObjectId(), address, name.c_str()); return ResultCode(ErrorDescription::InvalidCombination, ErrorModule::OS, ErrorSummary::InvalidArgument, ErrorLevel::Usage); } // Error out if the provided permissions are not compatible with what the creator process needs. if (other_permissions != MemoryPermission::DontCare && static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) { + LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", + GetObjectId(), address, name.c_str()); return ResultCode(ErrorDescription::WrongPermission, ErrorModule::OS, ErrorSummary::WrongArgument, ErrorLevel::Permanent); } @@ -117,8 +123,11 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi // Map the memory block into the target process auto result = target_process->vm_manager.MapMemoryBlock(target_address, backing_block, backing_block_offset, size, MemoryState::Shared); - if (result.Failed()) + if (result.Failed()) { + LOG_ERROR(Kernel, "cannot map id=%u, target_address=0x%08X name=%s, error mapping to virtual memory", + GetObjectId(), target_address, name.c_str()); return result.Code(); + } return target_process->vm_manager.ReprotectRange(target_address, size, ConvertPermissions(permissions)); } |