mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-14 23:24:26 -04:00
kern: implement more of KInterruptManager
This commit is contained in:
parent
62de3322ff
commit
5f857cb079
17 changed files with 579 additions and 39 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue