diff options
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/kernel/kernel.h | 9 |
2 files changed, 23 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 { | |||
| 116 | next_thread_id = 1; | 116 | next_thread_id = 1; |
| 117 | 117 | ||
| 118 | process_list.clear(); | 118 | process_list.clear(); |
| 119 | current_process.reset(); | ||
| 119 | 120 | ||
| 120 | handle_table.Clear(); | 121 | handle_table.Clear(); |
| 121 | resource_limits.fill(nullptr); | 122 | resource_limits.fill(nullptr); |
| @@ -206,6 +207,7 @@ struct KernelCore::Impl { | |||
| 206 | 207 | ||
| 207 | // Lists all processes that exist in the current session. | 208 | // Lists all processes that exist in the current session. |
| 208 | std::vector<SharedPtr<Process>> process_list; | 209 | std::vector<SharedPtr<Process>> process_list; |
| 210 | SharedPtr<Process> current_process; | ||
| 209 | 211 | ||
| 210 | Kernel::HandleTable handle_table; | 212 | Kernel::HandleTable handle_table; |
| 211 | std::array<SharedPtr<ResourceLimit>, 4> resource_limits; | 213 | std::array<SharedPtr<ResourceLimit>, 4> resource_limits; |
| @@ -264,6 +266,18 @@ void KernelCore::AppendNewProcess(SharedPtr<Process> process) { | |||
| 264 | impl->process_list.push_back(std::move(process)); | 266 | impl->process_list.push_back(std::move(process)); |
| 265 | } | 267 | } |
| 266 | 268 | ||
| 269 | void KernelCore::MakeCurrentProcess(SharedPtr<Process> process) { | ||
| 270 | impl->current_process = std::move(process); | ||
| 271 | } | ||
| 272 | |||
| 273 | SharedPtr<Process>& KernelCore::CurrentProcess() { | ||
| 274 | return impl->current_process; | ||
| 275 | } | ||
| 276 | |||
| 277 | const SharedPtr<Process>& KernelCore::CurrentProcess() const { | ||
| 278 | return impl->current_process; | ||
| 279 | } | ||
| 280 | |||
| 267 | void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { | 281 | void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { |
| 268 | impl->named_ports.emplace(std::move(name), std::move(port)); | 282 | impl->named_ports.emplace(std::move(name), std::move(port)); |
| 269 | } | 283 | } |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index ab2e9bffa..c0771ecf0 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -65,6 +65,15 @@ public: | |||
| 65 | /// Adds the given shared pointer to an internal list of active processes. | 65 | /// Adds the given shared pointer to an internal list of active processes. |
| 66 | void AppendNewProcess(SharedPtr<Process> process); | 66 | void AppendNewProcess(SharedPtr<Process> process); |
| 67 | 67 | ||
| 68 | /// Makes the given process the new current process. | ||
| 69 | void MakeCurrentProcess(SharedPtr<Process> process); | ||
| 70 | |||
| 71 | /// Retrieves a reference to the current process. | ||
| 72 | SharedPtr<Process>& CurrentProcess(); | ||
| 73 | |||
| 74 | /// Retrieves a const reference to the current process. | ||
| 75 | const SharedPtr<Process>& CurrentProcess() const; | ||
| 76 | |||
| 68 | /// Adds a port to the named port table | 77 | /// Adds a port to the named port table |
| 69 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); | 78 | void AddNamedPort(std::string name, SharedPtr<ClientPort> port); |
| 70 | 79 | ||