summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2018-10-24 14:54:32 -0400
committerGravatar Lioncash2018-10-24 14:54:36 -0400
commit239dfea34a08fc370028de96dc094cca66f6e961 (patch)
tree3247a22b8f823d9fe2d00e37d247880f56d44661 /src
parentkernel/server_port: Simplify emptiness check within ShouldWait() (diff)
downloadyuzu-239dfea34a08fc370028de96dc094cca66f6e961.tar.gz
yuzu-239dfea34a08fc370028de96dc094cca66f6e961.tar.xz
yuzu-239dfea34a08fc370028de96dc094cca66f6e961.zip
kernel/shared_memory: Return ERR_INVALID_MEMORY_PERMISSIONS instead of ERR_INVALID_COMBINATION
This is more consistent with what the kernel does.
Diffstat (limited to '')
-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(
80 80
81ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermission permissions, 81ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermission permissions,
82 MemoryPermission other_permissions) { 82 MemoryPermission other_permissions) {
83 83 const MemoryPermission own_other_permissions =
84 MemoryPermission own_other_permissions =
85 target_process == owner_process ? this->permissions : this->other_permissions; 84 target_process == owner_process ? this->permissions : this->other_permissions;
86 85
87 // Automatically allocated memory blocks can only be mapped with other_permissions = DontCare 86 // Automatically allocated memory blocks can only be mapped with other_permissions = DontCare
88 if (base_address == 0 && other_permissions != MemoryPermission::DontCare) { 87 if (base_address == 0 && other_permissions != MemoryPermission::DontCare) {
89 return ERR_INVALID_COMBINATION; 88 return ERR_INVALID_MEMORY_PERMISSIONS;
90 } 89 }
91 90
92 // Error out if the requested permissions don't match what the creator process allows. 91 // Error out if the requested permissions don't match what the creator process allows.
93 if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) { 92 if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) {
94 LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match", 93 LOG_ERROR(Kernel, "cannot map id={}, address=0x{:X} name={}, permissions don't match",
95 GetObjectId(), address, name); 94 GetObjectId(), address, name);
96 return ERR_INVALID_COMBINATION; 95 return ERR_INVALID_MEMORY_PERMISSIONS;
97 } 96 }
98 97
99 // Error out if the provided permissions are not compatible with what the creator process needs. 98 // Error out if the provided permissions are not compatible with what the creator process needs.