diff options
| author | 2020-05-02 02:51:50 -0400 | |
|---|---|---|
| committer | 2020-05-02 02:51:50 -0400 | |
| commit | 5ddcc1b2f582b10ac52ba9d329bfb4e49360c738 (patch) | |
| tree | fcfa54f0c46919bbe940fa6ce8f9a0bfc304cef8 /src/core/hle/kernel/mutex.cpp | |
| parent | Merge pull request #3732 from lioncash/header (diff) | |
| parent | kernel: Don't fail silently (diff) | |
| download | yuzu-5ddcc1b2f582b10ac52ba9d329bfb4e49360c738.tar.gz yuzu-5ddcc1b2f582b10ac52ba9d329bfb4e49360c738.tar.xz yuzu-5ddcc1b2f582b10ac52ba9d329bfb4e49360c738.zip | |
Merge pull request #3819 from ogniK5377/err-log2
kernel: Don't fail silently
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index eff4e45b0..7869eb32b 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <vector> | 7 | #include <vector> |
| 8 | 8 | ||
| 9 | #include "common/assert.h" | 9 | #include "common/assert.h" |
| 10 | #include "common/logging/log.h" | ||
| 10 | #include "core/core.h" | 11 | #include "core/core.h" |
| 11 | #include "core/hle/kernel/errors.h" | 12 | #include "core/hle/kernel/errors.h" |
| 12 | #include "core/hle/kernel/handle_table.h" | 13 | #include "core/hle/kernel/handle_table.h" |
| @@ -67,6 +68,7 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle, | |||
| 67 | Handle requesting_thread_handle) { | 68 | Handle requesting_thread_handle) { |
| 68 | // The mutex address must be 4-byte aligned | 69 | // The mutex address must be 4-byte aligned |
| 69 | if ((address % sizeof(u32)) != 0) { | 70 | if ((address % sizeof(u32)) != 0) { |
| 71 | LOG_ERROR(Kernel, "Address is not 4-byte aligned! address={:016X}", address); | ||
| 70 | return ERR_INVALID_ADDRESS; | 72 | return ERR_INVALID_ADDRESS; |
| 71 | } | 73 | } |
| 72 | 74 | ||
| @@ -88,6 +90,8 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle, | |||
| 88 | } | 90 | } |
| 89 | 91 | ||
| 90 | if (holding_thread == nullptr) { | 92 | if (holding_thread == nullptr) { |
| 93 | LOG_ERROR(Kernel, "Holding thread does not exist! thread_handle={:08X}", | ||
| 94 | holding_thread_handle); | ||
| 91 | return ERR_INVALID_HANDLE; | 95 | return ERR_INVALID_HANDLE; |
| 92 | } | 96 | } |
| 93 | 97 | ||
| @@ -109,6 +113,7 @@ ResultCode Mutex::TryAcquire(VAddr address, Handle holding_thread_handle, | |||
| 109 | ResultCode Mutex::Release(VAddr address) { | 113 | ResultCode Mutex::Release(VAddr address) { |
| 110 | // The mutex address must be 4-byte aligned | 114 | // The mutex address must be 4-byte aligned |
| 111 | if ((address % sizeof(u32)) != 0) { | 115 | if ((address % sizeof(u32)) != 0) { |
| 116 | LOG_ERROR(Kernel, "Address is not 4-byte aligned! address={:016X}", address); | ||
| 112 | return ERR_INVALID_ADDRESS; | 117 | return ERR_INVALID_ADDRESS; |
| 113 | } | 118 | } |
| 114 | 119 | ||