Implement lock IRQ nesting via stack variables/contexts
All checks were successful
Build documentation / build-and-deploy (push) Successful in 21s

This commit is contained in:
2026-01-14 22:11:56 +01:00
parent 55166f9d5f
commit 270ff507d4
22 changed files with 197 additions and 145 deletions

View File

@@ -3,15 +3,15 @@
#include <sys/irq.h>
#include <sys/spin_lock.h>
void spin_lock (spin_lock_t* sl) {
irq_save ();
void spin_lock (spin_lock_t* sl, spin_lock_ctx_t* ctx) {
irq_save (ctx);
while (atomic_flag_test_and_set_explicit (sl, memory_order_acquire))
spin_lock_relax ();
}
void spin_unlock (spin_lock_t* sl) {
void spin_unlock (spin_lock_t* sl, spin_lock_ctx_t* ctx) {
atomic_flag_clear_explicit (sl, memory_order_release);
irq_restore ();
irq_restore (ctx);
}