diff options
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 23dc44780..f0cd8471e 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -1169,6 +1169,8 @@ static u32 GetCurrentProcessorNumber32(Core::System& system) { | |||
| 1169 | return GetCurrentProcessorNumber(system); | 1169 | return GetCurrentProcessorNumber(system); |
| 1170 | } | 1170 | } |
| 1171 | 1171 | ||
| 1172 | namespace { | ||
| 1173 | |||
| 1172 | constexpr bool IsValidSharedMemoryPermission(Svc::MemoryPermission perm) { | 1174 | constexpr bool IsValidSharedMemoryPermission(Svc::MemoryPermission perm) { |
| 1173 | switch (perm) { | 1175 | switch (perm) { |
| 1174 | case Svc::MemoryPermission::Read: | 1176 | case Svc::MemoryPermission::Read: |
| @@ -1179,7 +1181,7 @@ constexpr bool IsValidSharedMemoryPermission(Svc::MemoryPermission perm) { | |||
| 1179 | } | 1181 | } |
| 1180 | } | 1182 | } |
| 1181 | 1183 | ||
| 1182 | constexpr bool IsValidRemoteSharedMemoryPermission(Svc::MemoryPermission perm) { | 1184 | [[maybe_unused]] constexpr bool IsValidRemoteSharedMemoryPermission(Svc::MemoryPermission perm) { |
| 1183 | return IsValidSharedMemoryPermission(perm) || perm == Svc::MemoryPermission::DontCare; | 1185 | return IsValidSharedMemoryPermission(perm) || perm == Svc::MemoryPermission::DontCare; |
| 1184 | } | 1186 | } |
| 1185 | 1187 | ||
| @@ -1195,6 +1197,8 @@ constexpr bool IsValidProcessMemoryPermission(Svc::MemoryPermission perm) { | |||
| 1195 | } | 1197 | } |
| 1196 | } | 1198 | } |
| 1197 | 1199 | ||
| 1200 | } // Anonymous namespace | ||
| 1201 | |||
| 1198 | static ResultCode MapSharedMemory(Core::System& system, Handle shmem_handle, VAddr address, | 1202 | static ResultCode MapSharedMemory(Core::System& system, Handle shmem_handle, VAddr address, |
| 1199 | u64 size, Svc::MemoryPermission map_perm) { | 1203 | u64 size, Svc::MemoryPermission map_perm) { |
| 1200 | LOG_TRACE(Kernel_SVC, | 1204 | LOG_TRACE(Kernel_SVC, |
| @@ -1499,10 +1503,14 @@ static void ExitProcess32(Core::System& system) { | |||
| 1499 | ExitProcess(system); | 1503 | ExitProcess(system); |
| 1500 | } | 1504 | } |
| 1501 | 1505 | ||
| 1502 | static constexpr bool IsValidVirtualCoreId(int32_t core_id) { | 1506 | namespace { |
| 1507 | |||
| 1508 | constexpr bool IsValidVirtualCoreId(int32_t core_id) { | ||
| 1503 | return (0 <= core_id && core_id < static_cast<int32_t>(Core::Hardware::NUM_CPU_CORES)); | 1509 | return (0 <= core_id && core_id < static_cast<int32_t>(Core::Hardware::NUM_CPU_CORES)); |
| 1504 | } | 1510 | } |
| 1505 | 1511 | ||
| 1512 | } // Anonymous namespace | ||
| 1513 | |||
| 1506 | /// Creates a new thread | 1514 | /// Creates a new thread |
| 1507 | static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr entry_point, u64 arg, | 1515 | static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr entry_point, u64 arg, |
| 1508 | VAddr stack_bottom, u32 priority, s32 core_id) { | 1516 | VAddr stack_bottom, u32 priority, s32 core_id) { |
| @@ -1886,7 +1894,9 @@ static ResultCode ResetSignal32(Core::System& system, Handle handle) { | |||
| 1886 | return ResetSignal(system, handle); | 1894 | return ResetSignal(system, handle); |
| 1887 | } | 1895 | } |
| 1888 | 1896 | ||
| 1889 | static constexpr bool IsValidTransferMemoryPermission(MemoryPermission perm) { | 1897 | namespace { |
| 1898 | |||
| 1899 | constexpr bool IsValidTransferMemoryPermission(MemoryPermission perm) { | ||
| 1890 | switch (perm) { | 1900 | switch (perm) { |
| 1891 | case MemoryPermission::None: | 1901 | case MemoryPermission::None: |
| 1892 | case MemoryPermission::Read: | 1902 | case MemoryPermission::Read: |
| @@ -1897,6 +1907,8 @@ static constexpr bool IsValidTransferMemoryPermission(MemoryPermission perm) { | |||
| 1897 | } | 1907 | } |
| 1898 | } | 1908 | } |
| 1899 | 1909 | ||
| 1910 | } // Anonymous namespace | ||
| 1911 | |||
| 1900 | /// Creates a TransferMemory object | 1912 | /// Creates a TransferMemory object |
| 1901 | static ResultCode CreateTransferMemory(Core::System& system, Handle* out, VAddr address, u64 size, | 1913 | static ResultCode CreateTransferMemory(Core::System& system, Handle* out, VAddr address, u64 size, |
| 1902 | MemoryPermission map_perm) { | 1914 | MemoryPermission map_perm) { |