diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 6 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/kernel/wait_object.cpp | 2 |
4 files changed, 9 insertions, 23 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 0d6286f84..f94ac150d 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -232,14 +232,6 @@ const Kernel::GlobalScheduler& KernelCore::GlobalScheduler() const { | |||
| 232 | return impl->global_scheduler; | 232 | return impl->global_scheduler; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| 235 | Core::System& KernelCore::System() { | ||
| 236 | return impl->system; | ||
| 237 | } | ||
| 238 | |||
| 239 | const Core::System& KernelCore::System() const { | ||
| 240 | return impl->system; | ||
| 241 | } | ||
| 242 | |||
| 243 | void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { | 235 | void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { |
| 244 | impl->named_ports.emplace(std::move(name), std::move(port)); | 236 | impl->named_ports.emplace(std::move(name), std::move(port)); |
| 245 | } | 237 | } |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 9fb8f52ec..c4397fc77 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -82,12 +82,6 @@ public: | |||
| 82 | /// Gets the sole instance of the global scheduler | 82 | /// Gets the sole instance of the global scheduler |
| 83 | const Kernel::GlobalScheduler& GlobalScheduler() const; | 83 | const Kernel::GlobalScheduler& GlobalScheduler() const; |
| 84 | 84 | ||
| 85 | /// Gets the sole instance of the system | ||
| 86 | Core::System& System(); | ||
| 87 | |||
| 88 | /// Gets the sole instance of the system | ||
| 89 | const Core::System& System() const; | ||
| 90 | |||
| 91 | /// Adds a port to the named port table | 85 | /// Adds a port to the named port table |
| 92 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); | 86 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); |
| 93 | 87 | ||
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 8663fe5ee..0c11da1e0 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -41,7 +41,7 @@ Thread::~Thread() = default; | |||
| 41 | 41 | ||
| 42 | void Thread::Stop() { | 42 | void Thread::Stop() { |
| 43 | // Cancel any outstanding wakeup events for this thread | 43 | // Cancel any outstanding wakeup events for this thread |
| 44 | kernel.System().CoreTiming().UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), | 44 | Core::System::GetInstance().CoreTiming().UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), |
| 45 | callback_handle); | 45 | callback_handle); |
| 46 | kernel.ThreadWakeupCallbackHandleTable().Close(callback_handle); | 46 | kernel.ThreadWakeupCallbackHandleTable().Close(callback_handle); |
| 47 | callback_handle = 0; | 47 | callback_handle = 0; |
| @@ -68,12 +68,12 @@ void Thread::WakeAfterDelay(s64 nanoseconds) { | |||
| 68 | // This function might be called from any thread so we have to be cautious and use the | 68 | // This function might be called from any thread so we have to be cautious and use the |
| 69 | // thread-safe version of ScheduleEvent. | 69 | // thread-safe version of ScheduleEvent. |
| 70 | const s64 cycles = Core::Timing::nsToCycles(std::chrono::nanoseconds{nanoseconds}); | 70 | const s64 cycles = Core::Timing::nsToCycles(std::chrono::nanoseconds{nanoseconds}); |
| 71 | kernel.System().CoreTiming().ScheduleEvent(cycles, kernel.ThreadWakeupCallbackEventType(), | 71 | Core::System::GetInstance().CoreTiming().ScheduleEvent(cycles, kernel.ThreadWakeupCallbackEventType(), |
| 72 | callback_handle); | 72 | callback_handle); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void Thread::CancelWakeupTimer() { | 75 | void Thread::CancelWakeupTimer() { |
| 76 | kernel.System().CoreTiming().UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), | 76 | Core::System::GetInstance().CoreTiming().UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), |
| 77 | callback_handle); | 77 | callback_handle); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| @@ -176,7 +176,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name | |||
| 176 | return ResultCode(-1); | 176 | return ResultCode(-1); |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | auto& system = kernel.System(); | 179 | auto& system = Core::System::GetInstance(); |
| 180 | SharedPtr<Thread> thread(new Thread(kernel)); | 180 | SharedPtr<Thread> thread(new Thread(kernel)); |
| 181 | 181 | ||
| 182 | thread->thread_id = kernel.CreateNewThreadID(); | 182 | thread->thread_id = kernel.CreateNewThreadID(); |
| @@ -258,7 +258,7 @@ void Thread::SetStatus(ThreadStatus new_status) { | |||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | if (status == ThreadStatus::Running) { | 260 | if (status == ThreadStatus::Running) { |
| 261 | last_running_ticks = kernel.System().CoreTiming().GetTicks(); | 261 | last_running_ticks = Core::System::GetInstance().CoreTiming().GetTicks(); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | status = new_status; | 264 | status = new_status; |
| @@ -356,7 +356,7 @@ void Thread::SetActivity(ThreadActivity value) { | |||
| 356 | // Set status if not waiting | 356 | // Set status if not waiting |
| 357 | if (status == ThreadStatus::Ready || status == ThreadStatus::Running) { | 357 | if (status == ThreadStatus::Ready || status == ThreadStatus::Running) { |
| 358 | SetStatus(ThreadStatus::Paused); | 358 | SetStatus(ThreadStatus::Paused); |
| 359 | kernel.System().CpuCore(processor_id).PrepareReschedule(); | 359 | Core::System::GetInstance().CpuCore(processor_id).PrepareReschedule(); |
| 360 | } | 360 | } |
| 361 | } else if (status == ThreadStatus::Paused) { | 361 | } else if (status == ThreadStatus::Paused) { |
| 362 | // Ready to reschedule | 362 | // Ready to reschedule |
| @@ -475,7 +475,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) { | |||
| 475 | if (GetSchedulingStatus() != ThreadSchedStatus::Runnable) { | 475 | if (GetSchedulingStatus() != ThreadSchedStatus::Runnable) { |
| 476 | return; | 476 | return; |
| 477 | } | 477 | } |
| 478 | auto& scheduler = kernel.System().GlobalScheduler(); | 478 | auto& scheduler = Core::System::GetInstance().GlobalScheduler(); |
| 479 | if (processor_id >= 0) { | 479 | if (processor_id >= 0) { |
| 480 | scheduler.Unschedule(old_priority, processor_id, this); | 480 | scheduler.Unschedule(old_priority, processor_id, this); |
| 481 | } | 481 | } |
| @@ -507,7 +507,7 @@ void Thread::AdjustSchedulingOnPriority(u32 old_priority) { | |||
| 507 | } | 507 | } |
| 508 | 508 | ||
| 509 | void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) { | 509 | void Thread::AdjustSchedulingOnAffinity(u64 old_affinity_mask, s32 old_core) { |
| 510 | auto& scheduler = kernel.System().GlobalScheduler(); | 510 | auto& scheduler = Core::System::GetInstance().GlobalScheduler(); |
| 511 | if (GetSchedulingStatus() != ThreadSchedStatus::Runnable || | 511 | if (GetSchedulingStatus() != ThreadSchedStatus::Runnable || |
| 512 | current_priority >= THREADPRIO_COUNT) { | 512 | current_priority >= THREADPRIO_COUNT) { |
| 513 | return; | 513 | return; |
diff --git a/src/core/hle/kernel/wait_object.cpp b/src/core/hle/kernel/wait_object.cpp index 0f833fb3a..c00cef062 100644 --- a/src/core/hle/kernel/wait_object.cpp +++ b/src/core/hle/kernel/wait_object.cpp | |||
| @@ -95,7 +95,7 @@ void WaitObject::WakeupWaitingThread(SharedPtr<Thread> thread) { | |||
| 95 | } | 95 | } |
| 96 | if (resume) { | 96 | if (resume) { |
| 97 | thread->ResumeFromWait(); | 97 | thread->ResumeFromWait(); |
| 98 | kernel.System().PrepareReschedule(thread->GetProcessorID()); | 98 | Core::System::GetInstance().PrepareReschedule(thread->GetProcessorID()); |
| 99 | } | 99 | } |
| 100 | } | 100 | } |
| 101 | 101 | ||