Make spinlock disable interrupts
This commit is contained in:
@ -63,10 +63,11 @@ void kmain(void) {
|
||||
paging_init();
|
||||
dlmalloc_check();
|
||||
hal_init_withmalloc();
|
||||
/* hal_intr_disable(); */
|
||||
hal_intr_disable();
|
||||
storedev_init();
|
||||
baseimg_init();
|
||||
vfs_init();
|
||||
hal_intr_enable();
|
||||
|
||||
/* kprintf(BANNER_TEXT "\n"); */
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user