diff options
| author | 2021-04-11 11:41:48 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:51 -0700 | |
| commit | 269d233a9421e43c2383fe29603b3dfbdaa900e9 (patch) | |
| tree | 7bcfd27ba2a9eee20d696307240108f40320ae04 /src/core/hle/kernel | |
| parent | hle: kernel: KThread: Add missing resource hint release. (diff) | |
| download | yuzu-269d233a9421e43c2383fe29603b3dfbdaa900e9.tar.gz yuzu-269d233a9421e43c2383fe29603b3dfbdaa900e9.tar.xz yuzu-269d233a9421e43c2383fe29603b3dfbdaa900e9.zip | |
hle: kernel: svc_results: Update naming..
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/client_port.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/client_session.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/handle_table.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/k_page_table.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/process_capability.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 38 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_results.h | 17 |
8 files changed, 43 insertions, 42 deletions
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index 431a90d82..d856b83e3 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp | |||
| @@ -21,7 +21,7 @@ std::shared_ptr<ServerPort> ClientPort::GetServerPort() const { | |||
| 21 | 21 | ||
| 22 | ResultVal<std::shared_ptr<ClientSession>> ClientPort::Connect() { | 22 | ResultVal<std::shared_ptr<ClientSession>> ClientPort::Connect() { |
| 23 | if (active_sessions >= max_sessions) { | 23 | if (active_sessions >= max_sessions) { |
| 24 | return ResultMaxConnectionsReached; | 24 | return ResultOutOfSessions; |
| 25 | } | 25 | } |
| 26 | active_sessions++; | 26 | active_sessions++; |
| 27 | 27 | ||
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp index 13c55abe4..fa9cad498 100644 --- a/src/core/hle/kernel/client_session.cpp +++ b/src/core/hle/kernel/client_session.cpp | |||
| @@ -42,7 +42,7 @@ ResultCode ClientSession::SendSyncRequest(KThread* thread, Core::Memory::Memory& | |||
| 42 | Core::Timing::CoreTiming& core_timing) { | 42 | Core::Timing::CoreTiming& core_timing) { |
| 43 | // Keep ServerSession alive until we're done working with it. | 43 | // Keep ServerSession alive until we're done working with it. |
| 44 | if (!parent->Server()) { | 44 | if (!parent->Server()) { |
| 45 | return ResultSessionClosedByRemote; | 45 | return ResultSessionClosed; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | // Signal the server session that new data is available | 48 | // Signal the server session that new data is available |
diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index cc3210ef2..adfcd3c5b 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp | |||
| @@ -68,7 +68,7 @@ ResultVal<Handle> HandleTable::Create(Object* obj) { | |||
| 68 | const u16 slot = next_free_slot; | 68 | const u16 slot = next_free_slot; |
| 69 | if (slot >= table_size) { | 69 | if (slot >= table_size) { |
| 70 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); | 70 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); |
| 71 | return ResultHandleTableFull; | 71 | return ResultOutOfHandles; |
| 72 | } | 72 | } |
| 73 | next_free_slot = generations[slot]; | 73 | next_free_slot = generations[slot]; |
| 74 | 74 | ||
| @@ -93,7 +93,7 @@ ResultCode HandleTable::Add(Handle* out_handle, KAutoObject* obj, u16 type) { | |||
| 93 | const u16 slot = next_free_slot; | 93 | const u16 slot = next_free_slot; |
| 94 | if (slot >= table_size) { | 94 | if (slot >= table_size) { |
| 95 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); | 95 | LOG_ERROR(Kernel, "Unable to allocate Handle, too many slots in use."); |
| 96 | return ResultHandleTableFull; | 96 | return ResultOutOfHandles; |
| 97 | } | 97 | } |
| 98 | next_free_slot = generations[slot]; | 98 | next_free_slot = generations[slot]; |
| 99 | 99 | ||
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp index d09d5ce48..5f60b95cd 100644 --- a/src/core/hle/kernel/k_page_table.cpp +++ b/src/core/hle/kernel/k_page_table.cpp | |||
| @@ -420,7 +420,7 @@ ResultCode KPageTable::MapPhysicalMemory(VAddr addr, std::size_t size) { | |||
| 420 | remaining_size); | 420 | remaining_size); |
| 421 | if (!memory_reservation.Succeeded()) { | 421 | if (!memory_reservation.Succeeded()) { |
| 422 | LOG_ERROR(Kernel, "Could not reserve remaining {:X} bytes", remaining_size); | 422 | LOG_ERROR(Kernel, "Could not reserve remaining {:X} bytes", remaining_size); |
| 423 | return ResultResourceLimitedExceeded; | 423 | return ResultLimitReached; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | KPageLinkedList page_linked_list; | 426 | KPageLinkedList page_linked_list; |
| @@ -578,7 +578,7 @@ ResultCode KPageTable::Unmap(VAddr dst_addr, VAddr src_addr, std::size_t size) { | |||
| 578 | AddRegionToPages(dst_addr, num_pages, dst_pages); | 578 | AddRegionToPages(dst_addr, num_pages, dst_pages); |
| 579 | 579 | ||
| 580 | if (!dst_pages.IsEqual(src_pages)) { | 580 | if (!dst_pages.IsEqual(src_pages)) { |
| 581 | return ResultInvalidMemoryRange; | 581 | return ResultInvalidMemoryRegion; |
| 582 | } | 582 | } |
| 583 | 583 | ||
| 584 | { | 584 | { |
| @@ -790,7 +790,7 @@ ResultVal<VAddr> KPageTable::SetHeapSize(std::size_t size) { | |||
| 790 | 790 | ||
| 791 | if (!memory_reservation.Succeeded()) { | 791 | if (!memory_reservation.Succeeded()) { |
| 792 | LOG_ERROR(Kernel, "Could not reserve heap extension of size {:X} bytes", delta); | 792 | LOG_ERROR(Kernel, "Could not reserve heap extension of size {:X} bytes", delta); |
| 793 | return ResultResourceLimitedExceeded; | 793 | return ResultLimitReached; |
| 794 | } | 794 | } |
| 795 | 795 | ||
| 796 | KPageLinkedList page_linked_list; | 796 | KPageLinkedList page_linked_list; |
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index 8088c634f..678037923 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -276,7 +276,7 @@ ResultCode Process::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | |||
| 276 | if (!memory_reservation.Succeeded()) { | 276 | if (!memory_reservation.Succeeded()) { |
| 277 | LOG_ERROR(Kernel, "Could not reserve process memory requirements of size {:X} bytes", | 277 | LOG_ERROR(Kernel, "Could not reserve process memory requirements of size {:X} bytes", |
| 278 | code_size + system_resource_size); | 278 | code_size + system_resource_size); |
| 279 | return ResultResourceLimitedExceeded; | 279 | return ResultLimitReached; |
| 280 | } | 280 | } |
| 281 | // Initialize proces address space | 281 | // Initialize proces address space |
| 282 | if (const ResultCode result{ | 282 | if (const ResultCode result{ |
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp index 1006ee50c..4ccac0b06 100644 --- a/src/core/hle/kernel/process_capability.cpp +++ b/src/core/hle/kernel/process_capability.cpp | |||
| @@ -159,7 +159,7 @@ ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& s | |||
| 159 | const auto type = GetCapabilityType(flag); | 159 | const auto type = GetCapabilityType(flag); |
| 160 | 160 | ||
| 161 | if (type == CapabilityType::Unset) { | 161 | if (type == CapabilityType::Unset) { |
| 162 | return ResultInvalidCapabilityDescriptor; | 162 | return ResultInvalidArgument; |
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | // Bail early on ignorable entries, as one would expect, | 165 | // Bail early on ignorable entries, as one would expect, |
| @@ -202,7 +202,7 @@ ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& s | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | LOG_ERROR(Kernel, "Invalid capability type! type={}", type); | 204 | LOG_ERROR(Kernel, "Invalid capability type! type={}", type); |
| 205 | return ResultInvalidCapabilityDescriptor; | 205 | return ResultInvalidArgument; |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void ProcessCapabilities::Clear() { | 208 | void ProcessCapabilities::Clear() { |
| @@ -225,7 +225,7 @@ ResultCode ProcessCapabilities::HandlePriorityCoreNumFlags(u32 flags) { | |||
| 225 | if (priority_mask != 0 || core_mask != 0) { | 225 | if (priority_mask != 0 || core_mask != 0) { |
| 226 | LOG_ERROR(Kernel, "Core or priority mask are not zero! priority_mask={}, core_mask={}", | 226 | LOG_ERROR(Kernel, "Core or priority mask are not zero! priority_mask={}, core_mask={}", |
| 227 | priority_mask, core_mask); | 227 | priority_mask, core_mask); |
| 228 | return ResultInvalidCapabilityDescriptor; | 228 | return ResultInvalidArgument; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | const u32 core_num_min = (flags >> 16) & 0xFF; | 231 | const u32 core_num_min = (flags >> 16) & 0xFF; |
| @@ -329,7 +329,7 @@ ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) { | |||
| 329 | const u32 reserved = flags >> 17; | 329 | const u32 reserved = flags >> 17; |
| 330 | if (reserved != 0) { | 330 | if (reserved != 0) { |
| 331 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); | 331 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); |
| 332 | return ResultReservedValue; | 332 | return ResultReservedUsed; |
| 333 | } | 333 | } |
| 334 | 334 | ||
| 335 | program_type = static_cast<ProgramType>((flags >> 14) & 0b111); | 335 | program_type = static_cast<ProgramType>((flags >> 14) & 0b111); |
| @@ -349,7 +349,7 @@ ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { | |||
| 349 | LOG_ERROR(Kernel, | 349 | LOG_ERROR(Kernel, |
| 350 | "Kernel version is non zero or flags are too small! major_version={}, flags={}", | 350 | "Kernel version is non zero or flags are too small! major_version={}, flags={}", |
| 351 | major_version, flags); | 351 | major_version, flags); |
| 352 | return ResultInvalidCapabilityDescriptor; | 352 | return ResultInvalidArgument; |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | kernel_version = flags; | 355 | kernel_version = flags; |
| @@ -360,7 +360,7 @@ ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) { | |||
| 360 | const u32 reserved = flags >> 26; | 360 | const u32 reserved = flags >> 26; |
| 361 | if (reserved != 0) { | 361 | if (reserved != 0) { |
| 362 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); | 362 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); |
| 363 | return ResultReservedValue; | 363 | return ResultReservedUsed; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | handle_table_size = static_cast<s32>((flags >> 16) & 0x3FF); | 366 | handle_table_size = static_cast<s32>((flags >> 16) & 0x3FF); |
| @@ -371,7 +371,7 @@ ResultCode ProcessCapabilities::HandleDebugFlags(u32 flags) { | |||
| 371 | const u32 reserved = flags >> 19; | 371 | const u32 reserved = flags >> 19; |
| 372 | if (reserved != 0) { | 372 | if (reserved != 0) { |
| 373 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); | 373 | LOG_ERROR(Kernel, "Reserved value is non-zero! reserved={}", reserved); |
| 374 | return ResultReservedValue; | 374 | return ResultReservedUsed; |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | is_debuggable = (flags & 0x20000) != 0; | 377 | is_debuggable = (flags & 0x20000) != 0; |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index c6334f91c..5ead3a270 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -113,7 +113,7 @@ ResultCode MapUnmapMemorySanityChecks(const KPageTable& manager, VAddr dst_addr, | |||
| 113 | LOG_ERROR(Kernel_SVC, | 113 | LOG_ERROR(Kernel_SVC, |
| 114 | "Destination is not within the stack region, addr=0x{:016X}, size=0x{:016X}", | 114 | "Destination is not within the stack region, addr=0x{:016X}, size=0x{:016X}", |
| 115 | dst_addr, size); | 115 | dst_addr, size); |
| 116 | return ResultInvalidMemoryRange; | 116 | return ResultInvalidMemoryRegion; |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | if (manager.IsInsideHeapRegion(dst_addr, size)) { | 119 | if (manager.IsInsideHeapRegion(dst_addr, size)) { |
| @@ -121,7 +121,7 @@ ResultCode MapUnmapMemorySanityChecks(const KPageTable& manager, VAddr dst_addr, | |||
| 121 | "Destination does not fit within the heap region, addr=0x{:016X}, " | 121 | "Destination does not fit within the heap region, addr=0x{:016X}, " |
| 122 | "size=0x{:016X}", | 122 | "size=0x{:016X}", |
| 123 | dst_addr, size); | 123 | dst_addr, size); |
| 124 | return ResultInvalidMemoryRange; | 124 | return ResultInvalidMemoryRegion; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | if (manager.IsInsideAliasRegion(dst_addr, size)) { | 127 | if (manager.IsInsideAliasRegion(dst_addr, size)) { |
| @@ -129,7 +129,7 @@ ResultCode MapUnmapMemorySanityChecks(const KPageTable& manager, VAddr dst_addr, | |||
| 129 | "Destination does not fit within the map region, addr=0x{:016X}, " | 129 | "Destination does not fit within the map region, addr=0x{:016X}, " |
| 130 | "size=0x{:016X}", | 130 | "size=0x{:016X}", |
| 131 | dst_addr, size); | 131 | dst_addr, size); |
| 132 | return ResultInvalidMemoryRange; | 132 | return ResultInvalidMemoryRegion; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | return RESULT_SUCCESS; | 135 | return RESULT_SUCCESS; |
| @@ -943,7 +943,7 @@ static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size) | |||
| 943 | 943 | ||
| 944 | if (!(addr < addr + size)) { | 944 | if (!(addr < addr + size)) { |
| 945 | LOG_ERROR(Kernel_SVC, "Size causes 64-bit overflow of address"); | 945 | LOG_ERROR(Kernel_SVC, "Size causes 64-bit overflow of address"); |
| 946 | return ResultInvalidMemoryRange; | 946 | return ResultInvalidMemoryRegion; |
| 947 | } | 947 | } |
| 948 | 948 | ||
| 949 | Process* const current_process{system.Kernel().CurrentProcess()}; | 949 | Process* const current_process{system.Kernel().CurrentProcess()}; |
| @@ -958,14 +958,14 @@ static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size) | |||
| 958 | LOG_ERROR(Kernel_SVC, | 958 | LOG_ERROR(Kernel_SVC, |
| 959 | "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, | 959 | "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, |
| 960 | size); | 960 | size); |
| 961 | return ResultInvalidMemoryRange; | 961 | return ResultInvalidMemoryRegion; |
| 962 | } | 962 | } |
| 963 | 963 | ||
| 964 | if (page_table.IsOutsideAliasRegion(addr, size)) { | 964 | if (page_table.IsOutsideAliasRegion(addr, size)) { |
| 965 | LOG_ERROR(Kernel_SVC, | 965 | LOG_ERROR(Kernel_SVC, |
| 966 | "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, | 966 | "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, |
| 967 | size); | 967 | size); |
| 968 | return ResultInvalidMemoryRange; | 968 | return ResultInvalidMemoryRegion; |
| 969 | } | 969 | } |
| 970 | 970 | ||
| 971 | return page_table.MapPhysicalMemory(addr, size); | 971 | return page_table.MapPhysicalMemory(addr, size); |
| @@ -997,7 +997,7 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size | |||
| 997 | 997 | ||
| 998 | if (!(addr < addr + size)) { | 998 | if (!(addr < addr + size)) { |
| 999 | LOG_ERROR(Kernel_SVC, "Size causes 64-bit overflow of address"); | 999 | LOG_ERROR(Kernel_SVC, "Size causes 64-bit overflow of address"); |
| 1000 | return ResultInvalidMemoryRange; | 1000 | return ResultInvalidMemoryRegion; |
| 1001 | } | 1001 | } |
| 1002 | 1002 | ||
| 1003 | Process* const current_process{system.Kernel().CurrentProcess()}; | 1003 | Process* const current_process{system.Kernel().CurrentProcess()}; |
| @@ -1012,14 +1012,14 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size | |||
| 1012 | LOG_ERROR(Kernel_SVC, | 1012 | LOG_ERROR(Kernel_SVC, |
| 1013 | "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, | 1013 | "Address is not within the address space, addr=0x{:016X}, size=0x{:016X}", addr, |
| 1014 | size); | 1014 | size); |
| 1015 | return ResultInvalidMemoryRange; | 1015 | return ResultInvalidMemoryRegion; |
| 1016 | } | 1016 | } |
| 1017 | 1017 | ||
| 1018 | if (page_table.IsOutsideAliasRegion(addr, size)) { | 1018 | if (page_table.IsOutsideAliasRegion(addr, size)) { |
| 1019 | LOG_ERROR(Kernel_SVC, | 1019 | LOG_ERROR(Kernel_SVC, |
| 1020 | "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, | 1020 | "Address is not within the alias region, addr=0x{:016X}, size=0x{:016X}", addr, |
| 1021 | size); | 1021 | size); |
| 1022 | return ResultInvalidMemoryRange; | 1022 | return ResultInvalidMemoryRegion; |
| 1023 | } | 1023 | } |
| 1024 | 1024 | ||
| 1025 | return page_table.UnmapPhysicalMemory(addr, size); | 1025 | return page_table.UnmapPhysicalMemory(addr, size); |
| @@ -1138,7 +1138,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han | |||
| 1138 | if ((permission_type | MemoryPermission::Write) != MemoryPermission::ReadWrite) { | 1138 | if ((permission_type | MemoryPermission::Write) != MemoryPermission::ReadWrite) { |
| 1139 | LOG_ERROR(Kernel_SVC, "Expected Read or ReadWrite permission but got permissions=0x{:08X}", | 1139 | LOG_ERROR(Kernel_SVC, "Expected Read or ReadWrite permission but got permissions=0x{:08X}", |
| 1140 | permissions); | 1140 | permissions); |
| 1141 | return ResultInvalidMemoryPermissions; | 1141 | return ResultInvalidNewMemoryPermission; |
| 1142 | } | 1142 | } |
| 1143 | 1143 | ||
| 1144 | auto* const current_process{system.Kernel().CurrentProcess()}; | 1144 | auto* const current_process{system.Kernel().CurrentProcess()}; |
| @@ -1149,7 +1149,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han | |||
| 1149 | "Addr does not fit within the valid region, addr=0x{:016X}, " | 1149 | "Addr does not fit within the valid region, addr=0x{:016X}, " |
| 1150 | "size=0x{:016X}", | 1150 | "size=0x{:016X}", |
| 1151 | addr, size); | 1151 | addr, size); |
| 1152 | return ResultInvalidMemoryRange; | 1152 | return ResultInvalidMemoryRegion; |
| 1153 | } | 1153 | } |
| 1154 | 1154 | ||
| 1155 | if (page_table.IsInsideHeapRegion(addr, size)) { | 1155 | if (page_table.IsInsideHeapRegion(addr, size)) { |
| @@ -1157,7 +1157,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han | |||
| 1157 | "Addr does not fit within the heap region, addr=0x{:016X}, " | 1157 | "Addr does not fit within the heap region, addr=0x{:016X}, " |
| 1158 | "size=0x{:016X}", | 1158 | "size=0x{:016X}", |
| 1159 | addr, size); | 1159 | addr, size); |
| 1160 | return ResultInvalidMemoryRange; | 1160 | return ResultInvalidMemoryRegion; |
| 1161 | } | 1161 | } |
| 1162 | 1162 | ||
| 1163 | if (page_table.IsInsideAliasRegion(addr, size)) { | 1163 | if (page_table.IsInsideAliasRegion(addr, size)) { |
| @@ -1165,7 +1165,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han | |||
| 1165 | "Address does not fit within the map region, addr=0x{:016X}, " | 1165 | "Address does not fit within the map region, addr=0x{:016X}, " |
| 1166 | "size=0x{:016X}", | 1166 | "size=0x{:016X}", |
| 1167 | addr, size); | 1167 | addr, size); |
| 1168 | return ResultInvalidMemoryRange; | 1168 | return ResultInvalidMemoryRegion; |
| 1169 | } | 1169 | } |
| 1170 | 1170 | ||
| 1171 | auto shared_memory{ | 1171 | auto shared_memory{ |
| @@ -1290,7 +1290,7 @@ static ResultCode MapProcessCodeMemory(Core::System& system, Handle process_hand | |||
| 1290 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " | 1290 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " |
| 1291 | "size=0x{:016X}).", | 1291 | "size=0x{:016X}).", |
| 1292 | dst_address, size); | 1292 | dst_address, size); |
| 1293 | return ResultInvalidMemoryRange; | 1293 | return ResultInvalidMemoryRegion; |
| 1294 | } | 1294 | } |
| 1295 | 1295 | ||
| 1296 | return page_table.MapProcessCodeMemory(dst_address, src_address, size); | 1296 | return page_table.MapProcessCodeMemory(dst_address, src_address, size); |
| @@ -1358,7 +1358,7 @@ static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_ha | |||
| 1358 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " | 1358 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " |
| 1359 | "size=0x{:016X}).", | 1359 | "size=0x{:016X}).", |
| 1360 | dst_address, size); | 1360 | dst_address, size); |
| 1361 | return ResultInvalidMemoryRange; | 1361 | return ResultInvalidMemoryRegion; |
| 1362 | } | 1362 | } |
| 1363 | 1363 | ||
| 1364 | return page_table.UnmapProcessCodeMemory(dst_address, src_address, size); | 1364 | return page_table.UnmapProcessCodeMemory(dst_address, src_address, size); |
| @@ -1427,7 +1427,7 @@ static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr e | |||
| 1427 | system.CoreTiming().GetGlobalTimeNs().count() + 100000000); | 1427 | system.CoreTiming().GetGlobalTimeNs().count() + 100000000); |
| 1428 | if (!thread_reservation.Succeeded()) { | 1428 | if (!thread_reservation.Succeeded()) { |
| 1429 | LOG_ERROR(Kernel_SVC, "Could not reserve a new thread"); | 1429 | LOG_ERROR(Kernel_SVC, "Could not reserve a new thread"); |
| 1430 | return ResultResourceLimitedExceeded; | 1430 | return ResultLimitReached; |
| 1431 | } | 1431 | } |
| 1432 | 1432 | ||
| 1433 | // Create the thread. | 1433 | // Create the thread. |
| @@ -1795,7 +1795,7 @@ static ResultCode CreateTransferMemory(Core::System& system, Handle* handle, VAd | |||
| 1795 | if (perms > MemoryPermission::ReadWrite || perms == MemoryPermission::Write) { | 1795 | if (perms > MemoryPermission::ReadWrite || perms == MemoryPermission::Write) { |
| 1796 | LOG_ERROR(Kernel_SVC, "Invalid memory permissions for transfer memory! (perms={:08X})", | 1796 | LOG_ERROR(Kernel_SVC, "Invalid memory permissions for transfer memory! (perms={:08X})", |
| 1797 | permissions); | 1797 | permissions); |
| 1798 | return ResultInvalidMemoryPermissions; | 1798 | return ResultInvalidNewMemoryPermission; |
| 1799 | } | 1799 | } |
| 1800 | 1800 | ||
| 1801 | auto& kernel = system.Kernel(); | 1801 | auto& kernel = system.Kernel(); |
| @@ -1804,7 +1804,7 @@ static ResultCode CreateTransferMemory(Core::System& system, Handle* handle, VAd | |||
| 1804 | LimitableResource::TransferMemory); | 1804 | LimitableResource::TransferMemory); |
| 1805 | if (!trmem_reservation.Succeeded()) { | 1805 | if (!trmem_reservation.Succeeded()) { |
| 1806 | LOG_ERROR(Kernel_SVC, "Could not reserve a new transfer memory"); | 1806 | LOG_ERROR(Kernel_SVC, "Could not reserve a new transfer memory"); |
| 1807 | return ResultResourceLimitedExceeded; | 1807 | return ResultLimitReached; |
| 1808 | } | 1808 | } |
| 1809 | auto transfer_mem_handle = TransferMemory::Create(kernel, system.Memory(), addr, size, | 1809 | auto transfer_mem_handle = TransferMemory::Create(kernel, system.Memory(), addr, size, |
| 1810 | static_cast<KMemoryPermission>(perms)); | 1810 | static_cast<KMemoryPermission>(perms)); |
| @@ -1940,7 +1940,7 @@ static ResultCode CreateEvent(Core::System& system, Handle* out_write, Handle* o | |||
| 1940 | // Reserve a new event from the process resource limit | 1940 | // Reserve a new event from the process resource limit |
| 1941 | KScopedResourceReservation event_reservation(kernel.CurrentProcess(), | 1941 | KScopedResourceReservation event_reservation(kernel.CurrentProcess(), |
| 1942 | LimitableResource::Events); | 1942 | LimitableResource::Events); |
| 1943 | R_UNLESS(event_reservation.Succeeded(), ResultResourceLimitedExceeded); | 1943 | R_UNLESS(event_reservation.Succeeded(), ResultLimitReached); |
| 1944 | 1944 | ||
| 1945 | // Create a new event. | 1945 | // Create a new event. |
| 1946 | KEvent* event = KEvent::Create(kernel); | 1946 | KEvent* event = KEvent::Create(kernel); |
diff --git a/src/core/hle/kernel/svc_results.h b/src/core/hle/kernel/svc_results.h index a26d9f2c9..cd32acd99 100644 --- a/src/core/hle/kernel/svc_results.h +++ b/src/core/hle/kernel/svc_results.h | |||
| @@ -10,18 +10,18 @@ namespace Kernel { | |||
| 10 | 10 | ||
| 11 | // Confirmed Switch kernel error codes | 11 | // Confirmed Switch kernel error codes |
| 12 | 12 | ||
| 13 | constexpr ResultCode ResultMaxConnectionsReached{ErrorModule::Kernel, 7}; | 13 | constexpr ResultCode ResultOutOfSessions{ErrorModule::Kernel, 7}; |
| 14 | constexpr ResultCode ResultInvalidCapabilityDescriptor{ErrorModule::Kernel, 14}; | 14 | constexpr ResultCode ResultInvalidArgument{ErrorModule::Kernel, 14}; |
| 15 | constexpr ResultCode ResultNoSynchronizationObject{ErrorModule::Kernel, 57}; | 15 | constexpr ResultCode ResultNoSynchronizationObject{ErrorModule::Kernel, 57}; |
| 16 | constexpr ResultCode ResultTerminationRequested{ErrorModule::Kernel, 59}; | 16 | constexpr ResultCode ResultTerminationRequested{ErrorModule::Kernel, 59}; |
| 17 | constexpr ResultCode ResultInvalidSize{ErrorModule::Kernel, 101}; | 17 | constexpr ResultCode ResultInvalidSize{ErrorModule::Kernel, 101}; |
| 18 | constexpr ResultCode ResultInvalidAddress{ErrorModule::Kernel, 102}; | 18 | constexpr ResultCode ResultInvalidAddress{ErrorModule::Kernel, 102}; |
| 19 | constexpr ResultCode ResultOutOfResource{ErrorModule::Kernel, 103}; | 19 | constexpr ResultCode ResultOutOfResource{ErrorModule::Kernel, 103}; |
| 20 | constexpr ResultCode ResultOutOfMemory{ErrorModule::Kernel, 104}; | 20 | constexpr ResultCode ResultOutOfMemory{ErrorModule::Kernel, 104}; |
| 21 | constexpr ResultCode ResultHandleTableFull{ErrorModule::Kernel, 105}; | 21 | constexpr ResultCode ResultOutOfHandles{ErrorModule::Kernel, 105}; |
| 22 | constexpr ResultCode ResultInvalidCurrentMemory{ErrorModule::Kernel, 106}; | 22 | constexpr ResultCode ResultInvalidCurrentMemory{ErrorModule::Kernel, 106}; |
| 23 | constexpr ResultCode ResultInvalidMemoryPermissions{ErrorModule::Kernel, 108}; | 23 | constexpr ResultCode ResultInvalidNewMemoryPermission{ErrorModule::Kernel, 108}; |
| 24 | constexpr ResultCode ResultInvalidMemoryRange{ErrorModule::Kernel, 110}; | 24 | constexpr ResultCode ResultInvalidMemoryRegion{ErrorModule::Kernel, 110}; |
| 25 | constexpr ResultCode ResultInvalidPriority{ErrorModule::Kernel, 112}; | 25 | constexpr ResultCode ResultInvalidPriority{ErrorModule::Kernel, 112}; |
| 26 | constexpr ResultCode ResultInvalidCoreId{ErrorModule::Kernel, 113}; | 26 | constexpr ResultCode ResultInvalidCoreId{ErrorModule::Kernel, 113}; |
| 27 | constexpr ResultCode ResultInvalidHandle{ErrorModule::Kernel, 114}; | 27 | constexpr ResultCode ResultInvalidHandle{ErrorModule::Kernel, 114}; |
| @@ -33,9 +33,10 @@ constexpr ResultCode ResultOutOfRange{ErrorModule::Kernel, 119}; | |||
| 33 | constexpr ResultCode ResultInvalidEnumValue{ErrorModule::Kernel, 120}; | 33 | constexpr ResultCode ResultInvalidEnumValue{ErrorModule::Kernel, 120}; |
| 34 | constexpr ResultCode ResultNotFound{ErrorModule::Kernel, 121}; | 34 | constexpr ResultCode ResultNotFound{ErrorModule::Kernel, 121}; |
| 35 | constexpr ResultCode ResultBusy{ErrorModule::Kernel, 122}; | 35 | constexpr ResultCode ResultBusy{ErrorModule::Kernel, 122}; |
| 36 | constexpr ResultCode ResultSessionClosedByRemote{ErrorModule::Kernel, 123}; | 36 | constexpr ResultCode ResultSessionClosed{ErrorModule::Kernel, 123}; |
| 37 | constexpr ResultCode ResultInvalidState{ErrorModule::Kernel, 125}; | 37 | constexpr ResultCode ResultInvalidState{ErrorModule::Kernel, 125}; |
| 38 | constexpr ResultCode ResultReservedValue{ErrorModule::Kernel, 126}; | 38 | constexpr ResultCode ResultReservedUsed{ErrorModule::Kernel, 126}; |
| 39 | constexpr ResultCode ResultResourceLimitedExceeded{ErrorModule::Kernel, 132}; | 39 | constexpr ResultCode ResultLimitReached{ErrorModule::Kernel, 132}; |
| 40 | constexpr ResultCode ResultInvalidId{ErrorModule::Kernel, 519}; | ||
| 40 | 41 | ||
| 41 | } // namespace Kernel | 42 | } // namespace Kernel |