diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index e8ece8164..c0ff287a6 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -38,7 +38,6 @@ | |||
| 38 | #include "core/hle/kernel/resource_limit.h" | 38 | #include "core/hle/kernel/resource_limit.h" |
| 39 | #include "core/hle/kernel/service_thread.h" | 39 | #include "core/hle/kernel/service_thread.h" |
| 40 | #include "core/hle/kernel/shared_memory.h" | 40 | #include "core/hle/kernel/shared_memory.h" |
| 41 | #include "core/hle/kernel/synchronization.h" | ||
| 42 | #include "core/hle/kernel/thread.h" | 41 | #include "core/hle/kernel/thread.h" |
| 43 | #include "core/hle/kernel/time_manager.h" | 42 | #include "core/hle/kernel/time_manager.h" |
| 44 | #include "core/hle/lock.h" | 43 | #include "core/hle/lock.h" |
| @@ -51,8 +50,7 @@ namespace Kernel { | |||
| 51 | 50 | ||
| 52 | struct KernelCore::Impl { | 51 | struct KernelCore::Impl { |
| 53 | explicit Impl(Core::System& system, KernelCore& kernel) | 52 | explicit Impl(Core::System& system, KernelCore& kernel) |
| 54 | : synchronization{system}, time_manager{system}, global_handle_table{kernel}, system{ | 53 | : time_manager{system}, global_handle_table{kernel}, system{system} {} |
| 55 | system} {} | ||
| 56 | 54 | ||
| 57 | void SetMulticore(bool is_multicore) { | 55 | void SetMulticore(bool is_multicore) { |
| 58 | this->is_multicore = is_multicore; | 56 | this->is_multicore = is_multicore; |
| @@ -307,7 +305,6 @@ struct KernelCore::Impl { | |||
| 307 | std::vector<std::shared_ptr<Process>> process_list; | 305 | std::vector<std::shared_ptr<Process>> process_list; |
| 308 | Process* current_process = nullptr; | 306 | Process* current_process = nullptr; |
| 309 | std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; | 307 | std::unique_ptr<Kernel::GlobalSchedulerContext> global_scheduler_context; |
| 310 | Kernel::Synchronization synchronization; | ||
| 311 | Kernel::TimeManager time_manager; | 308 | Kernel::TimeManager time_manager; |
| 312 | 309 | ||
| 313 | std::shared_ptr<ResourceLimit> system_resource_limit; | 310 | std::shared_ptr<ResourceLimit> system_resource_limit; |
| @@ -461,14 +458,6 @@ const std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>& Kern | |||
| 461 | return impl->interrupts; | 458 | return impl->interrupts; |
| 462 | } | 459 | } |
| 463 | 460 | ||
| 464 | Kernel::Synchronization& KernelCore::Synchronization() { | ||
| 465 | return impl->synchronization; | ||
| 466 | } | ||
| 467 | |||
| 468 | const Kernel::Synchronization& KernelCore::Synchronization() const { | ||
| 469 | return impl->synchronization; | ||
| 470 | } | ||
| 471 | |||
| 472 | Kernel::TimeManager& KernelCore::TimeManager() { | 461 | Kernel::TimeManager& KernelCore::TimeManager() { |
| 473 | return impl->time_manager; | 462 | return impl->time_manager; |
| 474 | } | 463 | } |
| @@ -613,9 +602,11 @@ void KernelCore::Suspend(bool in_suspention) { | |||
| 613 | const bool should_suspend = exception_exited || in_suspention; | 602 | const bool should_suspend = exception_exited || in_suspention; |
| 614 | { | 603 | { |
| 615 | KScopedSchedulerLock lock(*this); | 604 | KScopedSchedulerLock lock(*this); |
| 616 | ThreadStatus status = should_suspend ? ThreadStatus::Ready : ThreadStatus::WaitSleep; | 605 | const auto state = should_suspend ? ThreadState::Runnable : ThreadState::Waiting; |
| 617 | for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { | 606 | for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { |
| 618 | impl->suspend_threads[i]->SetStatus(status); | 607 | impl->suspend_threads[i]->SetState(state); |
| 608 | impl->suspend_threads[i]->SetWaitReasonForDebugging( | ||
| 609 | ThreadWaitReasonForDebugging::Suspended); | ||
| 619 | } | 610 | } |
| 620 | } | 611 | } |
| 621 | } | 612 | } |