summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Fernando S2023-12-06 14:19:17 +0100
committerGravatar GitHub2023-12-06 14:19:17 +0100
commit8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a (patch)
tree265bf3c7970a570479c6a3ac1250549995f0329c /src/core/hle/kernel/kernel.cpp
parentMerge pull request #12271 from liamwhite/pretext-fix (diff)
parentarm: fix context save of vector regs (diff)
downloadyuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.gz
yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.tar.xz
yuzu-8a79dd2d6c6445bff63ea1f2f5f1611a6afcd97a.zip
Merge pull request #12236 from liamwhite/cpu-refactor
core: refactor emulated cpu core activation
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 4a1559291..032c4e093 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -99,13 +99,6 @@ struct KernelCore::Impl {
99 RegisterHostThread(nullptr); 99 RegisterHostThread(nullptr);
100 } 100 }
101 101
102 void InitializeCores() {
103 for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
104 cores[core_id]->Initialize((*application_process).Is64Bit());
105 system.ApplicationMemory().SetCurrentPageTable(*application_process, core_id);
106 }
107 }
108
109 void TerminateApplicationProcess() { 102 void TerminateApplicationProcess() {
110 application_process.load()->Terminate(); 103 application_process.load()->Terminate();
111 } 104 }
@@ -205,7 +198,7 @@ struct KernelCore::Impl {
205 const s32 core{static_cast<s32>(i)}; 198 const s32 core{static_cast<s32>(i)};
206 199
207 schedulers[i] = std::make_unique<Kernel::KScheduler>(system.Kernel()); 200 schedulers[i] = std::make_unique<Kernel::KScheduler>(system.Kernel());
208 cores[i] = std::make_unique<Kernel::PhysicalCore>(i, system, *schedulers[i]); 201 cores[i] = std::make_unique<Kernel::PhysicalCore>(system.Kernel(), i);
209 202
210 auto* main_thread{Kernel::KThread::Create(system.Kernel())}; 203 auto* main_thread{Kernel::KThread::Create(system.Kernel())};
211 main_thread->SetCurrentCore(core); 204 main_thread->SetCurrentCore(core);
@@ -880,10 +873,6 @@ void KernelCore::Initialize() {
880 impl->Initialize(*this); 873 impl->Initialize(*this);
881} 874}
882 875
883void KernelCore::InitializeCores() {
884 impl->InitializeCores();
885}
886
887void KernelCore::Shutdown() { 876void KernelCore::Shutdown() {
888 impl->Shutdown(); 877 impl->Shutdown();
889} 878}
@@ -993,21 +982,6 @@ const KAutoObjectWithListContainer& KernelCore::ObjectListContainer() const {
993 return *impl->global_object_list_container; 982 return *impl->global_object_list_container;
994} 983}
995 984
996void KernelCore::InvalidateAllInstructionCaches() {
997 for (auto& physical_core : impl->cores) {
998 physical_core->ArmInterface().ClearInstructionCache();
999 }
1000}
1001
1002void KernelCore::InvalidateCpuInstructionCacheRange(KProcessAddress addr, std::size_t size) {
1003 for (auto& physical_core : impl->cores) {
1004 if (!physical_core->IsInitialized()) {
1005 continue;
1006 }
1007 physical_core->ArmInterface().InvalidateCacheRange(GetInteger(addr), size);
1008 }
1009}
1010
1011void KernelCore::PrepareReschedule(std::size_t id) { 985void KernelCore::PrepareReschedule(std::size_t id) {
1012 // TODO: Reimplement, this 986 // TODO: Reimplement, this
1013} 987}