aboutsummaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.cpp
diff options
context:
space:
mode:
authorFernando S <fsahmkow27@gmail.com>2023-12-06 14:19:17 +0100
committerGitHub <noreply@github.com>2023-12-06 14:19:17 +0100
commit9046851d9ffe831d1429b2a280e37294da64d07a (patch)
tree265bf3c7970a570479c6a3ac1250549995f0329c /src/core/cpu_manager.cpp
parentb14de726cf6e11497c795e5bd143cc19158ef514 (diff)
parent33b7353d733e11dbeb3e55574691af686fc3bde8 (diff)
Merge pull request #12236 from liamwhite/cpu-refactor
core: refactor emulated cpu core activation
Diffstat (limited to 'src/core/cpu_manager.cpp')
-rw-r--r--src/core/cpu_manager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 151eb3870c..7a5c22f78c 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -73,12 +73,13 @@ void CpuManager::HandleInterrupt() {
void CpuManager::MultiCoreRunGuestThread() {
// Similar to UserModeThreadStarter in HOS
auto& kernel = system.Kernel();
+ auto* thread = Kernel::GetCurrentThreadPointer(kernel);
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
while (!physical_core->IsInterrupted()) {
- physical_core->Run();
+ physical_core->RunThread(thread);
physical_core = &kernel.CurrentPhysicalCore();
}
@@ -110,12 +111,13 @@ void CpuManager::MultiCoreRunIdleThread() {
void CpuManager::SingleCoreRunGuestThread() {
auto& kernel = system.Kernel();
+ auto* thread = Kernel::GetCurrentThreadPointer(kernel);
kernel.CurrentScheduler()->OnThreadStart();
while (true) {
auto* physical_core = &kernel.CurrentPhysicalCore();
if (!physical_core->IsInterrupted()) {
- physical_core->Run();
+ physical_core->RunThread(thread);
physical_core = &kernel.CurrentPhysicalCore();
}
@@ -211,8 +213,6 @@ void CpuManager::RunThread(std::stop_token token, std::size_t core) {
system.GPU().ObtainContext();
}
- system.ArmInterface(core).Initialize();
-
auto& kernel = system.Kernel();
auto& scheduler = *kernel.CurrentScheduler();
auto* thread = scheduler.GetSchedulerCurrentThread();