diff options
| author | 2014-08-06 18:30:01 -0400 | |
|---|---|---|
| committer | 2014-08-06 18:30:01 -0400 | |
| commit | d0c179485392903fa413543d6b6908d45bc1f0fb (patch) | |
| tree | a2e85ca4b091042e2e45446fda5b36bf6f62d2b3 /src/core/hle/kernel | |
| parent | Merge pull request #36 from bunnei/fix-memory-unaligned-reads (diff) | |
| parent | GPU: Updated g_last_ticks variable to be more descriptive (represents CPU tic... (diff) | |
| download | yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.gz yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.tar.xz yuzu-d0c179485392903fa413543d6b6908d45bc1f0fb.zip | |
Merge pull request #34 from bunnei/gsp-command-synch
Gsp command synch
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/address_arbiter.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/event.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 6 |
5 files changed, 14 insertions, 5 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 61717bbe4..bdf76e0c2 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -53,7 +53,7 @@ Result ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 va | |||
| 53 | for(int i = 0; i < value; i++) | 53 | for(int i = 0; i < value; i++) |
| 54 | ArbitrateHighestPriorityThread(handle, address); | 54 | ArbitrateHighestPriorityThread(handle, address); |
| 55 | } | 55 | } |
| 56 | HLE::Reschedule(__func__); | 56 | break; |
| 57 | 57 | ||
| 58 | // Wait current thread (acquire the arbiter)... | 58 | // Wait current thread (acquire the arbiter)... |
| 59 | case ArbitrationType::WaitIfLessThan: | 59 | case ArbitrationType::WaitIfLessThan: |
| @@ -61,6 +61,7 @@ Result ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 va | |||
| 61 | Kernel::WaitCurrentThread(WAITTYPE_ARB, handle); | 61 | Kernel::WaitCurrentThread(WAITTYPE_ARB, handle); |
| 62 | HLE::Reschedule(__func__); | 62 | HLE::Reschedule(__func__); |
| 63 | } | 63 | } |
| 64 | break; | ||
| 64 | 65 | ||
| 65 | default: | 66 | default: |
| 66 | ERROR_LOG(KERNEL, "unknown type=%d", type); | 67 | ERROR_LOG(KERNEL, "unknown type=%d", type); |
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 127c0cfc6..1e417e09c 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp | |||
| @@ -42,7 +42,7 @@ public: | |||
| 42 | if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) { | 42 | if (std::find(waiting_threads.begin(), waiting_threads.end(), thread) == waiting_threads.end()) { |
| 43 | waiting_threads.push_back(thread); | 43 | waiting_threads.push_back(thread); |
| 44 | } | 44 | } |
| 45 | Kernel::WaitCurrentThread(WAITTYPE_EVENT); | 45 | Kernel::WaitCurrentThread(WAITTYPE_EVENT, GetHandle()); |
| 46 | } | 46 | } |
| 47 | if (reset_type != RESETTYPE_STICKY && !permanent_locked) { | 47 | if (reset_type != RESETTYPE_STICKY && !permanent_locked) { |
| 48 | locked = true; | 48 | locked = true; |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 1ccf1eb73..055f503f9 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -48,7 +48,7 @@ public: | |||
| 48 | *wait = locked; | 48 | *wait = locked; |
| 49 | 49 | ||
| 50 | if (locked) { | 50 | if (locked) { |
| 51 | Kernel::WaitCurrentThread(WAITTYPE_MUTEX); | 51 | Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle()); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | return 0; | 54 | return 0; |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 86bbf29d0..1d7ded6f6 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -274,7 +274,11 @@ Thread* NextThread() { | |||
| 274 | return Kernel::g_object_pool.GetFast<Thread>(next); | 274 | return Kernel::g_object_pool.GetFast<Thread>(next); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | /// Puts the current thread in the wait state for the given type | 277 | /** |
| 278 | * Puts the current thread in the wait state for the given type | ||
| 279 | * @param wait_type Type of wait | ||
| 280 | * @param wait_handle Handle of Kernel object that we are waiting on, defaults to current thread | ||
| 281 | */ | ||
| 278 | void WaitCurrentThread(WaitType wait_type, Handle wait_handle) { | 282 | void WaitCurrentThread(WaitType wait_type, Handle wait_handle) { |
| 279 | Thread* thread = GetCurrentThread(); | 283 | Thread* thread = GetCurrentThread(); |
| 280 | thread->wait_type = wait_type; | 284 | thread->wait_type = wait_type; |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f2bfdfa1a..39fa38b75 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -69,7 +69,11 @@ void ArbitrateAllThreads(u32 arbiter, u32 address); | |||
| 69 | /// Gets the current thread handle | 69 | /// Gets the current thread handle |
| 70 | Handle GetCurrentThreadHandle(); | 70 | Handle GetCurrentThreadHandle(); |
| 71 | 71 | ||
| 72 | /// Puts the current thread in the wait state for the given type | 72 | /** |
| 73 | * Puts the current thread in the wait state for the given type | ||
| 74 | * @param wait_type Type of wait | ||
| 75 | * @param wait_handle Handle of Kernel object that we are waiting on, defaults to current thread | ||
| 76 | */ | ||
| 73 | void WaitCurrentThread(WaitType wait_type, Handle wait_handle=GetCurrentThreadHandle()); | 77 | void WaitCurrentThread(WaitType wait_type, Handle wait_handle=GetCurrentThreadHandle()); |
| 74 | 78 | ||
| 75 | /// Put current thread in a wait state - on WaitSynchronization | 79 | /// Put current thread in a wait state - on WaitSynchronization |