forked from Bananymous/banan-os
Kernel: fix spinlock for i386
This commit is contained in:
parent
0d2d6e5348
commit
01f267a321
|
@ -1,17 +1,19 @@
|
|||
.global spinlock_lock_asm
|
||||
spinlock_lock_asm:
|
||||
lock; btsl $0, (%edi)
|
||||
movl 4(%esp), %eax
|
||||
lock; btsl $0, (%eax)
|
||||
jnc .done
|
||||
.retry:
|
||||
pause
|
||||
testl $1, (%edi)
|
||||
testl $1, (%eax)
|
||||
jne .retry
|
||||
lock; btsl $0, (%edi)
|
||||
lock; btsl $0, (%eax)
|
||||
jc .retry
|
||||
.done:
|
||||
ret
|
||||
|
||||
.global spinlock_unlock_asm
|
||||
spinlock_unlock_asm:
|
||||
movl $0, (%edi)
|
||||
movl 4(%esp), %eax
|
||||
movl $0, (%eax)
|
||||
ret
|
Loading…
Reference in New Issue