diff options
| author | 2020-12-04 23:47:59 -0800 | |
|---|---|---|
| committer | 2020-12-06 00:27:13 -0800 | |
| commit | 357d79fb6e6ec0d373d8768f1ee32eebe02e55da (patch) | |
| tree | 5cc9669aaf49852ab936512b143c8997635bb911 /src | |
| parent | common: BitSet: Various style fixes based on code review feedback. (diff) | |
| download | yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.gz yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.xz yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.zip | |
hle: kernel: GlobalSchedulerContext: Various style fixes based on code review feedback.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/global_scheduler_context.cpp | 7 | ||||
| -rw-r--r-- | src/core/hle/kernel/global_scheduler_context.h | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/kernel/global_scheduler_context.cpp b/src/core/hle/kernel/global_scheduler_context.cpp index a9cb48b38..a133e8ed0 100644 --- a/src/core/hle/kernel/global_scheduler_context.cpp +++ b/src/core/hle/kernel/global_scheduler_context.cpp | |||
| @@ -31,7 +31,12 @@ void GlobalSchedulerContext::RemoveThread(std::shared_ptr<Thread> thread) { | |||
| 31 | void GlobalSchedulerContext::PreemptThreads() { | 31 | void GlobalSchedulerContext::PreemptThreads() { |
| 32 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are | 32 | // The priority levels at which the global scheduler preempts threads every 10 ms. They are |
| 33 | // ordered from Core 0 to Core 3. | 33 | // ordered from Core 0 to Core 3. |
| 34 | std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 63}; | 34 | static constexpr std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities{ |
| 35 | 59, | ||
| 36 | 59, | ||
| 37 | 59, | ||
| 38 | 63, | ||
| 39 | }; | ||
| 35 | 40 | ||
| 36 | ASSERT(IsLocked()); | 41 | ASSERT(IsLocked()); |
| 37 | for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { | 42 | for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { |
diff --git a/src/core/hle/kernel/global_scheduler_context.h b/src/core/hle/kernel/global_scheduler_context.h index c4bc23eed..5c7b89290 100644 --- a/src/core/hle/kernel/global_scheduler_context.h +++ b/src/core/hle/kernel/global_scheduler_context.h | |||
| @@ -21,7 +21,7 @@ class SchedulerLock; | |||
| 21 | 21 | ||
| 22 | using KSchedulerPriorityQueue = | 22 | using KSchedulerPriorityQueue = |
| 23 | KPriorityQueue<Thread, Core::Hardware::NUM_CPU_CORES, THREADPRIO_LOWEST, THREADPRIO_HIGHEST>; | 23 | KPriorityQueue<Thread, Core::Hardware::NUM_CPU_CORES, THREADPRIO_LOWEST, THREADPRIO_HIGHEST>; |
| 24 | static constexpr s32 HighestCoreMigrationAllowedPriority = 2; | 24 | constexpr s32 HighestCoreMigrationAllowedPriority = 2; |
| 25 | 25 | ||
| 26 | class GlobalSchedulerContext final { | 26 | class GlobalSchedulerContext final { |
| 27 | friend class KScheduler; | 27 | friend class KScheduler; |
| @@ -39,7 +39,7 @@ public: | |||
| 39 | void RemoveThread(std::shared_ptr<Thread> thread); | 39 | void RemoveThread(std::shared_ptr<Thread> thread); |
| 40 | 40 | ||
| 41 | /// Returns a list of all threads managed by the scheduler | 41 | /// Returns a list of all threads managed by the scheduler |
| 42 | const std::vector<std::shared_ptr<Thread>>& GetThreadList() const { | 42 | [[nodiscard]] const std::vector<std::shared_ptr<Thread>>& GetThreadList() const { |
| 43 | return thread_list; | 43 | return thread_list; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| @@ -55,11 +55,11 @@ public: | |||
| 55 | /// Returns true if the global scheduler lock is acquired | 55 | /// Returns true if the global scheduler lock is acquired |
| 56 | bool IsLocked() const; | 56 | bool IsLocked() const; |
| 57 | 57 | ||
| 58 | LockType& SchedulerLock() { | 58 | [[nodiscard]] LockType& SchedulerLock() { |
| 59 | return scheduler_lock; | 59 | return scheduler_lock; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | const LockType& SchedulerLock() const { | 62 | [[nodiscard]] const LockType& SchedulerLock() const { |
| 63 | return scheduler_lock; | 63 | return scheduler_lock; |
| 64 | } | 64 | } |
| 65 | 65 | ||