summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2023-12-24 19:23:03 -0500
committerGravatar Liam2023-12-24 19:23:03 -0500
commitcf8c7d4ed3cb3f314395156f0436a1325db9b68a (patch)
tree4ba9e898ccb670e1ebf6c6bc19540f2b5b781436 /src
parentservice: fetch objects from the client handle table (diff)
downloadyuzu-cf8c7d4ed3cb3f314395156f0436a1325db9b68a.tar.gz
yuzu-cf8c7d4ed3cb3f314395156f0436a1325db9b68a.tar.xz
yuzu-cf8c7d4ed3cb3f314395156f0436a1325db9b68a.zip
kernel: remove unecessary process member from handle table
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_handle_table.h7
-rw-r--r--src/core/hle/kernel/k_process.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h
index 4e6dcd66b..1bf68e6b0 100644
--- a/src/core/hle/kernel/k_handle_table.h
+++ b/src/core/hle/kernel/k_handle_table.h
@@ -30,7 +30,7 @@ public:
30public: 30public:
31 explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {} 31 explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {}
32 32
33 Result Initialize(KProcess* owner, s32 size) { 33 Result Initialize(s32 size) {
34 // Check that the table size is valid. 34 // Check that the table size is valid.
35 R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory); 35 R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory);
36 36
@@ -44,7 +44,6 @@ public:
44 m_next_linear_id = MinLinearId; 44 m_next_linear_id = MinLinearId;
45 m_count = 0; 45 m_count = 0;
46 m_free_head_index = -1; 46 m_free_head_index = -1;
47 m_owner = owner;
48 47
49 // Free all entries. 48 // Free all entries.
50 for (s32 i = 0; i < static_cast<s32>(m_table_size); ++i) { 49 for (s32 i = 0; i < static_cast<s32>(m_table_size); ++i) {
@@ -91,8 +90,7 @@ public:
91 // Handle pseudo-handles. 90 // Handle pseudo-handles.
92 if constexpr (std::derived_from<KProcess, T>) { 91 if constexpr (std::derived_from<KProcess, T>) {
93 if (handle == Svc::PseudoHandle::CurrentProcess) { 92 if (handle == Svc::PseudoHandle::CurrentProcess) {
94 // TODO: this should be the current process 93 auto* const cur_process = GetCurrentProcessPointer(m_kernel);
95 auto* const cur_process = m_owner;
96 ASSERT(cur_process != nullptr); 94 ASSERT(cur_process != nullptr);
97 return cur_process; 95 return cur_process;
98 } 96 }
@@ -302,7 +300,6 @@ private:
302 300
303private: 301private:
304 KernelCore& m_kernel; 302 KernelCore& m_kernel;
305 KProcess* m_owner{};
306 std::array<EntryInfo, MaxTableSize> m_entry_infos{}; 303 std::array<EntryInfo, MaxTableSize> m_entry_infos{};
307 std::array<KAutoObject*, MaxTableSize> m_objects{}; 304 std::array<KAutoObject*, MaxTableSize> m_objects{};
308 mutable KSpinLock m_lock; 305 mutable KSpinLock m_lock;
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h
index b5c6867a1..53c0e3316 100644
--- a/src/core/hle/kernel/k_process.h
+++ b/src/core/hle/kernel/k_process.h
@@ -552,7 +552,7 @@ private:
552 552
553 Result InitializeHandleTable(s32 size) { 553 Result InitializeHandleTable(s32 size) {
554 // Try to initialize the handle table. 554 // Try to initialize the handle table.
555 R_TRY(m_handle_table.Initialize(this, size)); 555 R_TRY(m_handle_table.Initialize(size));
556 556
557 // We succeeded, so note that we did. 557 // We succeeded, so note that we did.
558 m_is_handle_table_initialized = true; 558 m_is_handle_table_initialized = true;