summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2016-04-19 18:59:44 +0200
committerSubv <subv2112@gmail.com>2016-05-13 03:01:27 +0200
commit5679d066b5bc0433378c9ac8f66066f2439eb6c7 (patch)
tree7beebe51d19486343426a4d31f6cac418d2f813a
parentKernel: Implemented shared memory permissions. (diff)
downloadyuzu-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
-rw-r--r--src/core/hle/kernel/shared_memory.cpp11
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));
}