diff options
| author | 2019-02-14 12:42:58 -0500 | |
|---|---|---|
| committer | 2019-02-15 21:50:25 -0500 | |
| commit | bd983414f643b734a1f8bebe3183723733344f72 (patch) | |
| tree | bda0421458439e25cba9d772a6a79b56e473d72e /src/core/hle/kernel/kernel.cpp | |
| parent | Merge pull request #2113 from ReinUsesLisp/vulkan-base (diff) | |
| download | yuzu-bd983414f643b734a1f8bebe3183723733344f72.tar.gz yuzu-bd983414f643b734a1f8bebe3183723733344f72.tar.xz yuzu-bd983414f643b734a1f8bebe3183723733344f72.zip | |
core_timing: Convert core timing into a class
Gets rid of the largest set of mutable global state within the core.
This also paves a way for eliminating usages of GetInstance() on the
System class as a follow-up.
Note that no behavioral changes have been made, and this simply extracts
the functionality into a class. This also has the benefit of making
dependencies on the core timing functionality explicit within the
relevant interfaces.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 3721ae8fe..dd749eed4 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -86,11 +86,11 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_ | |||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | struct KernelCore::Impl { | 88 | struct KernelCore::Impl { |
| 89 | void Initialize(KernelCore& kernel) { | 89 | void Initialize(KernelCore& kernel, Core::Timing::CoreTiming& core_timing) { |
| 90 | Shutdown(); | 90 | Shutdown(); |
| 91 | 91 | ||
| 92 | InitializeSystemResourceLimit(kernel); | 92 | InitializeSystemResourceLimit(kernel); |
| 93 | InitializeThreads(); | 93 | InitializeThreads(core_timing); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | void Shutdown() { | 96 | void Shutdown() { |
| @@ -122,9 +122,9 @@ struct KernelCore::Impl { | |||
| 122 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); | 122 | ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | void InitializeThreads() { | 125 | void InitializeThreads(Core::Timing::CoreTiming& core_timing) { |
| 126 | thread_wakeup_event_type = | 126 | thread_wakeup_event_type = |
| 127 | Core::Timing::RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); | 127 | core_timing.RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | std::atomic<u32> next_object_id{0}; | 130 | std::atomic<u32> next_object_id{0}; |
| @@ -152,8 +152,8 @@ KernelCore::~KernelCore() { | |||
| 152 | Shutdown(); | 152 | Shutdown(); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | void KernelCore::Initialize() { | 155 | void KernelCore::Initialize(Core::Timing::CoreTiming& core_timing) { |
| 156 | impl->Initialize(*this); | 156 | impl->Initialize(*this, core_timing); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | void KernelCore::Shutdown() { | 159 | void KernelCore::Shutdown() { |