diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index a9851113a..1c90546a4 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -154,6 +154,16 @@ struct KernelCore::Impl { | |||
| 154 | system.CoreTiming().ScheduleEvent(time_interval, preemption_event); | 154 | system.CoreTiming().ScheduleEvent(time_interval, preemption_event); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | void MakeCurrentProcess(Process* process) { | ||
| 158 | current_process = process; | ||
| 159 | |||
| 160 | if (process == nullptr) { | ||
| 161 | return; | ||
| 162 | } | ||
| 163 | |||
| 164 | system.Memory().SetCurrentPageTable(*process); | ||
| 165 | } | ||
| 166 | |||
| 157 | std::atomic<u32> next_object_id{0}; | 167 | std::atomic<u32> next_object_id{0}; |
| 158 | std::atomic<u64> next_kernel_process_id{Process::InitialKIPIDMin}; | 168 | std::atomic<u64> next_kernel_process_id{Process::InitialKIPIDMin}; |
| 159 | std::atomic<u64> next_user_process_id{Process::ProcessIDMin}; | 169 | std::atomic<u64> next_user_process_id{Process::ProcessIDMin}; |
| @@ -208,13 +218,7 @@ void KernelCore::AppendNewProcess(std::shared_ptr<Process> process) { | |||
| 208 | } | 218 | } |
| 209 | 219 | ||
| 210 | void KernelCore::MakeCurrentProcess(Process* process) { | 220 | void KernelCore::MakeCurrentProcess(Process* process) { |
| 211 | impl->current_process = process; | 221 | impl->MakeCurrentProcess(process); |
| 212 | |||
| 213 | if (process == nullptr) { | ||
| 214 | return; | ||
| 215 | } | ||
| 216 | |||
| 217 | Memory::SetCurrentPageTable(*process); | ||
| 218 | } | 222 | } |
| 219 | 223 | ||
| 220 | Process* KernelCore::CurrentProcess() { | 224 | Process* KernelCore::CurrentProcess() { |