move spinlock.h

the implementation is more arch specific than anything. it has been placed under arch/include
This commit is contained in:
Matheus
2022-07-27 22:16:28 -03:00
parent 7bdacfbd7a
commit 0f1222dd6d
3 changed files with 2 additions and 4 deletions
-14
View File
@@ -1,14 +0,0 @@
#ifndef _SPINLOCK_H_INCLUDE
#define _SPINLOCK_H_INCLUDE
// TODO rewrite this in a more arch independent way
static inline void spinlock_acquire(int *lock){
while(!__sync_bool_compare_and_swap(lock, 0, 1)) asm("pause");
}
static inline void spinlock_release(int *lock){
*lock = 0;
}
#endif