aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_cpu.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-04 16:02:59 -0500
committerLioncash <mathew1800@gmail.com>2019-03-04 17:01:37 -0500
commitfad20213e6f377d75ced3c2554b4f00a46ff9263 (patch)
tree8911a6765d4549836fec1e5b06c64b5e94f4860d /src/core/core_cpu.h
parent07e13d6728868e5cb91615bec3aa6dfe9ec62b7b (diff)
kernel/scheduler: Pass in system instance in constructor
Avoids directly relying on the global system instance and instead makes an arbitrary system instance an explicit dependency on construction. This also allows removing dependencies on some global accessor functions as well.
Diffstat (limited to 'src/core/core_cpu.h')
-rw-r--r--src/core/core_cpu.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h
index e2204c6b0..7589beb8c 100644
--- a/src/core/core_cpu.h
+++ b/src/core/core_cpu.h
@@ -15,6 +15,10 @@ namespace Kernel {
class Scheduler;
}
+namespace Core {
+class System;
+}
+
namespace Core::Timing {
class CoreTiming;
}
@@ -45,8 +49,8 @@ private:
class Cpu {
public:
- Cpu(Timing::CoreTiming& core_timing, ExclusiveMonitor& exclusive_monitor,
- CpuBarrier& cpu_barrier, std::size_t core_index);
+ Cpu(System& system, ExclusiveMonitor& exclusive_monitor, CpuBarrier& cpu_barrier,
+ std::size_t core_index);
~Cpu();
void RunLoop(bool tight_loop = true);