diff options
Diffstat (limited to 'src/core/core_cpu.h')
| -rw-r--r-- | src/core/core_cpu.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h index ee7e04abc..1d2bdc6cd 100644 --- a/src/core/core_cpu.h +++ b/src/core/core_cpu.h | |||
| @@ -41,8 +41,7 @@ private: | |||
| 41 | 41 | ||
| 42 | class Cpu { | 42 | class Cpu { |
| 43 | public: | 43 | public: |
| 44 | Cpu(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, | 44 | Cpu(ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier, std::size_t core_index); |
| 45 | std::shared_ptr<CpuBarrier> cpu_barrier, std::size_t core_index); | ||
| 46 | ~Cpu(); | 45 | ~Cpu(); |
| 47 | 46 | ||
| 48 | void RunLoop(bool tight_loop = true); | 47 | void RunLoop(bool tight_loop = true); |
| @@ -59,8 +58,12 @@ public: | |||
| 59 | return *arm_interface; | 58 | return *arm_interface; |
| 60 | } | 59 | } |
| 61 | 60 | ||
| 62 | const std::shared_ptr<Kernel::Scheduler>& Scheduler() const { | 61 | Kernel::Scheduler& Scheduler() { |
| 63 | return scheduler; | 62 | return *scheduler; |
| 63 | } | ||
| 64 | |||
| 65 | const Kernel::Scheduler& Scheduler() const { | ||
| 66 | return *scheduler; | ||
| 64 | } | 67 | } |
| 65 | 68 | ||
| 66 | bool IsMainCore() const { | 69 | bool IsMainCore() const { |
| @@ -71,14 +74,14 @@ public: | |||
| 71 | return core_index; | 74 | return core_index; |
| 72 | } | 75 | } |
| 73 | 76 | ||
| 74 | static std::shared_ptr<ExclusiveMonitor> MakeExclusiveMonitor(std::size_t num_cores); | 77 | static std::unique_ptr<ExclusiveMonitor> MakeExclusiveMonitor(std::size_t num_cores); |
| 75 | 78 | ||
| 76 | private: | 79 | private: |
| 77 | void Reschedule(); | 80 | void Reschedule(); |
| 78 | 81 | ||
| 79 | std::unique_ptr<ARM_Interface> arm_interface; | 82 | std::unique_ptr<ARM_Interface> arm_interface; |
| 80 | std::shared_ptr<CpuBarrier> cpu_barrier; | 83 | CpuBarrier& cpu_barrier; |
| 81 | std::shared_ptr<Kernel::Scheduler> scheduler; | 84 | std::unique_ptr<Kernel::Scheduler> scheduler; |
| 82 | 85 | ||
| 83 | std::atomic<bool> reschedule_pending = false; | 86 | std::atomic<bool> reschedule_pending = false; |
| 84 | std::size_t core_index; | 87 | std::size_t core_index; |