diff options
author | Fernando S <fsahmkow27@gmail.com> | 2023-12-24 16:23:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-24 16:23:14 +0100 |
commit | 05e3db3ac9edbff0e4885ef8b42d3a2427c9f027 (patch) | |
tree | 2f959b67638ab1134cfca19ac1f041552a68c335 /src/core/hle/kernel/k_handle_table.h | |
parent | Merge pull request #12412 from ameerj/gl-query-prims (diff) | |
parent | kernel: fix resource limit imbalance (diff) | |
download | yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar.gz yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar.bz2 yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar.lz yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar.xz yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.tar.zst yuzu-05e3db3ac9edbff0e4885ef8b42d3a2427c9f027.zip |
Diffstat (limited to 'src/core/hle/kernel/k_handle_table.h')
-rw-r--r-- | src/core/hle/kernel/k_handle_table.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h index d7660630c..4e6dcd66b 100644 --- a/src/core/hle/kernel/k_handle_table.h +++ b/src/core/hle/kernel/k_handle_table.h @@ -30,7 +30,7 @@ public: public: explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {} - Result Initialize(s32 size) { + Result Initialize(KProcess* owner, s32 size) { // Check that the table size is valid. R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory); @@ -44,6 +44,7 @@ public: m_next_linear_id = MinLinearId; m_count = 0; m_free_head_index = -1; + m_owner = owner; // Free all entries. for (s32 i = 0; i < static_cast<s32>(m_table_size); ++i) { @@ -90,8 +91,8 @@ public: // Handle pseudo-handles. if constexpr (std::derived_from<KProcess, T>) { if (handle == Svc::PseudoHandle::CurrentProcess) { - //! FIXME: this is the wrong process! - auto* const cur_process = m_kernel.ApplicationProcess(); + // TODO: this should be the current process + auto* const cur_process = m_owner; ASSERT(cur_process != nullptr); return cur_process; } @@ -301,6 +302,7 @@ private: private: KernelCore& m_kernel; + KProcess* m_owner{}; std::array<EntryInfo, MaxTableSize> m_entry_infos{}; std::array<KAutoObject*, MaxTableSize> m_objects{}; mutable KSpinLock m_lock; |