kern: implement more of KInterruptManager

This commit is contained in:
Michael Scire committed 2020-02-05 14:07:51 -08:00
1 parent 62de3322ff
commit 5f857cb079
17 files changed
+579 -39

No files matched your search

@@ -202,6 +202,18 @@ namespace ams::kern {
/* TODO */
}
void KThread::SetState(ThreadState state) {
MESOSPHERE_ASSERT_THIS();
KScopedSchedulerLock sl;
const ThreadState old_state = this->thread_state;
this->thread_state = static_cast<ThreadState>((old_state & ~ThreadState_Mask) | (state & ThreadState_Mask));
if (this->thread_state != old_state) {
KScheduler::OnThreadStateChanged(this, old_state);
}
}
KThreadContext *KThread::GetContextForSchedulerLoop() {
return std::addressof(this->thread_context);
}