mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
kernel: remove unecessary process member from handle table
This commit is contained in:
parent
5165ed9efd
commit
cf8c7d4ed3
@ -30,7 +30,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {}
|
explicit KHandleTable(KernelCore& kernel) : m_kernel(kernel) {}
|
||||||
|
|
||||||
Result Initialize(KProcess* owner, s32 size) {
|
Result Initialize(s32 size) {
|
||||||
// Check that the table size is valid.
|
// Check that the table size is valid.
|
||||||
R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory);
|
R_UNLESS(size <= static_cast<s32>(MaxTableSize), ResultOutOfMemory);
|
||||||
|
|
||||||
@ -44,7 +44,6 @@ public:
|
|||||||
m_next_linear_id = MinLinearId;
|
m_next_linear_id = MinLinearId;
|
||||||
m_count = 0;
|
m_count = 0;
|
||||||
m_free_head_index = -1;
|
m_free_head_index = -1;
|
||||||
m_owner = owner;
|
|
||||||
|
|
||||||
// Free all entries.
|
// Free all entries.
|
||||||
for (s32 i = 0; i < static_cast<s32>(m_table_size); ++i) {
|
for (s32 i = 0; i < static_cast<s32>(m_table_size); ++i) {
|
||||||
@ -91,8 +90,7 @@ public:
|
|||||||
// Handle pseudo-handles.
|
// Handle pseudo-handles.
|
||||||
if constexpr (std::derived_from<KProcess, T>) {
|
if constexpr (std::derived_from<KProcess, T>) {
|
||||||
if (handle == Svc::PseudoHandle::CurrentProcess) {
|
if (handle == Svc::PseudoHandle::CurrentProcess) {
|
||||||
// TODO: this should be the current process
|
auto* const cur_process = GetCurrentProcessPointer(m_kernel);
|
||||||
auto* const cur_process = m_owner;
|
|
||||||
ASSERT(cur_process != nullptr);
|
ASSERT(cur_process != nullptr);
|
||||||
return cur_process;
|
return cur_process;
|
||||||
}
|
}
|
||||||
@ -302,7 +300,6 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
KernelCore& m_kernel;
|
KernelCore& m_kernel;
|
||||||
KProcess* m_owner{};
|
|
||||||
std::array<EntryInfo, MaxTableSize> m_entry_infos{};
|
std::array<EntryInfo, MaxTableSize> m_entry_infos{};
|
||||||
std::array<KAutoObject*, MaxTableSize> m_objects{};
|
std::array<KAutoObject*, MaxTableSize> m_objects{};
|
||||||
mutable KSpinLock m_lock;
|
mutable KSpinLock m_lock;
|
||||||
|
@ -552,7 +552,7 @@ private:
|
|||||||
|
|
||||||
Result InitializeHandleTable(s32 size) {
|
Result InitializeHandleTable(s32 size) {
|
||||||
// Try to initialize the handle table.
|
// 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.
|
// We succeeded, so note that we did.
|
||||||
m_is_handle_table_initialized = true;
|
m_is_handle_table_initialized = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user