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

Kernel: Add formal Processor::verify_no_spinlocks_held() API

In a few places we check `!Processor::in_critical()` to validate
that the current processor doesn't hold any kernel spinlocks.

Instead lets provide it a first class name for readability.
I'll also be adding more of these, so I would rather add more
usages of a nice API instead of this implicit/assumed logic.
This commit is contained in:
Brian Gianforcaro 2022-10-15 00:56:42 -07:00 committed by Andrew Kaster
parent 1a1e0e6364
commit 2079728a74
3 changed files with 20 additions and 10 deletions

View file

@ -370,6 +370,11 @@ public:
return read_gs_ptr(__builtin_offsetof(Processor, m_in_critical));
}
ALWAYS_INLINE static void verify_no_spinlocks_held()
{
VERIFY(!Processor::in_critical());
}
ALWAYS_INLINE static FPUState const& clean_fpu_state() { return s_clean_fpu_state; }
static void smp_enable();