kern: implement more of KInterruptManager

This commit is contained in:
Michael Scire 2020-02-05 14:07:51 -08:00
parent 62de3322ff
commit 5f857cb079
17 changed files with 579 additions and 39 deletions

View file

@ -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);
}