summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/svc.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 16e9704ff..35eee8127 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -63,7 +63,7 @@ bool IsInsideNewMapRegion(const VMManager& vm, VAddr address, u64 size) {
63 vm.GetNewMapRegionEndAddress()); 63 vm.GetNewMapRegionEndAddress());
64} 64}
65 65
66const u64 SZ_8GB = 0x200000000; 66constexpr u64 MAIN_MEMORY_SIZE = 0x200000000;
67 67
68// Helper function that performs the common sanity checks for svcMapMemory 68// Helper function that performs the common sanity checks for svcMapMemory
69// and svcUnmapMemory. This is doable, as both functions perform their sanitizing 69// and svcUnmapMemory. This is doable, as both functions perform their sanitizing
@@ -145,13 +145,13 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {
145 LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size); 145 LOG_TRACE(Kernel_SVC, "called, heap_size=0x{:X}", heap_size);
146 146
147 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 8GB. 147 // Size must be a multiple of 0x200000 (2MB) and be equal to or less than 8GB.
148 if ((heap_size & 0x1FFFFF) != 0) { 148 if ((heap_size % 0x200000) != 0) {
149 LOG_ERROR(Kernel_SVC, "The heap size is not a multiple of 2MB, heap_size=0x{:016X}", 149 LOG_ERROR(Kernel_SVC, "The heap size is not a multiple of 2MB, heap_size=0x{:016X}",
150 heap_size); 150 heap_size);
151 return ERR_INVALID_SIZE; 151 return ERR_INVALID_SIZE;
152 } 152 }
153 153
154 if (heap_size >= SZ_8GB) { 154 if (heap_size >= 0x200000000) {
155 LOG_ERROR(Kernel_SVC, "The heap size is not less than 8GB, heap_size=0x{:016X}", heap_size); 155 LOG_ERROR(Kernel_SVC, "The heap size is not less than 8GB, heap_size=0x{:016X}", heap_size);
156 return ERR_INVALID_SIZE; 156 return ERR_INVALID_SIZE;
157 } 157 }
@@ -1453,7 +1453,7 @@ static ResultCode CreateSharedMemory(Handle* handle, u64 size, u32 local_permiss
1453 return ERR_INVALID_SIZE; 1453 return ERR_INVALID_SIZE;
1454 } 1454 }
1455 1455
1456 if (size >= SZ_8GB) { 1456 if (size >= MAIN_MEMORY_SIZE) {
1457 LOG_ERROR(Kernel_SVC, "Size is not less than 8GB, 0x{:016X}", size); 1457 LOG_ERROR(Kernel_SVC, "Size is not less than 8GB, 0x{:016X}", size);
1458 return ERR_INVALID_SIZE; 1458 return ERR_INVALID_SIZE;
1459 } 1459 }