did some restructuring, got multitasking almost working
This commit is contained in:
11
kernel/lib/tasks.c
Normal file
11
kernel/lib/tasks.c
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <lib/tasks.h>
|
||||
|
||||
void spin_lock(spinlock_t *lock) {
|
||||
while (__sync_lock_test_and_set(&lock->locked, 1)) {
|
||||
asm volatile("pause");
|
||||
}
|
||||
}
|
||||
|
||||
void spin_unlock(spinlock_t *lock) {
|
||||
__sync_lock_release(&lock->locked);
|
||||
}
|
||||
Reference in New Issue
Block a user