lib: move lock/atomic into lib folder
This commit is contained in:
parent
f482174458
commit
e4116bd3e8
2 changed files with 0 additions and 0 deletions
13
init/lock.c
13
init/lock.c
|
|
@ -1,13 +0,0 @@
|
|||
#include <kernel/common.h>
|
||||
#include <kernel/lock.h>
|
||||
|
||||
void spinlock_acquire(spinlock_t *lock)
|
||||
{
|
||||
while (atomic_cmpxchg(lock, 0, 1))
|
||||
;
|
||||
}
|
||||
|
||||
void spinlock_release(spinlock_t *lock)
|
||||
{
|
||||
atomic_cmpxchg(lock, 1, 0);
|
||||
}
|
||||
Loading…
Reference in a new issue