diff options
| author | 2020-02-14 10:56:27 -0400 | |
|---|---|---|
| committer | 2020-02-22 11:18:07 -0400 | |
| commit | 5c90d22f3d92b9be818b19e03dd57eb217eb6567 (patch) | |
| tree | 206a925ef68687d7b90e2b11d9d68bc42f2ce9d3 /src/core/hle/kernel/kernel.cpp | |
| parent | Kernel: Rename ThreadCallbackHandleTable and Setup Thread Ids on Kernel. (diff) | |
| download | yuzu-5c90d22f3d92b9be818b19e03dd57eb217eb6567.tar.gz yuzu-5c90d22f3d92b9be818b19e03dd57eb217eb6567.tar.xz yuzu-5c90d22f3d92b9be818b19e03dd57eb217eb6567.zip | |
Kernel: Implement Time Manager.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b3a5d7505..de14e1936 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include "core/hle/kernel/scheduler.h" | 27 | #include "core/hle/kernel/scheduler.h" |
| 28 | #include "core/hle/kernel/synchronization.h" | 28 | #include "core/hle/kernel/synchronization.h" |
| 29 | #include "core/hle/kernel/thread.h" | 29 | #include "core/hle/kernel/thread.h" |
| 30 | #include "core/hle/kernel/time_manager.h" | ||
| 30 | #include "core/hle/lock.h" | 31 | #include "core/hle/lock.h" |
| 31 | #include "core/hle/result.h" | 32 | #include "core/hle/result.h" |
| 32 | #include "core/memory.h" | 33 | #include "core/memory.h" |
| @@ -100,7 +101,7 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] s64 cycles_ | |||
| 100 | 101 | ||
| 101 | struct KernelCore::Impl { | 102 | struct KernelCore::Impl { |
| 102 | explicit Impl(Core::System& system, KernelCore& kernel) | 103 | explicit Impl(Core::System& system, KernelCore& kernel) |
| 103 | : system{system}, global_scheduler{kernel}, synchronization{system} {} | 104 | : system{system}, global_scheduler{kernel}, synchronization{system}, time_manager{system} {} |
| 104 | 105 | ||
| 105 | void Initialize(KernelCore& kernel) { | 106 | void Initialize(KernelCore& kernel) { |
| 106 | Shutdown(); | 107 | Shutdown(); |
| @@ -238,6 +239,7 @@ struct KernelCore::Impl { | |||
| 238 | Process* current_process = nullptr; | 239 | Process* current_process = nullptr; |
| 239 | Kernel::GlobalScheduler global_scheduler; | 240 | Kernel::GlobalScheduler global_scheduler; |
| 240 | Kernel::Synchronization synchronization; | 241 | Kernel::Synchronization synchronization; |
| 242 | Kernel::TimeManager time_manager; | ||
| 241 | 243 | ||
| 242 | std::shared_ptr<ResourceLimit> system_resource_limit; | 244 | std::shared_ptr<ResourceLimit> system_resource_limit; |
| 243 | 245 | ||
| @@ -337,6 +339,14 @@ const Kernel::Synchronization& KernelCore::Synchronization() const { | |||
| 337 | return impl->synchronization; | 339 | return impl->synchronization; |
| 338 | } | 340 | } |
| 339 | 341 | ||
| 342 | Kernel::TimeManager& KernelCore::TimeManager() { | ||
| 343 | return impl->time_manager; | ||
| 344 | } | ||
| 345 | |||
| 346 | const Kernel::TimeManager& KernelCore::TimeManager() const { | ||
| 347 | return impl->time_manager; | ||
| 348 | } | ||
| 349 | |||
| 340 | Core::ExclusiveMonitor& KernelCore::GetExclusiveMonitor() { | 350 | Core::ExclusiveMonitor& KernelCore::GetExclusiveMonitor() { |
| 341 | return *impl->exclusive_monitor; | 351 | return *impl->exclusive_monitor; |
| 342 | } | 352 | } |