summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-03-15 01:42:46 +0100
committerGitHub <noreply@github.com>2019-03-15 01:42:46 +0100
commit2d9546848e4a477fe865b87b4917e450405ce41f (patch)
tree27566266229bc4ef85b6d43562109eb56191d097 /src/core/hle/kernel
parentMerge pull request #2216 from ReinUsesLisp/rasterizer-system (diff)
parentkernel/process: Remove use of global system accessors (diff)
downloadyuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.gz
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.bz2
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.lz
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.xz
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.tar.zst
yuzu-2d9546848e4a477fe865b87b4917e450405ce41f.zip
Diffstat (limited to 'src/core/hle/kernel')
-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() {
if (thread->GetOwnerProcess() != this)
continue;
- if (thread == GetCurrentThread())
+ if (thread == system.CurrentScheduler().GetCurrentThread())
continue;
// TODO(Subv): When are the other running/ready threads terminated?
@@ -145,7 +145,6 @@ void Process::PrepareForTermination() {
}
};
- const auto& system = Core::System::GetInstance();
stop_threads(system.Scheduler(0).GetThreadList());
stop_threads(system.Scheduler(1).GetThreadList());
stop_threads(system.Scheduler(2).GetThreadList());
@@ -228,13 +227,11 @@ void Process::LoadModule(CodeSet module_, VAddr base_addr) {
MapSegment(module_.DataSegment(), VMAPermission::ReadWrite, MemoryState::CodeMutable);
// Clear instruction cache in CPU JIT
- Core::System::GetInstance().ArmInterface(0).ClearInstructionCache();
- Core::System::GetInstance().ArmInterface(1).ClearInstructionCache();
- Core::System::GetInstance().ArmInterface(2).ClearInstructionCache();
- Core::System::GetInstance().ArmInterface(3).ClearInstructionCache();
+ system.InvalidateCpuInstructionCaches();
}
-Process::Process(Core::System& system) : WaitObject{system.Kernel()}, address_arbiter{system} {}
+Process::Process(Core::System& system)
+ : WaitObject{system.Kernel()}, address_arbiter{system}, system{system} {}
Process::~Process() = default;
void 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:
void FreeTLSSlot(VAddr tls_address);
private:
- explicit Process(Core::System& kernel);
+ explicit Process(Core::System& system);
~Process() override;
/// Checks if the specified thread should wait until this process is available.
@@ -330,6 +330,10 @@ private:
/// Random values for svcGetInfo RandomEntropy
std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy;
+ /// System context
+ Core::System& system;
+
+ /// Name of this process
std::string name;
};