summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-03-02 05:46:10 +0100
committerbunnei <bunneidev@gmail.com>2020-03-03 03:51:57 +0100
commitc083ea7d7846ee40cfc889ed1d415f73ec78364c (patch)
treec58a597921953ad17f5b233c7e23996f78c2521b /src/core/hle/kernel/scheduler.cpp
parentcore: loader: Remove check for 32-bit. (diff)
downloadyuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.gz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.bz2
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.lz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.xz
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.tar.zst
yuzu-c083ea7d7846ee40cfc889ed1d415f73ec78364c.zip
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index c65f82fb7..1140c72a3 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -383,8 +383,8 @@ void GlobalScheduler::Unlock() {
// TODO(Blinkhawk): Setup the interrupts and change context on current core.
}
-Scheduler::Scheduler(Core::System& system, Core::ARM_Interface& cpu_core, std::size_t core_id)
- : system(system), cpu_core(cpu_core), core_id(core_id) {}
+Scheduler::Scheduler(Core::System& system, std::size_t core_id)
+ : system{system}, core_id{core_id} {}
Scheduler::~Scheduler() = default;
@@ -422,9 +422,10 @@ void Scheduler::UnloadThread() {
// Save context for previous thread
if (previous_thread) {
- cpu_core.SaveContext(previous_thread->GetContext());
+ system.ArmInterface(core_id).SaveContext(previous_thread->GetContext32());
+ system.ArmInterface(core_id).SaveContext(previous_thread->GetContext64());
// Save the TPIDR_EL0 system register in case it was modified.
- previous_thread->SetTPIDR_EL0(cpu_core.GetTPIDR_EL0());
+ previous_thread->SetTPIDR_EL0(system.ArmInterface(core_id).GetTPIDR_EL0());
if (previous_thread->GetStatus() == ThreadStatus::Running) {
// This is only the case when a reschedule is triggered without the current thread
@@ -451,9 +452,10 @@ void Scheduler::SwitchContext() {
// Save context for previous thread
if (previous_thread) {
- cpu_core.SaveContext(previous_thread->GetContext());
+ system.ArmInterface(core_id).SaveContext(previous_thread->GetContext32());
+ system.ArmInterface(core_id).SaveContext(previous_thread->GetContext64());
// Save the TPIDR_EL0 system register in case it was modified.
- previous_thread->SetTPIDR_EL0(cpu_core.GetTPIDR_EL0());
+ previous_thread->SetTPIDR_EL0(system.ArmInterface(core_id).GetTPIDR_EL0());
if (previous_thread->GetStatus() == ThreadStatus::Running) {
// This is only the case when a reschedule is triggered without the current thread
@@ -481,9 +483,10 @@ void Scheduler::SwitchContext() {
system.Kernel().MakeCurrentProcess(thread_owner_process);
}
- cpu_core.LoadContext(new_thread->GetContext());
- cpu_core.SetTlsAddress(new_thread->GetTLSAddress());
- cpu_core.SetTPIDR_EL0(new_thread->GetTPIDR_EL0());
+ system.ArmInterface(core_id).LoadContext(new_thread->GetContext32());
+ system.ArmInterface(core_id).LoadContext(new_thread->GetContext64());
+ system.ArmInterface(core_id).SetTlsAddress(new_thread->GetTLSAddress());
+ system.ArmInterface(core_id).SetTPIDR_EL0(new_thread->GetTPIDR_EL0());
} else {
current_thread = nullptr;
// Note: We do not reset the current process and current page table when idling because