diff options
| author | 2022-08-19 21:58:25 -0400 | |
|---|---|---|
| committer | 2022-10-06 21:00:54 +0200 | |
| commit | c80ed6d81fef5858508ac4b841defe8ee3a8663d (patch) | |
| tree | 3f2a193176de0b7e6dff6cefc47172aaf3d6c34e /src/core | |
| parent | nvdisp: End system frame after requesting to swap buffers (diff) | |
| download | yuzu-c80ed6d81fef5858508ac4b841defe8ee3a8663d.tar.gz yuzu-c80ed6d81fef5858508ac4b841defe8ee3a8663d.tar.xz yuzu-c80ed6d81fef5858508ac4b841defe8ee3a8663d.zip | |
general: rework usages of UNREACHABLE macro
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/hle/service/nvdrv/core/syncpoint_manager.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp index 0bb2aec97..072b3a22f 100644 --- a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp +++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp | |||
| @@ -29,7 +29,7 @@ SyncpointManager::~SyncpointManager() = default; | |||
| 29 | 29 | ||
| 30 | u32 SyncpointManager::ReserveSyncpoint(u32 id, bool clientManaged) { | 30 | u32 SyncpointManager::ReserveSyncpoint(u32 id, bool clientManaged) { |
| 31 | if (syncpoints.at(id).reserved) { | 31 | if (syncpoints.at(id).reserved) { |
| 32 | UNREACHABLE_MSG("Requested syncpoint is in use"); | 32 | ASSERT_MSG(false, "Requested syncpoint is in use"); |
| 33 | return 0; | 33 | return 0; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| @@ -45,7 +45,7 @@ u32 SyncpointManager::FindFreeSyncpoint() { | |||
| 45 | return i; | 45 | return i; |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | UNREACHABLE_MSG("Failed to find a free syncpoint!"); | 48 | ASSERT_MSG(false, "Failed to find a free syncpoint!"); |
| 49 | return 0; | 49 | return 0; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| @@ -68,7 +68,7 @@ bool SyncpointManager::HasSyncpointExpired(u32 id, u32 threshold) { | |||
| 68 | const SyncpointInfo& syncpoint{syncpoints.at(id)}; | 68 | const SyncpointInfo& syncpoint{syncpoints.at(id)}; |
| 69 | 69 | ||
| 70 | if (!syncpoint.reserved) { | 70 | if (!syncpoint.reserved) { |
| 71 | UNREACHABLE(); | 71 | ASSERT(false); |
| 72 | return 0; | 72 | return 0; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| @@ -83,7 +83,7 @@ bool SyncpointManager::HasSyncpointExpired(u32 id, u32 threshold) { | |||
| 83 | 83 | ||
| 84 | u32 SyncpointManager::IncrementSyncpointMaxExt(u32 id, u32 amount) { | 84 | u32 SyncpointManager::IncrementSyncpointMaxExt(u32 id, u32 amount) { |
| 85 | if (!syncpoints.at(id).reserved) { | 85 | if (!syncpoints.at(id).reserved) { |
| 86 | UNREACHABLE(); | 86 | ASSERT(false); |
| 87 | return 0; | 87 | return 0; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| @@ -92,7 +92,7 @@ u32 SyncpointManager::IncrementSyncpointMaxExt(u32 id, u32 amount) { | |||
| 92 | 92 | ||
| 93 | u32 SyncpointManager::ReadSyncpointMinValue(u32 id) { | 93 | u32 SyncpointManager::ReadSyncpointMinValue(u32 id) { |
| 94 | if (!syncpoints.at(id).reserved) { | 94 | if (!syncpoints.at(id).reserved) { |
| 95 | UNREACHABLE(); | 95 | ASSERT(false); |
| 96 | return 0; | 96 | return 0; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -101,7 +101,7 @@ u32 SyncpointManager::ReadSyncpointMinValue(u32 id) { | |||
| 101 | 101 | ||
| 102 | u32 SyncpointManager::UpdateMin(u32 id) { | 102 | u32 SyncpointManager::UpdateMin(u32 id) { |
| 103 | if (!syncpoints.at(id).reserved) { | 103 | if (!syncpoints.at(id).reserved) { |
| 104 | UNREACHABLE(); | 104 | ASSERT(false); |
| 105 | return 0; | 105 | return 0; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| @@ -111,7 +111,7 @@ u32 SyncpointManager::UpdateMin(u32 id) { | |||
| 111 | 111 | ||
| 112 | NvFence SyncpointManager::GetSyncpointFence(u32 id) { | 112 | NvFence SyncpointManager::GetSyncpointFence(u32 id) { |
| 113 | if (!syncpoints.at(id).reserved) { | 113 | if (!syncpoints.at(id).reserved) { |
| 114 | UNREACHABLE(); | 114 | ASSERT(false); |
| 115 | return NvFence{}; | 115 | return NvFence{}; |
| 116 | } | 116 | } |
| 117 | 117 | ||
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp index 7a95f5305..192503ffc 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp | |||
| @@ -96,7 +96,7 @@ NvResult nvhost_as_gpu::AllocAsEx(const std::vector<u8>& input, std::vector<u8>& | |||
| 96 | std::scoped_lock lock(mutex); | 96 | std::scoped_lock lock(mutex); |
| 97 | 97 | ||
| 98 | if (vm.initialised) { | 98 | if (vm.initialised) { |
| 99 | UNREACHABLE_MSG("Cannot initialise an address space twice!"); | 99 | ASSERT_MSG(false, "Cannot initialise an address space twice!"); |
| 100 | return NvResult::InvalidState; | 100 | return NvResult::InvalidState; |
| 101 | } | 101 | } |
| 102 | 102 | ||
| @@ -174,7 +174,7 @@ NvResult nvhost_as_gpu::AllocateSpace(const std::vector<u8>& input, std::vector< | |||
| 174 | } else { | 174 | } else { |
| 175 | params.offset = static_cast<u64>(allocator.Allocate(params.pages)) << page_size_bits; | 175 | params.offset = static_cast<u64>(allocator.Allocate(params.pages)) << page_size_bits; |
| 176 | if (!params.offset) { | 176 | if (!params.offset) { |
| 177 | UNREACHABLE_MSG("Failed to allocate free space in the GPU AS!"); | 177 | ASSERT_MSG(false, "Failed to allocate free space in the GPU AS!"); |
| 178 | return NvResult::InsufficientMemory; | 178 | return NvResult::InsufficientMemory; |
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| @@ -372,7 +372,7 @@ NvResult nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8 | |||
| 372 | else if (Common::IsAligned(handle->align, VM::YUZU_PAGESIZE)) | 372 | else if (Common::IsAligned(handle->align, VM::YUZU_PAGESIZE)) |
| 373 | return false; | 373 | return false; |
| 374 | else { | 374 | else { |
| 375 | UNREACHABLE(); | 375 | ASSERT(false); |
| 376 | return false; | 376 | return false; |
| 377 | } | 377 | } |
| 378 | }()}; | 378 | }()}; |
| @@ -382,7 +382,7 @@ NvResult nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8 | |||
| 382 | 382 | ||
| 383 | if (alloc-- == allocation_map.begin() || | 383 | if (alloc-- == allocation_map.begin() || |
| 384 | (params.offset - alloc->first) + size > alloc->second.size) { | 384 | (params.offset - alloc->first) + size > alloc->second.size) { |
| 385 | UNREACHABLE_MSG("Cannot perform a fixed mapping into an unallocated region!"); | 385 | ASSERT_MSG(false, "Cannot perform a fixed mapping into an unallocated region!"); |
| 386 | return NvResult::BadValue; | 386 | return NvResult::BadValue; |
| 387 | } | 387 | } |
| 388 | 388 | ||
| @@ -403,7 +403,7 @@ NvResult nvhost_as_gpu::MapBufferEx(const std::vector<u8>& input, std::vector<u8 | |||
| 403 | static_cast<u32>(Common::AlignUp(size, page_size) >> page_size_bits))) | 403 | static_cast<u32>(Common::AlignUp(size, page_size) >> page_size_bits))) |
| 404 | << page_size_bits; | 404 | << page_size_bits; |
| 405 | if (!params.offset) { | 405 | if (!params.offset) { |
| 406 | UNREACHABLE_MSG("Failed to allocate free space in the GPU AS!"); | 406 | ASSERT_MSG(false, "Failed to allocate free space in the GPU AS!"); |
| 407 | return NvResult::InsufficientMemory; | 407 | return NvResult::InsufficientMemory; |
| 408 | } | 408 | } |
| 409 | 409 | ||