aboutsummaryrefslogtreecommitdiff
path: root/src/core/cpu_core_manager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-19 19:09:20 -0400
committerGitHub <noreply@github.com>2019-04-19 19:09:20 -0400
commit40dc893c372c81c687eca2d0b964220a8f8aeab4 (patch)
tree1c05675d446978752a749f2cb18a797c6b737998 /src/core/cpu_core_manager.cpp
parent83b830eb2f80de8073a7304ab6270621d062d0b2 (diff)
parent612e1388df3bed64081488f2a99cce522c80c76d (diff)
Merge pull request #2374 from lioncash/pagetable
core: Reorganize boot order
Diffstat (limited to 'src/core/cpu_core_manager.cpp')
-rw-r--r--src/core/cpu_core_manager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/cpu_core_manager.cpp b/src/core/cpu_core_manager.cpp
index 93bc5619c..8fcb4eeb1 100644
--- a/src/core/cpu_core_manager.cpp
+++ b/src/core/cpu_core_manager.cpp
@@ -19,17 +19,19 @@ void RunCpuCore(const System& system, Cpu& cpu_state) {
}
} // Anonymous namespace
-CpuCoreManager::CpuCoreManager() = default;
+CpuCoreManager::CpuCoreManager(System& system) : system{system} {}
CpuCoreManager::~CpuCoreManager() = default;
-void CpuCoreManager::Initialize(System& system) {
+void CpuCoreManager::Initialize() {
barrier = std::make_unique<CpuBarrier>();
exclusive_monitor = Cpu::MakeExclusiveMonitor(cores.size());
for (std::size_t index = 0; index < cores.size(); ++index) {
cores[index] = std::make_unique<Cpu>(system, *exclusive_monitor, *barrier, index);
}
+}
+void CpuCoreManager::StartThreads() {
// Create threads for CPU cores 1-3, and build thread_to_cpu map
// CPU core 0 is run on the main thread
thread_to_cpu[std::this_thread::get_id()] = cores[0].get();