Make spinlock disable interrupts

This commit is contained in:
2025-08-22 12:42:04 +02:00
parent 182c6e2956
commit 8cf1bde879
2 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include <stdatomic.h>
#include <stdint.h>
#include "spinlock.h"
#include "hal/hal.h"
void spinlock_init(SpinLock *sl) {
atomic_store(&sl->lock, false);
@ -12,9 +13,11 @@ void spinlock_acquire(SpinLock *sl) {
unlocked = false;
SPINLOCK_HINT();
}
hal_intr_disable();
}
void spinlock_release(SpinLock *sl) {
atomic_store(&sl->lock, false);
hal_intr_enable();
}