SMP and timer interrupts

This commit is contained in:
2025-12-23 19:50:37 +01:00
parent 259aa732c8
commit c16170e4c2
31 changed files with 1766 additions and 88 deletions

View File

@@ -1,10 +1,17 @@
#include <libk/std.h>
#include <sync/spin_lock.h>
#include <sys/irq.h>
#include <sys/spin_lock.h>
void spin_lock (spin_lock_t* sl) {
irq_save ();
while (atomic_flag_test_and_set_explicit (sl, memory_order_acquire))
spin_lock_relax ();
}
void spin_unlock (spin_lock_t* sl) { atomic_flag_clear_explicit (sl, memory_order_release); }
void spin_unlock (spin_lock_t* sl) {
atomic_flag_clear_explicit (sl, memory_order_release);
irq_restore ();
}