hle: kernel: Cleanup to match coding style.

This commit is contained in:
bunnei 2021-11-21 02:29:53 -08:00
parent 316a2dd22a
commit 8f4ff06c4c
6 changed files with 21 additions and 26 deletions

View File

@ -87,9 +87,6 @@ bool UpdateIfEqual(Core::System& system, s32* out, VAddr address, s32 value, s32
} }
class ThreadQueueImplForKAddressArbiter final : public KThreadQueue { class ThreadQueueImplForKAddressArbiter final : public KThreadQueue {
private:
KAddressArbiter::ThreadTree* m_tree;
public: public:
explicit ThreadQueueImplForKAddressArbiter(KernelCore& kernel_, KAddressArbiter::ThreadTree* t) explicit ThreadQueueImplForKAddressArbiter(KernelCore& kernel_, KAddressArbiter::ThreadTree* t)
: KThreadQueue(kernel_), m_tree(t) {} : KThreadQueue(kernel_), m_tree(t) {}
@ -105,6 +102,9 @@ public:
// Invoke the base cancel wait handler. // Invoke the base cancel wait handler.
KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task); KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task);
} }
private:
KAddressArbiter::ThreadTree* m_tree;
}; };
} // namespace } // namespace

View File

@ -13,10 +13,6 @@ namespace Kernel {
namespace { namespace {
class ThreadQueueImplForKLightConditionVariable final : public KThreadQueue { class ThreadQueueImplForKLightConditionVariable final : public KThreadQueue {
private:
KThread::WaiterList* m_wait_list;
bool m_allow_terminating_thread;
public: public:
ThreadQueueImplForKLightConditionVariable(KernelCore& kernel_, KThread::WaiterList* wl, ThreadQueueImplForKLightConditionVariable(KernelCore& kernel_, KThread::WaiterList* wl,
bool term) bool term)
@ -35,6 +31,10 @@ public:
// Invoke the base cancel wait handler. // Invoke the base cancel wait handler.
KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task); KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task);
} }
private:
KThread::WaiterList* m_wait_list;
bool m_allow_terminating_thread;
}; };
} // namespace } // namespace

View File

@ -17,19 +17,10 @@ namespace Kernel {
namespace { namespace {
class ThreadQueueImplForKSynchronizationObjectWait final : public KThreadQueueWithoutEndWait { class ThreadQueueImplForKSynchronizationObjectWait final : public KThreadQueueWithoutEndWait {
private:
using ThreadListNode = KSynchronizationObject::ThreadListNode;
private:
KSynchronizationObject** m_objects;
ThreadListNode* m_nodes;
s32 m_count;
public: public:
ThreadQueueImplForKSynchronizationObjectWait(KernelCore& kernel_, KSynchronizationObject** o, ThreadQueueImplForKSynchronizationObjectWait(KernelCore& kernel_, KSynchronizationObject** o,
ThreadListNode* n, s32 c) KSynchronizationObject::ThreadListNode* n, s32 c)
: KThreadQueueWithoutEndWait(kernel_), m_objects(o), m_nodes(n), m_count(c) { // ... : KThreadQueueWithoutEndWait(kernel_), m_objects(o), m_nodes(n), m_count(c) {}
}
virtual void NotifyAvailable(KThread* waiting_thread, KSynchronizationObject* signaled_object, virtual void NotifyAvailable(KThread* waiting_thread, KSynchronizationObject* signaled_object,
ResultCode wait_result) override { ResultCode wait_result) override {
@ -68,6 +59,11 @@ public:
// Invoke the base cancel wait handler. // Invoke the base cancel wait handler.
KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task); KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task);
} }
private:
KSynchronizationObject** m_objects;
KSynchronizationObject::ThreadListNode* m_nodes;
s32 m_count;
}; };
} // namespace } // namespace

View File

@ -68,13 +68,9 @@ public:
}; };
class ThreadQueueImplForKThreadSetProperty final : public KThreadQueue { class ThreadQueueImplForKThreadSetProperty final : public KThreadQueue {
private:
KThread::WaiterList* m_wait_list;
public: public:
explicit ThreadQueueImplForKThreadSetProperty(KernelCore& kernel_, KThread::WaiterList* wl) explicit ThreadQueueImplForKThreadSetProperty(KernelCore& kernel_, KThread::WaiterList* wl)
: KThreadQueue(kernel_), m_wait_list(wl) { // ... : KThreadQueue(kernel_), m_wait_list(wl) {}
}
virtual void CancelWait(KThread* waiting_thread, ResultCode wait_result, virtual void CancelWait(KThread* waiting_thread, ResultCode wait_result,
bool cancel_timer_task) override { bool cancel_timer_task) override {
@ -84,6 +80,9 @@ public:
// Invoke the base cancel wait handler. // Invoke the base cancel wait handler.
KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task); KThreadQueue::CancelWait(waiting_thread, wait_result, cancel_timer_task);
} }
private:
KThread::WaiterList* m_wait_list;
}; };
} // namespace } // namespace

View File

@ -199,7 +199,7 @@ public:
synced_index = index; synced_index = index;
} }
constexpr s32 GetSyncedIndex() const { [[nodiscard]] constexpr s32 GetSyncedIndex() const {
return synced_index; return synced_index;
} }
@ -207,7 +207,7 @@ public:
wait_result = wait_res; wait_result = wait_res;
} }
constexpr ResultCode GetWaitResult() const { [[nodiscard]] constexpr ResultCode GetWaitResult() const {
return wait_result; return wait_result;
} }

View File

@ -12,7 +12,7 @@ namespace Kernel {
class KThreadQueue { class KThreadQueue {
public: public:
explicit KThreadQueue(KernelCore& kernel_) : kernel{kernel_} {} explicit KThreadQueue(KernelCore& kernel_) : kernel{kernel_} {}
virtual ~KThreadQueue(){}; virtual ~KThreadQueue() = default;
virtual void NotifyAvailable(KThread* waiting_thread, KSynchronizationObject* signaled_object, virtual void NotifyAvailable(KThread* waiting_thread, KSynchronizationObject* signaled_object,
ResultCode wait_result); ResultCode wait_result);