summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-01-14 17:17:53 -0500
committerGravatar bunnei2018-01-14 17:20:55 -0500
commit22659afcd0a7a4e6e2dafd8ad87594caac6a32cc (patch)
treea067e416e1bca499787f872fd97a8549f10e471d /src
parentsvc: Implement svcMapSharedMemory. (diff)
downloadyuzu-22659afcd0a7a4e6e2dafd8ad87594caac6a32cc.tar.gz
yuzu-22659afcd0a7a4e6e2dafd8ad87594caac6a32cc.tar.xz
yuzu-22659afcd0a7a4e6e2dafd8ad87594caac6a32cc.zip
shared_memory: Minor fixes and cleanup.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/shared_memory.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index d45daca35..7279366ec 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -106,14 +106,14 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
106 106
107 // Error out if the requested permissions don't match what the creator process allows. 107 // Error out if the requested permissions don't match what the creator process allows.
108 if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) { 108 if (static_cast<u32>(permissions) & ~static_cast<u32>(own_other_permissions)) {
109 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", 109 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%llx name=%s, permissions don't match",
110 GetObjectId(), address, name.c_str()); 110 GetObjectId(), address, name.c_str());
111 return ERR_INVALID_COMBINATION; 111 return ERR_INVALID_COMBINATION;
112 } 112 }
113 113
114 // Heap-backed memory blocks can not be mapped with other_permissions = DontCare 114 // Heap-backed memory blocks can not be mapped with other_permissions = DontCare
115 if (base_address != 0 && other_permissions == MemoryPermission::DontCare) { 115 if (base_address != 0 && other_permissions == MemoryPermission::DontCare) {
116 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", 116 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%llx name=%s, permissions don't match",
117 GetObjectId(), address, name.c_str()); 117 GetObjectId(), address, name.c_str());
118 return ERR_INVALID_COMBINATION; 118 return ERR_INVALID_COMBINATION;
119 } 119 }
@@ -121,7 +121,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
121 // Error out if the provided permissions are not compatible with what the creator process needs. 121 // Error out if the provided permissions are not compatible with what the creator process needs.
122 if (other_permissions != MemoryPermission::DontCare && 122 if (other_permissions != MemoryPermission::DontCare &&
123 static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) { 123 static_cast<u32>(this->permissions) & ~static_cast<u32>(other_permissions)) {
124 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, permissions don't match", 124 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%llx name=%s, permissions don't match",
125 GetObjectId(), address, name.c_str()); 125 GetObjectId(), address, name.c_str());
126 return ERR_WRONG_PERMISSION; 126 return ERR_WRONG_PERMISSION;
127 } 127 }
@@ -136,8 +136,8 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
136 // can not map it in its own address space unless it was created with addr=0, result 0xD900182C. 136 // can not map it in its own address space unless it was created with addr=0, result 0xD900182C.
137 137
138 if (address != 0) { 138 if (address != 0) {
139 if (address < Memory::HEAP_VADDR || address + size >= Memory::SHARED_MEMORY_VADDR_END) { 139 if (address < Memory::HEAP_VADDR) {
140 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%08X name=%s, invalid address", 140 LOG_ERROR(Kernel, "cannot map id=%u, address=0x%llx name=%s, invalid address",
141 GetObjectId(), address, name.c_str()); 141 GetObjectId(), address, name.c_str());
142 return ERR_INVALID_ADDRESS; 142 return ERR_INVALID_ADDRESS;
143 } 143 }
@@ -156,7 +156,7 @@ ResultCode SharedMemory::Map(Process* target_process, VAddr address, MemoryPermi
156 if (result.Failed()) { 156 if (result.Failed()) {
157 LOG_ERROR( 157 LOG_ERROR(
158 Kernel, 158 Kernel,
159 "cannot map id=%u, target_address=0x%08X name=%s, error mapping to virtual memory", 159 "cannot map id=%u, target_address=0x%llx name=%s, error mapping to virtual memory",
160 GetObjectId(), target_address, name.c_str()); 160 GetObjectId(), target_address, name.c_str());
161 return result.Code(); 161 return result.Code();
162 } 162 }