summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-09-08 04:34:05 +0200
committerGitHub <noreply@github.com>2018-09-08 04:34:05 +0200
commit460ebc818731a443022cf7c897b52cbe66d1d664 (patch)
treeecf566e313375b34ce1abadcf6005d813c39397e /src/core/hle/kernel/kernel.cpp
parentMerge pull request #1260 from MerryMage/dynarmic (diff)
parentcore: Migrate current_process pointer to the kernel (diff)
downloadyuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar.gz
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar.bz2
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar.lz
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar.xz
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.tar.zst
yuzu-460ebc818731a443022cf7c897b52cbe66d1d664.zip
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 7902c2882..3e0800a71 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -116,6 +116,7 @@ struct KernelCore::Impl {
next_thread_id = 1;
process_list.clear();
+ current_process.reset();
handle_table.Clear();
resource_limits.fill(nullptr);
@@ -206,6 +207,7 @@ struct KernelCore::Impl {
// Lists all processes that exist in the current session.
std::vector<SharedPtr<Process>> process_list;
+ SharedPtr<Process> current_process;
Kernel::HandleTable handle_table;
std::array<SharedPtr<ResourceLimit>, 4> resource_limits;
@@ -264,6 +266,18 @@ void KernelCore::AppendNewProcess(SharedPtr<Process> process) {
impl->process_list.push_back(std::move(process));
}
+void KernelCore::MakeCurrentProcess(SharedPtr<Process> process) {
+ impl->current_process = std::move(process);
+}
+
+SharedPtr<Process>& KernelCore::CurrentProcess() {
+ return impl->current_process;
+}
+
+const SharedPtr<Process>& KernelCore::CurrentProcess() const {
+ return impl->current_process;
+}
+
void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) {
impl->named_ports.emplace(std::move(name), std::move(port));
}