summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-11-26 18:34:30 -0500
committerGravatar Lioncash2019-11-26 21:55:39 -0500
commite7e939104bb167babec7b5f7d5d8390c85f3cbf4 (patch)
tree47b61e77bf8e0e6798b58716d38679a285e3604b /src/core/hle/kernel/kernel.cpp
parentcore/memory: Migrate over GetPointerFromVMA() to the Memory class (diff)
downloadyuzu-e7e939104bb167babec7b5f7d5d8390c85f3cbf4.tar.gz
yuzu-e7e939104bb167babec7b5f7d5d8390c85f3cbf4.tar.xz
yuzu-e7e939104bb167babec7b5f7d5d8390c85f3cbf4.zip
core/memory; Migrate over SetCurrentPageTable() to the Memory class
Now that literally every other API function is converted over to the Memory class, we can just move the file-local page table into the Memory implementation class, finally getting rid of global state within the memory code.
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp18
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
210void KernelCore::MakeCurrentProcess(Process* process) { 220void 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
220Process* KernelCore::CurrentProcess() { 224Process* KernelCore::CurrentProcess() {