mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-14 15:14:23 -04:00
kern: refactor to use m_ for member variables
This commit is contained in:
parent
0bf2ade76f
commit
968f50bc07
135 changed files with 3727 additions and 3734 deletions
|
@ -18,18 +18,18 @@
|
|||
namespace ams::kern {
|
||||
|
||||
void KInterruptTaskManager::TaskQueue::Enqueue(KInterruptTask *task) {
|
||||
MESOSPHERE_ASSERT(task != this->head);
|
||||
MESOSPHERE_ASSERT(task != this->tail);
|
||||
MESOSPHERE_ASSERT(task != m_head);
|
||||
MESOSPHERE_ASSERT(task != m_tail);
|
||||
MESOSPHERE_AUDIT(task->GetNextTask() == nullptr);
|
||||
|
||||
/* Insert the task into the queue. */
|
||||
if (this->tail != nullptr) {
|
||||
this->tail->SetNextTask(task);
|
||||
if (m_tail != nullptr) {
|
||||
m_tail->SetNextTask(task);
|
||||
} else {
|
||||
this->head = task;
|
||||
m_head = task;
|
||||
}
|
||||
|
||||
this->tail = task;
|
||||
m_tail = task;
|
||||
|
||||
/* Set the next task for auditing. */
|
||||
#if defined (MESOSPHERE_BUILD_FOR_AUDITING)
|
||||
|
@ -38,18 +38,18 @@ namespace ams::kern {
|
|||
}
|
||||
|
||||
void KInterruptTaskManager::TaskQueue::Dequeue() {
|
||||
MESOSPHERE_ASSERT(this->head != nullptr);
|
||||
MESOSPHERE_ASSERT(this->tail != nullptr);
|
||||
MESOSPHERE_AUDIT(this->tail->GetNextTask() == GetDummyInterruptTask());
|
||||
MESOSPHERE_ASSERT(m_head != nullptr);
|
||||
MESOSPHERE_ASSERT(m_tail != nullptr);
|
||||
MESOSPHERE_AUDIT(m_tail->GetNextTask() == GetDummyInterruptTask());
|
||||
|
||||
/* Pop the task from the front of the queue. */
|
||||
KInterruptTask *old_head = this->head;
|
||||
KInterruptTask *old_head = m_head;
|
||||
|
||||
if (this->head == this->tail) {
|
||||
this->head = nullptr;
|
||||
this->tail = nullptr;
|
||||
if (m_head == m_tail) {
|
||||
m_head = nullptr;
|
||||
m_tail = nullptr;
|
||||
} else {
|
||||
this->head = this->head->GetNextTask();
|
||||
m_head = m_head->GetNextTask();
|
||||
}
|
||||
|
||||
#if defined (MESOSPHERE_BUILD_FOR_AUDITING)
|
||||
|
@ -72,13 +72,13 @@ namespace ams::kern {
|
|||
{
|
||||
KScopedInterruptDisable di;
|
||||
|
||||
task = this->task_queue.GetHead();
|
||||
task = m_task_queue.GetHead();
|
||||
if (task == nullptr) {
|
||||
this->thread->SetState(KThread::ThreadState_Waiting);
|
||||
m_thread->SetState(KThread::ThreadState_Waiting);
|
||||
continue;
|
||||
}
|
||||
|
||||
this->task_queue.Dequeue();
|
||||
m_task_queue.Dequeue();
|
||||
}
|
||||
|
||||
/* Do the task. */
|
||||
|
@ -91,20 +91,20 @@ namespace ams::kern {
|
|||
MESOSPHERE_ABORT_UNLESS(Kernel::GetSystemResourceLimit().Reserve(ams::svc::LimitableResource_ThreadCountMax, 1));
|
||||
|
||||
/* Create and initialize the thread. */
|
||||
this->thread = KThread::Create();
|
||||
MESOSPHERE_ABORT_UNLESS(this->thread != nullptr);
|
||||
MESOSPHERE_R_ABORT_UNLESS(KThread::InitializeHighPriorityThread(this->thread, ThreadFunction, reinterpret_cast<uintptr_t>(this)));
|
||||
KThread::Register(this->thread);
|
||||
m_thread = KThread::Create();
|
||||
MESOSPHERE_ABORT_UNLESS(m_thread != nullptr);
|
||||
MESOSPHERE_R_ABORT_UNLESS(KThread::InitializeHighPriorityThread(m_thread, ThreadFunction, reinterpret_cast<uintptr_t>(this)));
|
||||
KThread::Register(m_thread);
|
||||
|
||||
/* Run the thread. */
|
||||
this->thread->Run();
|
||||
m_thread->Run();
|
||||
}
|
||||
|
||||
void KInterruptTaskManager::EnqueueTask(KInterruptTask *task) {
|
||||
MESOSPHERE_ASSERT(!KInterruptManager::AreInterruptsEnabled());
|
||||
|
||||
/* Enqueue the task and signal the scheduler. */
|
||||
this->task_queue.Enqueue(task);
|
||||
m_task_queue.Enqueue(task);
|
||||
Kernel::GetScheduler().SetInterruptTaskRunnable();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue