aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLiam <[email protected]>2023-12-24 19:23:03 -0500
committerLiam <[email protected]>2023-12-24 19:23:03 -0500
commitcf8c7d4ed3cb3f314395156f0436a1325db9b68a (patch)
tree4ba9e898ccb670e1ebf6c6bc19540f2b5b781436
parent5165ed9efd6e6593b969ce560c952e074f4d9e06 (diff)
downloadyuzu-android-cf8c7d4ed3cb3f314395156f0436a1325db9b68a.tar.gz
yuzu-android-cf8c7d4ed3cb3f314395156f0436a1325db9b68a.zip
kernel: remove unecessary process member from handle table
-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:
public:
explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {}
- Result Initialize(KProcess* owner, s32 size) {
+ Result Initialize(s32 size) {
// Check that the table size is valid.
R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory);
@@ -44,7 +44,6 @@ 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) {
@@ -91,8 +90,7 @@ public:
// Handle pseudo-handles.
if constexpr (std::derived_from<KProcess, T>) {
if (handle == Svc::PseudoHandle::CurrentProcess) {
- // TODO: this should be the current process
- auto* const cur_process = m_owner;
+ auto* const cur_process = GetCurrentProcessPointer(m_kernel);
ASSERT(cur_process != nullptr);
return cur_process;
}
@@ -302,7 +300,6 @@ 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;
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:
Result InitializeHandleTable(s32 size) {
// Try to initialize the handle table.
- R_TRY(m_handle_table.Initialize(this, size));
+ R_TRY(m_handle_table.Initialize(size));
// We succeeded, so note that we did.
m_is_handle_table_initialized = true;