aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/shared_memory.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-25 01:10:26 -0400
committerGitHub <noreply@github.com>2018-10-25 01:10:26 -0400
commitc94db0e0719ad66c6d49bab29b8ed497c55a55f3 (patch)
tree89fc126616fd143866e23dab45a3d064a6c48f87 /src/core/hle/kernel/shared_memory.cpp
parentf7a173de6c574a5117bfe70df3635247ae28edb0 (diff)
parent1fb4bebb63e2824c71259bc72b809d6c2bf48ca9 (diff)
Merge pull request #1577 from lioncash/err
kernel/error: Amend error return code values
Diffstat (limited to 'src/core/hle/kernel/shared_memory.cpp')
-rw-r--r--src/core/hle/kernel/shared_memory.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index d061e6155..a016a86b6 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -80,20 +80,19 @@ SharedPtr<SharedMemory> SharedMemory::CreateForApplet(
ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermission permissions,
MemoryPermission other_permissions) {
-
- MemoryPermission own_other_permissions =
+ const MemoryPermission own_other_permissions =
target_process == owner_process ? this->permissions : this->other_permissions;
// Automatically allocated memory blocks can only be mapped with other_permissions = DontCare
if (base_address == 0 && other_permissions != MemoryPermission::DontCare) {
- return ERR_INVALID_COMBINATION;
+ return ERR_INVALID_MEMORY_PERMISSIONS;
}
// 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={}, address=0x{:X} name={}, permissions don't match",
GetObjectId(), address, name);
- return ERR_INVALID_COMBINATION;
+ return ERR_INVALID_MEMORY_PERMISSIONS;
}
// Error out if the provided permissions are not compatible with what the creator process needs.