summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2019-03-14 20:42:46 -0400
committerGravatar GitHub2019-03-14 20:42:46 -0400
commit2d9546848e4a477fe865b87b4917e450405ce41f (patch)
tree27566266229bc4ef85b6d43562109eb56191d097
parentMerge pull request #2216 from ReinUsesLisp/rasterizer-system (diff)
parentkernel/process: Remove use of global system accessors (diff)
downloadyuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.gz
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.xz
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.zip
Merge pull request #2230 from lioncash/global
kernel/process: Remove use of global system accessors
-rw-r--r--src/core/hle/kernel/process.cpp11
-rw-r--r--src/core/hle/kernel/process.h6
2 files changed, 9 insertions, 8 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 7e8ba978c..49fced7b1 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -133,7 +133,7 @@ void Process::PrepareForTermination() {
133 if (thread->GetOwnerProcess() != this) 133 if (thread->GetOwnerProcess() != this)
134 continue; 134 continue;
135 135
136 if (thread == GetCurrentThread()) 136 if (thread == system.CurrentScheduler().GetCurrentThread())
137 continue; 137 continue;
138 138
139 // TODO(Subv): When are the other running/ready threads terminated? 139 // TODO(Subv): When are the other running/ready threads terminated?
@@ -145,7 +145,6 @@ void Process::PrepareForTermination() {
145 } 145 }
146 }; 146 };
147 147
148 const auto& system = Core::System::GetInstance();
149 stop_threads(system.Scheduler(0).GetThreadList()); 148 stop_threads(system.Scheduler(0).GetThreadList());
150 stop_threads(system.Scheduler(1).GetThreadList()); 149 stop_threads(system.Scheduler(1).GetThreadList());
151 stop_threads(system.Scheduler(2).GetThreadList()); 150 stop_threads(system.Scheduler(2).GetThreadList());
@@ -228,13 +227,11 @@ void Process::LoadModule(CodeSet module_, VAddr base_addr) {
228 MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable); 227 MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable);
229 228
230 // Clear instruction cache in CPU JIT 229 // Clear instruction cache in CPU JIT
231 Core::System::GetInstance().ArmInterface(0).ClearInstructionCache(); 230 system.InvalidateCpuInstructionCaches();
232 Core::System::GetInstance().ArmInterface(1).ClearInstructionCache();
233 Core::System::GetInstance().ArmInterface(2).ClearInstructionCache();
234 Core::System::GetInstance().ArmInterface(3).ClearInstructionCache();
235} 231}
236 232
237Process::Process(Core::System& system) : WaitObject{system.Kernel()}, address_arbiter{system} {} 233Process::Process(Core::System& system)
234 : WaitObject{system.Kernel()}, address_arbiter{system}, system{system} {}
238Process::~Process() = default; 235Process::~Process() = default;
239 236
240void Process::Acquire(Thread* thread) { 237void Process::Acquire(Thread* thread) {
diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h
index 2a132c894..47ffd4ad3 100644
--- a/src/core/hle/kernel/process.h
+++ b/src/core/hle/kernel/process.h
@@ -266,7 +266,7 @@ public:
266 void FreeTLSSlot(VAddr tls_address); 266 void FreeTLSSlot(VAddr tls_address);
267 267
268private: 268private:
269 explicit Process(Core::System& kernel); 269 explicit Process(Core::System& system);
270 ~Process() override; 270 ~Process() override;
271 271
272 /// Checks if the specified thread should wait until this process is available. 272 /// Checks if the specified thread should wait until this process is available.
@@ -330,6 +330,10 @@ private:
330 /// Random values for svcGetInfo RandomEntropy 330 /// Random values for svcGetInfo RandomEntropy
331 std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy; 331 std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy;
332 332
333 /// System context
334 Core::System& system;
335
336 /// Name of this process
333 std::string name; 337 std::string name;
334}; 338};
335 339