1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-16 11:27:38 +00:00

Kernel: Use new Thread::previous_mode to track ticks

This commit is contained in:
Tom 2021-01-25 16:37:36 -07:00 committed by Andreas Kling
parent 0bd558081e
commit 33cdc1d2f1
3 changed files with 4 additions and 4 deletions

View file

@ -500,7 +500,7 @@ void Scheduler::timer_tick(const RegisterState& regs)
[[maybe_unused]] auto rc = perf_events.append_with_eip_and_ebp(regs.eip, regs.ebp, PERF_EVENT_SAMPLE, 0, 0);
}
if (current_thread->tick((regs.cs & 3) == 0))
if (current_thread->tick())
return;
ASSERT_INTERRUPTS_DISABLED();

View file

@ -413,9 +413,9 @@ void Thread::finalize_dying_threads()
}
}
bool Thread::tick(bool in_kernel)
bool Thread::tick()
{
if (in_kernel) {
if (previous_mode() == PreviousMode::KernelMode) {
++m_process->m_ticks_in_kernel;
++m_ticks_in_kernel;
} else {

View file

@ -971,7 +971,7 @@ public:
void exit(void* = nullptr);
bool tick(bool in_kernel);
bool tick();
void set_ticks_left(u32 t) { m_ticks_left = t; }
u32 ticks_left() const { return m_ticks_left; }