mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:07:45 +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:
parent
1a1e0e6364
commit
2079728a74
3 changed files with 20 additions and 10 deletions
|
@ -147,6 +147,11 @@ public:
|
|||
return current().m_in_critical;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static void verify_no_spinlocks_held()
|
||||
{
|
||||
VERIFY(!Processor::in_critical());
|
||||
}
|
||||
|
||||
// FIXME: Actually return the idle thread once aarch64 supports threading.
|
||||
ALWAYS_INLINE static Thread* idle_thread()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue