Kernel/SMP: Make entering/leaving critical sections multi-processor safe

By making these functions static we close a window where we could get
preempted after calling Processor::current() and move to another
processor.

Co-authored-by: Tom <tomut@yahoo.com>
This commit is contained in:
Andreas Kling 2021-08-10 01:16:08 +02:00
commit 9babb92a4b
Notes: sideshowbarker 2024-07-18 07:10:17 +09:00
11 changed files with 82 additions and 53 deletions

View file

@ -212,7 +212,7 @@ static inline void kmalloc_verify_nospinlock_held()
{
// Catch bad callers allocating under spinlock.
if constexpr (KMALLOC_VERIFY_NO_SPINLOCK_HELD) {
VERIFY(!Processor::current().in_critical());
VERIFY(!Processor::in_critical());
}
}