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/svc.cpp | |
| 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/svc.cpp')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
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); |