diff options
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 615d7901a..7902c2882 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | #include "core/core.h" | 14 | #include "core/core.h" |
| 15 | #include "core/core_timing.h" | 15 | #include "core/core_timing.h" |
| 16 | #include "core/hle/kernel/client_port.h" | ||
| 16 | #include "core/hle/kernel/handle_table.h" | 17 | #include "core/hle/kernel/handle_table.h" |
| 17 | #include "core/hle/kernel/kernel.h" | 18 | #include "core/hle/kernel/kernel.h" |
| 18 | #include "core/hle/kernel/process.h" | 19 | #include "core/hle/kernel/process.h" |
| @@ -124,6 +125,8 @@ struct KernelCore::Impl { | |||
| 124 | 125 | ||
| 125 | timer_callback_handle_table.Clear(); | 126 | timer_callback_handle_table.Clear(); |
| 126 | timer_callback_event_type = nullptr; | 127 | timer_callback_event_type = nullptr; |
| 128 | |||
| 129 | named_ports.clear(); | ||
| 127 | } | 130 | } |
| 128 | 131 | ||
| 129 | void InitializeResourceLimits(KernelCore& kernel) { | 132 | void InitializeResourceLimits(KernelCore& kernel) { |
| @@ -217,6 +220,10 @@ struct KernelCore::Impl { | |||
| 217 | // TODO(yuriks): This can be removed if Thread objects are explicitly pooled in the future, | 220 | // TODO(yuriks): This can be removed if Thread objects are explicitly pooled in the future, |
| 218 | // allowing us to simply use a pool index or similar. | 221 | // allowing us to simply use a pool index or similar. |
| 219 | Kernel::HandleTable thread_wakeup_callback_handle_table; | 222 | Kernel::HandleTable thread_wakeup_callback_handle_table; |
| 223 | |||
| 224 | /// Map of named ports managed by the kernel, which can be retrieved using | ||
| 225 | /// the ConnectToPort SVC. | ||
| 226 | NamedPortTable named_ports; | ||
| 220 | }; | 227 | }; |
| 221 | 228 | ||
| 222 | KernelCore::KernelCore() : impl{std::make_unique<Impl>()} {} | 229 | KernelCore::KernelCore() : impl{std::make_unique<Impl>()} {} |
| @@ -257,6 +264,23 @@ void KernelCore::AppendNewProcess(SharedPtr<Process> process) { | |||
| 257 | impl->process_list.push_back(std::move(process)); | 264 | impl->process_list.push_back(std::move(process)); |
| 258 | } | 265 | } |
| 259 | 266 | ||
| 267 | void KernelCore::AddNamedPort(std::string name, SharedPtr<ClientPort> port) { | ||
| 268 | impl->named_ports.emplace(std::move(name), std::move(port)); | ||
| 269 | } | ||
| 270 | |||
| 271 | KernelCore::NamedPortTable::iterator KernelCore::FindNamedPort(const std::string& name) { | ||
| 272 | return impl->named_ports.find(name); | ||
| 273 | } | ||
| 274 | |||
| 275 | KernelCore::NamedPortTable::const_iterator KernelCore::FindNamedPort( | ||
| 276 | const std::string& name) const { | ||
| 277 | return impl->named_ports.find(name); | ||
| 278 | } | ||
| 279 | |||
| 280 | bool KernelCore::IsValidNamedPort(NamedPortTable::const_iterator port) const { | ||
| 281 | return port != impl->named_ports.cend(); | ||
| 282 | } | ||
| 283 | |||
| 260 | u32 KernelCore::CreateNewObjectID() { | 284 | u32 KernelCore::CreateNewObjectID() { |
| 261 | return impl->next_object_id++; | 285 | return impl->next_object_id++; |
| 262 | } | 286 | } |