summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.h
diff options
context:
space:
mode:
authorGravatar bunnei2020-02-14 14:40:20 -0500
committerGravatar GitHub2020-02-14 14:40:20 -0500
commitf552d553bac1374c583d748dad27f8c86e86c4a0 (patch)
tree1da4aa037ff417fa4fd43bffac267dcb2b55a72d /src/core/hle/kernel/scheduler.h
parentMerge pull request #3379 from ReinUsesLisp/cbuf-offset (diff)
parentCore: Correct compilition in GCC (diff)
downloadyuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.gz
yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.tar.xz
yuzu-f552d553bac1374c583d748dad27f8c86e86c4a0.zip
Merge pull request #3401 from FernandoS27/synchronization
Set of refactors for Kernel Synchronization and Hardware Constants
Diffstat (limited to 'src/core/hle/kernel/scheduler.h')
-rw-r--r--src/core/hle/kernel/scheduler.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index 14b77960a..96db049cb 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -10,6 +10,7 @@
10 10
11#include "common/common_types.h" 11#include "common/common_types.h"
12#include "common/multi_level_queue.h" 12#include "common/multi_level_queue.h"
13#include "core/hardware_properties.h"
13#include "core/hle/kernel/thread.h" 14#include "core/hle/kernel/thread.h"
14 15
15namespace Core { 16namespace Core {
@@ -23,8 +24,6 @@ class Process;
23 24
24class GlobalScheduler final { 25class GlobalScheduler final {
25public: 26public:
26 static constexpr u32 NUM_CPU_CORES = 4;
27
28 explicit GlobalScheduler(Core::System& system); 27 explicit GlobalScheduler(Core::System& system);
29 ~GlobalScheduler(); 28 ~GlobalScheduler();
30 29
@@ -125,7 +124,7 @@ public:
125 void PreemptThreads(); 124 void PreemptThreads();
126 125
127 u32 CpuCoresCount() const { 126 u32 CpuCoresCount() const {
128 return NUM_CPU_CORES; 127 return Core::Hardware::NUM_CPU_CORES;
129 } 128 }
130 129
131 void SetReselectionPending() { 130 void SetReselectionPending() {
@@ -149,13 +148,15 @@ private:
149 bool AskForReselectionOrMarkRedundant(Thread* current_thread, const Thread* winner); 148 bool AskForReselectionOrMarkRedundant(Thread* current_thread, const Thread* winner);
150 149
151 static constexpr u32 min_regular_priority = 2; 150 static constexpr u32 min_regular_priority = 2;
152 std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> scheduled_queue; 151 std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, Core::Hardware::NUM_CPU_CORES>
153 std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, NUM_CPU_CORES> suggested_queue; 152 scheduled_queue;
153 std::array<Common::MultiLevelQueue<Thread*, THREADPRIO_COUNT>, Core::Hardware::NUM_CPU_CORES>
154 suggested_queue;
154 std::atomic<bool> is_reselection_pending{false}; 155 std::atomic<bool> is_reselection_pending{false};
155 156
156 // The priority levels at which the global scheduler preempts threads every 10 ms. They are 157 // The priority levels at which the global scheduler preempts threads every 10 ms. They are
157 // ordered from Core 0 to Core 3. 158 // ordered from Core 0 to Core 3.
158 std::array<u32, NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62}; 159 std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 62};
159 160
160 /// Lists all thread ids that aren't deleted/etc. 161 /// Lists all thread ids that aren't deleted/etc.
161 std::vector<std::shared_ptr<Thread>> thread_list; 162 std::vector<std::shared_ptr<Thread>> thread_list;