banan-os/kernel/arch/i386/SpinLock.S

17 lines
241 B
ArmAsm
Raw Normal View History

2023-02-01 01:51:25 +02:00
.global spinlock_lock_asm
spinlock_lock_asm:
lock; btsl $0, (%edi)
jnc .done
.retry:
pause
testl $1, (%edi)
jne .retry
lock; btsl $0, (%edi)
jc .retry
.done:
ret
.global spinlock_unlock_asm
spinlock_unlock_asm:
movl $0, (%edi)
ret