diff options
| author | 2015-05-19 20:24:30 -0400 | |
|---|---|---|
| committer | 2015-05-20 18:05:47 -0400 | |
| commit | 0b7d2941cf358cfdbfd32b0e5fb8fcca4180336f (patch) | |
| tree | bce96a583e8069dc22e508df62de6cd03f394efc /src/core/hle/kernel | |
| parent | Merge pull request #783 from jroweboy/cond-wait (diff) | |
| download | yuzu-0b7d2941cf358cfdbfd32b0e5fb8fcca4180336f.tar.gz yuzu-0b7d2941cf358cfdbfd32b0e5fb8fcca4180336f.tar.xz yuzu-0b7d2941cf358cfdbfd32b0e5fb8fcca4180336f.zip | |
Kernel: Move reschedules from SVCs to actual mechanisms that reschedule.
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 | 3 | ||||
| -rw-r--r-- | src/core/hle/kernel/mutex.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/semaphore.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 4 |
6 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index a1221766e..195286422 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp | |||
| @@ -79,6 +79,9 @@ ResultCode AddressArbiter::ArbitrateAddress(ArbitrationType type, VAddr address, | |||
| 79 | LOG_ERROR(Kernel, "unknown type=%d", type); | 79 | LOG_ERROR(Kernel, "unknown type=%d", type); |
| 80 | return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage); | 80 | return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::Kernel, ErrorSummary::WrongArgument, ErrorLevel::Usage); |
| 81 | } | 81 | } |
| 82 | |||
| 83 | HLE::Reschedule(__func__); | ||
| 84 | |||
| 82 | return RESULT_SUCCESS; | 85 | return RESULT_SUCCESS; |
| 83 | } | 86 | } |
| 84 | 87 | ||
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index f338f3266..e45deb1c6 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp | |||
| @@ -41,7 +41,10 @@ void Event::Acquire() { | |||
| 41 | 41 | ||
| 42 | void Event::Signal() { | 42 | void Event::Signal() { |
| 43 | signaled = true; | 43 | signaled = true; |
| 44 | |||
| 44 | WakeupAllWaitingThreads(); | 45 | WakeupAllWaitingThreads(); |
| 46 | |||
| 47 | HLE::Reschedule(__func__); | ||
| 45 | } | 48 | } |
| 46 | 49 | ||
| 47 | void Event::Clear() { | 50 | void Event::Clear() { |
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index f530217fd..6aa73df86 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp | |||
| @@ -94,6 +94,8 @@ void Mutex::Release() { | |||
| 94 | ResumeWaitingThread(this); | 94 | ResumeWaitingThread(this); |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | |||
| 98 | HLE::Reschedule(__func__); | ||
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | } // namespace | 101 | } // namespace |
diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 5d6543ef4..dbb4c9b7f 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp | |||
| @@ -54,6 +54,8 @@ ResultVal<s32> Semaphore::Release(s32 release_count) { | |||
| 54 | Acquire(); | 54 | Acquire(); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | HLE::Reschedule(__func__); | ||
| 58 | |||
| 57 | return MakeResult<s32>(previous_count); | 59 | return MakeResult<s32>(previous_count); |
| 58 | } | 60 | } |
| 59 | 61 | ||
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index a5f1904d7..690d33b55 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -109,6 +109,8 @@ void Thread::Stop() { | |||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | Kernel::g_current_process->used_tls_slots[tls_index] = false; | 111 | Kernel::g_current_process->used_tls_slots[tls_index] = false; |
| 112 | |||
| 113 | HLE::Reschedule(__func__); | ||
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | Thread* ArbitrateHighestPriorityThread(u32 address) { | 116 | Thread* ArbitrateHighestPriorityThread(u32 address) { |
| @@ -232,6 +234,8 @@ static Thread* PopNextReadyThread() { | |||
| 232 | void WaitCurrentThread_Sleep() { | 234 | void WaitCurrentThread_Sleep() { |
| 233 | Thread* thread = GetCurrentThread(); | 235 | Thread* thread = GetCurrentThread(); |
| 234 | thread->status = THREADSTATUS_WAIT_SLEEP; | 236 | thread->status = THREADSTATUS_WAIT_SLEEP; |
| 237 | |||
| 238 | HLE::Reschedule(__func__); | ||
| 235 | } | 239 | } |
| 236 | 240 | ||
| 237 | void WaitCurrentThread_WaitSynchronization(std::vector<SharedPtr<WaitObject>> wait_objects, bool wait_set_output, bool wait_all) { | 241 | void WaitCurrentThread_WaitSynchronization(std::vector<SharedPtr<WaitObject>> wait_objects, bool wait_set_output, bool wait_all) { |
| @@ -431,6 +435,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 431 | ready_queue.push_back(thread->current_priority, thread.get()); | 435 | ready_queue.push_back(thread->current_priority, thread.get()); |
| 432 | thread->status = THREADSTATUS_READY; | 436 | thread->status = THREADSTATUS_READY; |
| 433 | 437 | ||
| 438 | HLE::Reschedule(__func__); | ||
| 439 | |||
| 434 | return MakeResult<SharedPtr<Thread>>(std::move(thread)); | 440 | return MakeResult<SharedPtr<Thread>>(std::move(thread)); |
| 435 | } | 441 | } |
| 436 | 442 | ||
diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index e69fece65..25d066bf1 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp | |||
| @@ -52,10 +52,14 @@ void Timer::Set(s64 initial, s64 interval) { | |||
| 52 | u64 initial_microseconds = initial / 1000; | 52 | u64 initial_microseconds = initial / 1000; |
| 53 | CoreTiming::ScheduleEvent(usToCycles(initial_microseconds), | 53 | CoreTiming::ScheduleEvent(usToCycles(initial_microseconds), |
| 54 | timer_callback_event_type, callback_handle); | 54 | timer_callback_event_type, callback_handle); |
| 55 | |||
| 56 | HLE::Reschedule(__func__); | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | void Timer::Cancel() { | 59 | void Timer::Cancel() { |
| 58 | CoreTiming::UnscheduleEvent(timer_callback_event_type, callback_handle); | 60 | CoreTiming::UnscheduleEvent(timer_callback_event_type, callback_handle); |
| 61 | |||
| 62 | HLE::Reschedule(__func__); | ||
| 59 | } | 63 | } |
| 60 | 64 | ||
| 61 | void Timer::Clear() { | 65 | void Timer::Clear() { |