diff options
| author | 2018-03-14 19:33:27 -0400 | |
|---|---|---|
| committer | 2018-03-14 19:33:27 -0400 | |
| commit | cde9386e0fd9677e1a89a8dc81ea9cd65fa22c50 (patch) | |
| tree | 6330442e1dacc0d850ce09c35dcee7ddd3a2bc9d /src/core/hle/kernel/scheduler.cpp | |
| parent | Merge pull request #213 from Hexagon12/dynarmic-default (diff) | |
| parent | core: Move process creation out of global state. (diff) | |
| download | yuzu-cde9386e0fd9677e1a89a8dc81ea9cd65fa22c50.tar.gz yuzu-cde9386e0fd9677e1a89a8dc81ea9cd65fa22c50.tar.xz yuzu-cde9386e0fd9677e1a89a8dc81ea9cd65fa22c50.zip | |
Merge pull request #236 from bunnei/refactor-process-creation
core: Move process creation out of global state.
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 235068b22..921f27efb 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "core/core.h" | ||
| 5 | #include "core/core_timing.h" | 6 | #include "core/core_timing.h" |
| 6 | #include "core/hle/kernel/process.h" | 7 | #include "core/hle/kernel/process.h" |
| 7 | #include "core/hle/kernel/scheduler.h" | 8 | #include "core/hle/kernel/scheduler.h" |
| @@ -67,7 +68,7 @@ void Scheduler::SwitchContext(Thread* new_thread) { | |||
| 67 | // Cancel any outstanding wakeup events for this thread | 68 | // Cancel any outstanding wakeup events for this thread |
| 68 | new_thread->CancelWakeupTimer(); | 69 | new_thread->CancelWakeupTimer(); |
| 69 | 70 | ||
| 70 | auto previous_process = Kernel::g_current_process; | 71 | auto previous_process = Core::CurrentProcess(); |
| 71 | 72 | ||
| 72 | current_thread = new_thread; | 73 | current_thread = new_thread; |
| 73 | 74 | ||
| @@ -75,8 +76,8 @@ void Scheduler::SwitchContext(Thread* new_thread) { | |||
| 75 | new_thread->status = THREADSTATUS_RUNNING; | 76 | new_thread->status = THREADSTATUS_RUNNING; |
| 76 | 77 | ||
| 77 | if (previous_process != current_thread->owner_process) { | 78 | if (previous_process != current_thread->owner_process) { |
| 78 | Kernel::g_current_process = current_thread->owner_process; | 79 | Core::CurrentProcess() = current_thread->owner_process; |
| 79 | SetCurrentPageTable(&Kernel::g_current_process->vm_manager.page_table); | 80 | SetCurrentPageTable(&Core::CurrentProcess()->vm_manager.page_table); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 82 | cpu_core->LoadContext(new_thread->context); | 83 | cpu_core->LoadContext(new_thread->context); |