kern: implement SvcDebugActiveProcess, svcGetDebugEvent, SvcWaitProcessWideKeyAtomic

This commit is contained in:
Michael Scire 2020-07-18 20:03:27 -07:00 committed by SciresM
parent 1c5b58ce66
commit 36eb78a3ce
17 changed files with 728 additions and 24 deletions

View file

@ -18,9 +18,9 @@
namespace ams::kern {
void KInterruptTaskManager::TaskQueue::Enqueue(KInterruptTask *task) {
MESOSPHERE_ASSERT(task->GetNextTask() == nullptr);
MESOSPHERE_ASSERT(task != this->head);
MESOSPHERE_ASSERT(task != this->tail);
MESOSPHERE_AUDIT(task->GetNextTask() == nullptr);
/* Insert the task into the queue. */
if (this->tail != nullptr) {
@ -30,19 +30,31 @@ namespace ams::kern {
}
this->tail = task;
/* Set the next task for auditing. */
#if defined (MESOSPHERE_BUILD_FOR_AUDITING)
task->SetNextTask(GetDummyInterruptTask());
#endif
}
void KInterruptTaskManager::TaskQueue::Dequeue() {
MESOSPHERE_ASSERT(this->head != nullptr);
MESOSPHERE_ASSERT(this->tail != nullptr);
MESOSPHERE_AUDIT(this->tail->GetNextTask() == GetDummyInterruptTask());
/* Pop the task from the front of the queue. */
KInterruptTask *old_head = this->head;
if (this->head == this->tail) {
this->head = nullptr;
this->tail = nullptr;
} else {
this->head = this->head->GetNextTask();
}
#if defined (MESOSPHERE_BUILD_FOR_AUDITING)
old_head->SetNextTask(nullptr);
#endif
}
void KInterruptTaskManager::ThreadFunction(uintptr_t arg) {