kern: update scheduler for new switch count tracking logic

This commit is contained in:
Michael Scire 2023-02-21 03:12:17 -07:00
parent 8176f085f1
commit 3a5f406c5f
6 changed files with 39 additions and 18 deletions

View file

@ -43,6 +43,7 @@ namespace ams::kern {
bool interrupt_task_runnable{false};
bool should_count_idle{false};
u64 idle_count{0};
u64 switch_count{0};
KThread *highest_priority_thread{nullptr};
void *idle_thread_stack{nullptr};
KThread *prev_thread{nullptr};
@ -67,6 +68,7 @@ namespace ams::kern {
m_state.interrupt_task_runnable = false;
m_state.should_count_idle = false;
m_state.idle_count = 0;
m_state.switch_count = 0;
m_state.idle_thread_stack = nullptr;
m_state.highest_priority_thread = nullptr;
m_state.prev_thread = nullptr;
@ -93,6 +95,10 @@ namespace ams::kern {
return m_state.idle_count;
}
ALWAYS_INLINE u64 GetSwitchCount() const {
return m_state.switch_count;
}
ALWAYS_INLINE KThread *GetIdleThread() const {
return m_idle_thread;
}