summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-13 11:11:12 -0800
committerGravatar bunnei2020-11-29 01:31:51 -0800
commit7b642c77811dc3887756f5abac5a9710564b098e (patch)
tree09c9d764734db56896f77d986afa6ccd5d2c745d /src/core/hle/kernel/scheduler.cpp
parentMerge pull request #4998 from Morph1984/bioshock-patch (diff)
downloadyuzu-7b642c77811dc3887756f5abac5a9710564b098e.tar.gz
yuzu-7b642c77811dc3887756f5abac5a9710564b098e.tar.xz
yuzu-7b642c77811dc3887756f5abac5a9710564b098e.zip
hle: kernel: multicore: Replace n-JITs impl. with 4 JITs.
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 6b7db5372..0805e9914 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -621,11 +621,14 @@ void Scheduler::OnThreadStart() {
621void Scheduler::Unload() { 621void Scheduler::Unload() {
622 Thread* thread = current_thread.get(); 622 Thread* thread = current_thread.get();
623 if (thread) { 623 if (thread) {
624 thread->SetContinuousOnSVC(false);
625 thread->last_running_ticks = system.CoreTiming().GetCPUTicks(); 624 thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
626 thread->SetIsRunning(false); 625 thread->SetIsRunning(false);
626 if (thread->IsContinuousOnSVC() && !thread->IsHLEThread()) {
627 system.ArmInterface(core_id).ExceptionalExit();
628 thread->SetContinuousOnSVC(false);
629 }
627 if (!thread->IsHLEThread() && !thread->HasExited()) { 630 if (!thread->IsHLEThread() && !thread->HasExited()) {
628 Core::ARM_Interface& cpu_core = thread->ArmInterface(); 631 Core::ARM_Interface& cpu_core = system.ArmInterface(core_id);
629 cpu_core.SaveContext(thread->GetContext32()); 632 cpu_core.SaveContext(thread->GetContext32());
630 cpu_core.SaveContext(thread->GetContext64()); 633 cpu_core.SaveContext(thread->GetContext64());
631 // Save the TPIDR_EL0 system register in case it was modified. 634 // Save the TPIDR_EL0 system register in case it was modified.
@@ -652,12 +655,11 @@ void Scheduler::Reload() {
652 system.Kernel().MakeCurrentProcess(thread_owner_process); 655 system.Kernel().MakeCurrentProcess(thread_owner_process);
653 } 656 }
654 if (!thread->IsHLEThread()) { 657 if (!thread->IsHLEThread()) {
655 Core::ARM_Interface& cpu_core = thread->ArmInterface(); 658 Core::ARM_Interface& cpu_core = system.ArmInterface(core_id);
656 cpu_core.LoadContext(thread->GetContext32()); 659 cpu_core.LoadContext(thread->GetContext32());
657 cpu_core.LoadContext(thread->GetContext64()); 660 cpu_core.LoadContext(thread->GetContext64());
658 cpu_core.SetTlsAddress(thread->GetTLSAddress()); 661 cpu_core.SetTlsAddress(thread->GetTLSAddress());
659 cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0()); 662 cpu_core.SetTPIDR_EL0(thread->GetTPIDR_EL0());
660 cpu_core.ChangeProcessorID(this->core_id);
661 cpu_core.ClearExclusiveState(); 663 cpu_core.ClearExclusiveState();
662 } 664 }
663 } 665 }
@@ -679,12 +681,11 @@ void Scheduler::SwitchContextStep2() {
679 system.Kernel().MakeCurrentProcess(thread_owner_process); 681 system.Kernel().MakeCurrentProcess(thread_owner_process);
680 } 682 }
681 if (!selected_thread->IsHLEThread()) { 683 if (!selected_thread->IsHLEThread()) {
682 Core::ARM_Interface& cpu_core = selected_thread->ArmInterface(); 684 Core::ARM_Interface& cpu_core = system.ArmInterface(core_id);
683 cpu_core.LoadContext(selected_thread->GetContext32()); 685 cpu_core.LoadContext(selected_thread->GetContext32());
684 cpu_core.LoadContext(selected_thread->GetContext64()); 686 cpu_core.LoadContext(selected_thread->GetContext64());
685 cpu_core.SetTlsAddress(selected_thread->GetTLSAddress()); 687 cpu_core.SetTlsAddress(selected_thread->GetTLSAddress());
686 cpu_core.SetTPIDR_EL0(selected_thread->GetTPIDR_EL0()); 688 cpu_core.SetTPIDR_EL0(selected_thread->GetTPIDR_EL0());
687 cpu_core.ChangeProcessorID(this->core_id);
688 cpu_core.ClearExclusiveState(); 689 cpu_core.ClearExclusiveState();
689 } 690 }
690 } 691 }
@@ -715,11 +716,14 @@ void Scheduler::SwitchContext() {
715 if (new_thread != nullptr && new_thread->IsSuspendThread()) { 716 if (new_thread != nullptr && new_thread->IsSuspendThread()) {
716 previous_thread->SetWasRunning(true); 717 previous_thread->SetWasRunning(true);
717 } 718 }
718 previous_thread->SetContinuousOnSVC(false);
719 previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks(); 719 previous_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
720 previous_thread->SetIsRunning(false); 720 previous_thread->SetIsRunning(false);
721 if (previous_thread->IsContinuousOnSVC() && !previous_thread->IsHLEThread()) {
722 system.ArmInterface(core_id).ExceptionalExit();
723 previous_thread->SetContinuousOnSVC(false);
724 }
721 if (!previous_thread->IsHLEThread() && !previous_thread->HasExited()) { 725 if (!previous_thread->IsHLEThread() && !previous_thread->HasExited()) {
722 Core::ARM_Interface& cpu_core = previous_thread->ArmInterface(); 726 Core::ARM_Interface& cpu_core = system.ArmInterface(core_id);
723 cpu_core.SaveContext(previous_thread->GetContext32()); 727 cpu_core.SaveContext(previous_thread->GetContext32());
724 cpu_core.SaveContext(previous_thread->GetContext64()); 728 cpu_core.SaveContext(previous_thread->GetContext64());
725 // Save the TPIDR_EL0 system register in case it was modified. 729 // Save the TPIDR_EL0 system register in case it was modified.