summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index bb3e312a7..4cf9cee42 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -68,6 +68,12 @@ struct KernelCore::Impl {
68 InitializeSuspendThreads(); 68 InitializeSuspendThreads();
69 } 69 }
70 70
71 void InitializeCores() {
72 for (auto& core : cores) {
73 core.Initialize(current_process->Is64BitProcess());
74 }
75 }
76
71 void Shutdown() { 77 void Shutdown() {
72 next_object_id = 0; 78 next_object_id = 0;
73 next_kernel_process_id = Process::InitialKIPIDMin; 79 next_kernel_process_id = Process::InitialKIPIDMin;
@@ -116,7 +122,7 @@ struct KernelCore::Impl {
116 Core::MakeExclusiveMonitor(system.Memory(), Core::Hardware::NUM_CPU_CORES); 122 Core::MakeExclusiveMonitor(system.Memory(), Core::Hardware::NUM_CPU_CORES);
117 for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) { 123 for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
118 schedulers[i] = std::make_unique<Kernel::Scheduler>(system, i); 124 schedulers[i] = std::make_unique<Kernel::Scheduler>(system, i);
119 cores.emplace_back(system, i, *schedulers[i], interrupts[i]); 125 cores.emplace_back(i, system, *schedulers[i], interrupts);
120 } 126 }
121 } 127 }
122 128
@@ -181,6 +187,7 @@ struct KernelCore::Impl {
181 if (process == nullptr) { 187 if (process == nullptr) {
182 return; 188 return;
183 } 189 }
190
184 const u32 core_id = GetCurrentHostThreadID(); 191 const u32 core_id = GetCurrentHostThreadID();
185 if (core_id < Core::Hardware::NUM_CPU_CORES) { 192 if (core_id < Core::Hardware::NUM_CPU_CORES) {
186 system.Memory().SetCurrentPageTable(*process, core_id); 193 system.Memory().SetCurrentPageTable(*process, core_id);
@@ -372,6 +379,10 @@ void KernelCore::Initialize() {
372 impl->Initialize(*this); 379 impl->Initialize(*this);
373} 380}
374 381
382void KernelCore::InitializeCores() {
383 impl->InitializeCores();
384}
385
375void KernelCore::Shutdown() { 386void KernelCore::Shutdown() {
376 impl->Shutdown(); 387 impl->Shutdown();
377} 388}
@@ -486,12 +497,12 @@ const Core::ExclusiveMonitor& KernelCore::GetExclusiveMonitor() const {
486} 497}
487 498
488void KernelCore::InvalidateAllInstructionCaches() { 499void KernelCore::InvalidateAllInstructionCaches() {
489 auto& threads = GlobalScheduler().GetThreadList(); 500 if (!IsMulticore()) {
490 for (auto& thread : threads) { 501 for (auto& physical_core : impl->cores) {
491 if (!thread->IsHLEThread()) { 502 physical_core.ArmInterface().ClearInstructionCache();
492 auto& arm_interface = thread->ArmInterface();
493 arm_interface.ClearInstructionCache();
494 } 503 }
504 } else {
505 ASSERT_MSG(false, "UNIMPLEMENTED!!!!!!!!!!!");
495 } 506 }
496} 507}
497 508