summaryrefslogtreecommitdiff
path: root/src/core/core_cpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core_cpu.h')
-rw-r--r--src/core/core_cpu.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h
index 40ed34b47..685532965 100644
--- a/src/core/core_cpu.h
+++ b/src/core/core_cpu.h
@@ -6,11 +6,10 @@
6 6
7#include <atomic> 7#include <atomic>
8#include <condition_variable> 8#include <condition_variable>
9#include <cstddef>
9#include <memory> 10#include <memory>
10#include <mutex> 11#include <mutex>
11#include <string>
12#include "common/common_types.h" 12#include "common/common_types.h"
13#include "core/arm/exclusive_monitor.h"
14 13
15namespace Kernel { 14namespace Kernel {
16class Scheduler; 15class Scheduler;
@@ -19,6 +18,7 @@ class Scheduler;
19namespace Core { 18namespace Core {
20 19
21class ARM_Interface; 20class ARM_Interface;
21class ExclusiveMonitor;
22 22
23constexpr unsigned NUM_CPU_CORES{4}; 23constexpr unsigned NUM_CPU_CORES{4};
24 24
@@ -42,7 +42,8 @@ private:
42class Cpu { 42class Cpu {
43public: 43public:
44 Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, 44 Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor,
45 std::shared_ptr<CpuBarrier> cpu_barrier, size_t core_index); 45 std::shared_ptr<CpuBarrier> cpu_barrier, std::size_t core_index);
46 ~Cpu();
46 47
47 void RunLoop(bool tight_loop = true); 48 void RunLoop(bool tight_loop = true);
48 49
@@ -66,11 +67,11 @@ public:
66 return core_index == 0; 67 return core_index == 0;
67 } 68 }
68 69
69 size_t CoreIndex() const { 70 std::size_t CoreIndex() const {
70 return core_index; 71 return core_index;
71 } 72 }
72 73
73 static std::shared_ptr<ExclusiveMonitor> MakeExclusiveMonitor(size_t num_cores); 74 static std::shared_ptr<ExclusiveMonitor> MakeExclusiveMonitor(std::size_t num_cores);
74 75
75private: 76private:
76 void Reschedule(); 77 void Reschedule();
@@ -80,7 +81,7 @@ private:
80 std::shared_ptr<Kernel::Scheduler> scheduler; 81 std::shared_ptr<Kernel::Scheduler> scheduler;
81 82
82 std::atomic<bool> reschedule_pending = false; 83 std::atomic<bool> reschedule_pending = false;
83 size_t core_index; 84 std::size_t core_index;
84}; 85};
85 86
86} // namespace Core 87} // namespace Core