mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:17:35 +00:00
Kernel/x86: Move Processor::{leave,clear}_critical() out of line
I don't think this code needs to be ALWAYS_INLINE, and moving it out of line will make backtraces nicer.
This commit is contained in:
parent
28e552f853
commit
cd348918f9
2 changed files with 34 additions and 29 deletions
|
@ -1665,4 +1665,35 @@ u64 Processor::time_spent_idle() const
|
|||
return m_idle_thread->time_in_user() + m_idle_thread->time_in_kernel();
|
||||
}
|
||||
|
||||
void Processor::leave_critical()
|
||||
{
|
||||
current().do_leave_critical();
|
||||
}
|
||||
|
||||
void Processor::do_leave_critical()
|
||||
{
|
||||
VERIFY(m_in_critical > 0);
|
||||
if (m_in_critical == 1) {
|
||||
if (m_in_irq == 0) {
|
||||
deferred_call_execute_pending();
|
||||
VERIFY(m_in_critical == 1);
|
||||
}
|
||||
m_in_critical = 0;
|
||||
if (m_in_irq == 0)
|
||||
check_invoke_scheduler();
|
||||
} else {
|
||||
m_in_critical = m_in_critical - 1;
|
||||
}
|
||||
}
|
||||
|
||||
u32 Processor::clear_critical()
|
||||
{
|
||||
auto prev_critical = in_critical();
|
||||
write_gs_ptr(__builtin_offsetof(Processor, m_in_critical), 0);
|
||||
auto& proc = current();
|
||||
if (proc.m_in_irq == 0)
|
||||
proc.check_invoke_scheduler();
|
||||
return prev_critical;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue