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